From de8da3abda70c216e4c282a0977364169ab6878d Mon Sep 17 00:00:00 2001 From: zaaarf Date: Tue, 7 Feb 2023 17:42:53 +0100 Subject: feat: written stacktools --- src/main/java/ftbsc/lll/tools/InsnSequence.java | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src/main/java/ftbsc/lll/tools/InsnSequence.java') diff --git a/src/main/java/ftbsc/lll/tools/InsnSequence.java b/src/main/java/ftbsc/lll/tools/InsnSequence.java index 4afd626..1e667f5 100644 --- a/src/main/java/ftbsc/lll/tools/InsnSequence.java +++ b/src/main/java/ftbsc/lll/tools/InsnSequence.java @@ -8,7 +8,7 @@ import java.util.Objects; /** * Represents a sequence of instructions contained within two given nodes. - * Extends InsnList, but provides additional flexibility. + * Extends InsnList, but provides additional flexibility and features. */ public class InsnSequence extends InsnList { /** @@ -55,6 +55,16 @@ public class InsnSequence extends InsnList { */ public void add(AbstractInsnNode... nodes) { for(AbstractInsnNode node : nodes) + this.add(node); + } + + /** + * Wraps InsnList's add() to ignore null values. + * @param node to add + */ + @Override + public void add(AbstractInsnNode node) { + if(node != null) super.add(node); } -- cgit v1.2.3-56-ga3b1