mirror of
https://github.com/zaaarf/lillero.git
synced 2024-11-24 08:24:49 +01:00
fix: improved InsnSequence
This commit is contained in:
parent
c9ea715ba1
commit
faa59bd7de
1 changed files with 6 additions and 5 deletions
|
@ -26,7 +26,7 @@ public class InsnSequence extends InsnList {
|
||||||
*/
|
*/
|
||||||
public InsnSequence(AbstractInsnNode node) {
|
public InsnSequence(AbstractInsnNode node) {
|
||||||
super();
|
super();
|
||||||
super.add(node);
|
this.add(node);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -39,7 +39,7 @@ public class InsnSequence extends InsnList {
|
||||||
Objects.requireNonNull(startNode);
|
Objects.requireNonNull(startNode);
|
||||||
Objects.requireNonNull(endNode);
|
Objects.requireNonNull(endNode);
|
||||||
for(; startNode != endNode && startNode != null; startNode = startNode.getNext())
|
for(; startNode != endNode && startNode != null; startNode = startNode.getNext())
|
||||||
super.add(startNode);
|
this.add(startNode);
|
||||||
if (startNode == null)
|
if (startNode == null)
|
||||||
throw new InstructionMismatchException("Nodes" + getFirst() + " and " + getLast() + " are not connected.");
|
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
|
* @param node to add
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void add(AbstractInsnNode node) {
|
public void add(AbstractInsnNode node) {
|
||||||
if(node != null)
|
Objects.requireNonNull(node);
|
||||||
super.add(node);
|
super.add(node);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue