From b01f3073462d78af66f323afc7c1800771f755b5 Mon Sep 17 00:00:00 2001 From: aclement Date: Wed, 28 May 2008 23:54:36 +0000 Subject: [PATCH] 231396: Comment #4: Big Refactoring --- tests/profiling/shadows.xml | 5 ++--- tests/profiling/spring-1.2.6.xml | 4 ++-- tests/src/org/aspectj/systemtest/ajc154/Ajc154Tests.java | 9 ++++----- 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/tests/profiling/shadows.xml b/tests/profiling/shadows.xml index 71bd020fe..e7358d8aa 100644 --- a/tests/profiling/shadows.xml +++ b/tests/profiling/shadows.xml @@ -53,7 +53,7 @@ - + diff --git a/tests/profiling/spring-1.2.6.xml b/tests/profiling/spring-1.2.6.xml index 868ae4287..5b210ab17 100644 --- a/tests/profiling/spring-1.2.6.xml +++ b/tests/profiling/spring-1.2.6.xml @@ -47,7 +47,7 @@ - + \ No newline at end of file diff --git a/tests/src/org/aspectj/systemtest/ajc154/Ajc154Tests.java b/tests/src/org/aspectj/systemtest/ajc154/Ajc154Tests.java index 266114d59..7d94d7966 100644 --- a/tests/src/org/aspectj/systemtest/ajc154/Ajc154Tests.java +++ b/tests/src/org/aspectj/systemtest/ajc154/Ajc154Tests.java @@ -16,7 +16,6 @@ import org.aspectj.apache.bcel.classfile.ConstantPool; import org.aspectj.apache.bcel.classfile.JavaClass; import org.aspectj.apache.bcel.classfile.LineNumberTable; import org.aspectj.apache.bcel.classfile.Method; -import org.aspectj.apache.bcel.generic.ConstantPoolGen; import org.aspectj.apache.bcel.generic.MethodGen; import org.aspectj.apache.bcel.util.ClassPath; import org.aspectj.apache.bcel.util.SyntheticRepository; @@ -157,14 +156,14 @@ public class Ajc154Tests extends org.aspectj.testing.XMLBasedAjcTestCase { */ ConstantPool cp = oneWeWant.getConstantPool(); - ConstantPoolGen cpg = new ConstantPoolGen(cp); + // ConstantPool cpg = new ConstantPool(cp); // Damage the line number table, entry 2 (Line7:5) so it points to an invalid (not on an instruction boundary) position of 6 oneWeWant.getLineNumberTable().getLineNumberTable()[2].setStartPC(6); // Should be 'rounded down' when transforming it into a MethodGen, new position will be '5' // System.out.println("BEFORE\n"+oneWeWant.getLineNumberTable().toString()); - MethodGen toTransform = new MethodGen(oneWeWant,"A",cpg,false); + MethodGen toTransform = new MethodGen(oneWeWant,"A",cp,false); LineNumberTable lnt = toTransform.getMethod().getLineNumberTable(); assertTrue("Should have been 'rounded down' to position 5 but is "+lnt.getLineNumberTable()[2].getStartPC(), lnt.getLineNumberTable()[2].getStartPC()==5); // System.out.println("AFTER\n"+lnt.toString()); @@ -186,14 +185,14 @@ public class Ajc154Tests extends org.aspectj.testing.XMLBasedAjcTestCase { // see previous test for dump of main method ConstantPool cp = oneWeWant.getConstantPool(); - ConstantPoolGen cpg = new ConstantPoolGen(cp); +// ConstantPoolGen cpg = new ConstantPoolGen(cp); // Damage the local variable table, entry 2 (" 2 22 1 i I") so it points to an invalid start pc of 3 oneWeWant.getLocalVariableTable().getLocalVariable(1).setStartPC(3); // Should be 'rounded down' when transforming it into a MethodGen, new position will be '2' // This next line will go BANG with an NPE if we don't correctly round the start pc down to 2 - MethodGen toTransform = new MethodGen(oneWeWant,"A",cpg,true); + MethodGen toTransform = new MethodGen(oneWeWant,"A",cp,true); } -- 2.39.5