diff --git a/component/common/src/main/java/one/nem/lacerta/component/common/LacertaApplyTagDialog.java b/component/common/src/main/java/one/nem/lacerta/component/common/LacertaApplyTagDialog.java index 3a76ebf5..c5acb14b 100644 --- a/component/common/src/main/java/one/nem/lacerta/component/common/LacertaApplyTagDialog.java +++ b/component/common/src/main/java/one/nem/lacerta/component/common/LacertaApplyTagDialog.java @@ -133,10 +133,14 @@ public class LacertaApplyTagDialog extends DialogFragment { } private void applyChangeToVariable(boolean isChecked, String tagId) { + logger.debug("applyChangeToVariable", "isChecked: " + isChecked); + logger.debug("applyChangeToVariable", "tagId: " + tagId); + logger.debug("applyChangeToVariable", "this.registeredTags.size(): " + this.registeredTags.size()); + logger.debug("applyChangeToVariable", "this.appliedTags.size(): " + this.appliedTags.size()); if (isChecked) { - this.registeredTags.stream().findAny().filter(tag -> tag.getId().equals(tagId)).ifPresent(tag -> this.appliedTags.add(tag)); + this.registeredTags.stream().filter(tag -> tag.getId().equals(tagId)).findFirst().ifPresent(tag -> this.appliedTags.add(tag)); } else { - this.appliedTags.stream().findAny().filter(tag -> tag.getId().equals(tagId)).ifPresent(tag -> this.appliedTags.remove(tag)); + this.appliedTags.stream().filter(tag -> tag.getId().equals(tagId)).findFirst().ifPresent(tag -> this.appliedTags.remove(tag)); } }