Skip to content
This repository was archived by the owner on Feb 19, 2019. It is now read-only.

Commit 90fdd65

Browse files
committed
Fix Module.hasTag()
Optional<Tag> is never null, check if present instead.
1 parent f221799 commit 90fdd65

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

src/main/java/clientapi/module/Module.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -326,14 +326,12 @@ public final void addTag(Tag tag) {
326326

327327
@Override
328328
public final void removeTag(String id) {
329-
Tag tag;
330-
if ((tag = getTag(id).orElse(null)) != null)
331-
tags.remove(tag);
329+
getTag(id).ifPresent(tags::remove);
332330
}
333331

334332
@Override
335333
public final boolean hasTag(String id) {
336-
return getTag(id) != null;
334+
return getTag(id).isPresent();
337335
}
338336

339337
@Override

0 commit comments

Comments
 (0)