Commit fea3c514 authored by Eric Bruneton's avatar Eric Bruneton

Merge branch 'rollback-ensure-instructions-belong-to-only-one-list' into 'master'

Revert the merge request 'Ensure instructions belong only to one list'.

See merge request !226
parents 4fef4700 66e76ca6
Pipeline #3198 passed with stage
in 9 minutes and 9 seconds
......@@ -230,7 +230,6 @@ public class InsnList {
lastInsn.nextInsn = insnNode;
insnNode.previousInsn = lastInsn;
}
insnNode.nextInsn = null;
lastInsn = insnNode;
cache = null;
insnNode.index = 0; // insnNode now belongs to an InsnList.
......
......@@ -54,8 +54,6 @@ public class InsnListTest {
private InsnList list2;
private InsnList list3Unchecked;
private InsnNode insn1;
private InsnNode insn2;
......@@ -64,7 +62,6 @@ public class InsnListTest {
public void setUp() throws Exception {
list1 = new CheckedInsnList();
list2 = new CheckedInsnList();
list3Unchecked = new InsnList();
insn1 = new InsnNode(0);
insn2 = new InsnNode(0);
list2.add(insn1);
......@@ -324,16 +321,6 @@ public class InsnListTest {
assertEquals(insn, list1.get(1));
}
@Test
public void testSetNodeAssociatedWithAnotherList() {
InsnNode insnNode = new InsnNode(0);
list3Unchecked.add(insnNode);
list3Unchecked.set(insnNode, insn1);
ListIterator<AbstractInsnNode> iterator = list3Unchecked.iterator();
iterator.next();
assertFalse(iterator.hasNext());
}
@Test
public void testInvalidAdd() {
assertThrows(IllegalArgumentException.class, () -> list1.add(insn1));
......@@ -366,14 +353,6 @@ public class InsnListTest {
assertTrue(list1.contains(insn));
}
@Test
public void testAddNodeAssociatedWithAnotherList() {
list3Unchecked.add(insn1);
ListIterator<AbstractInsnNode> iterator = list3Unchecked.iterator();
iterator.next();
assertFalse(iterator.hasNext());
}
@Test
public void testAddEmptyList() {
list1.add(new InsnList());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment