diff options
author | zaaarf <zaaarf@proton.me> | 2023-03-04 12:01:39 +0100 |
---|---|---|
committer | zaaarf <zaaarf@proton.me> | 2023-03-04 12:01:39 +0100 |
commit | faa59bd7de3537009f6759b3081066691366d612 (patch) | |
tree | d679fe7d83bd6df1982bdc583d9f5d9fafd19b1c /src/main/java/ftbsc/lll/tools | |
parent | c9ea715ba1caf0efb8b6ae0f805e0cff391e9b03 (diff) |
fix: improved InsnSequence
Diffstat (limited to 'src/main/java/ftbsc/lll/tools')
-rw-r--r-- | src/main/java/ftbsc/lll/tools/InsnSequence.java | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/main/java/ftbsc/lll/tools/InsnSequence.java b/src/main/java/ftbsc/lll/tools/InsnSequence.java index 2038155..5932fcd 100644 --- a/src/main/java/ftbsc/lll/tools/InsnSequence.java +++ b/src/main/java/ftbsc/lll/tools/InsnSequence.java @@ -26,7 +26,7 @@ public class InsnSequence extends InsnList { */ public InsnSequence(AbstractInsnNode node) { super(); - super.add(node); + this.add(node); } /** @@ -39,7 +39,7 @@ public class InsnSequence extends InsnList { Objects.requireNonNull(startNode); Objects.requireNonNull(endNode); for(; startNode != endNode && startNode != null; startNode = startNode.getNext()) - super.add(startNode); + this.add(startNode); if (startNode == null) throw new InstructionMismatchException("Nodes" + getFirst() + " and " + getLast() + " are not connected."); } @@ -69,13 +69,14 @@ public class InsnSequence extends InsnList { } /** - * Wraps InsnList's add() to ignore null values. + * Wraps InsnList's add() to throw an exception + * when fed null values. * @param node to add */ @Override public void add(AbstractInsnNode node) { - if(node != null) - super.add(node); + Objects.requireNonNull(node); + super.add(node); } /** |