]> source.dussan.org Git - aspectj.git/commitdiff
fixes for 145442: better line numbers for woven code
authoraclement <aclement>
Tue, 3 Oct 2006 10:32:55 +0000 (10:32 +0000)
committeraclement <aclement>
Tue, 3 Oct 2006 10:32:55 +0000 (10:32 +0000)
tests/src/org/aspectj/systemtest/ajc153/Ajc153Tests.java
tests/src/org/aspectj/systemtest/ajc153/ajc153.xml
weaver/src/org/aspectj/weaver/bcel/BcelShadow.java
weaver/testdata/AroundAllFancyHelloWorld.txt
weaver/testdata/AroundAllHelloWorld.txt
weaver/testdata/TjpAround2HelloWorld.txt
weaver/testdata/TjpAroundHelloWorld.txt
weaver/testdata/TraceJarHello.txt

index 50998bf7fcace76aaa5011a1a5999df79879674d..e32630e4c1df5a88e5260e703b35dffde0e85fd3 100644 (file)
@@ -24,13 +24,13 @@ import org.aspectj.weaver.bcel.Utility;
 public class Ajc153Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
 
   //public void testGenericsProblem_pr151978() { runTest("generics problem");}
-//  public void testMissingLineNumbersInStacktraceAfter_pr145442() { runTest("missing line numbers in stacktrace after");}
-//  public void testMissingLineNumbersInStacktraceAround_pr145442() { runTest("missing line numbers in stacktrace around");}
   // public void testArgnamesAndJavac_pr148381() { runTest("argNames and javac");}
   // public void testCFlowXMLAspectLTW_pr149096() { runTest("cflow xml concrete aspect"); }
   // public void testAmbiguousBinding_pr121805() { runTest("ambiguous binding");}
 //  public void testNoIllegalStateExceptionWithGenericInnerAspect_pr156058() { runTest("no IllegalStateException with generic inner aspect"); }
 //  public void testNegatedAnnotationMatchingProblem_pr153464() { runTest("negated annotation matching problem");}
+  public void testMissingLineNumbersInStacktraceAfter_pr145442() { runTest("missing line numbers in stacktrace after");}
+  public void testMissingLineNumbersInStacktraceAround_pr145442() { runTest("missing line numbers in stacktrace around");}
   public void testGenericArrays_pr158624() { runTest("generics and arrays"); }
   public void testMissingLineNumbersInStacktraceBefore_pr145442() { runTest("missing line numbers in stacktrace before");}
   public void testMissingLineNumbersInStacktraceBefore_pr145442_Binary() { runTest("missing line numbers in stacktrace before - binary");}
index 710a1480987dd3620c347970d821df830dc0ad3d..9ebb3fca3bd1fa8f457f1b586e6ac586c12929d4 100644 (file)
      <compile files="hello/HelloWorld.java hello/ThrowExceptionAfter.aj"/>
      <run class="hello.HelloWorld">
                <stderr>
-               <line text="hello.HelloWorld.println(HelloWorld.java:14)"/>
+               <line text="hello.HelloWorld.println(HelloWorld.java:15)"/>
                <line text="hello.HelloWorld.testStackTrace(HelloWorld.java:19)"/>
                <line text="hello.HelloWorld.main(HelloWorld.java:41)"/>
                </stderr>
      <compile files="hello/HelloWorld.java hello/ThrowExceptionAround.aj" options="-XnoInline"/>
      <run class="hello.HelloWorld">
                <stderr>
-               <line text="hello.HelloWorld.println(HelloWorld.java:14)"/>
+               <line text="hello.HelloWorld.println(HelloWorld.java:13)"/>
                <line text="hello.HelloWorld.testStackTrace(HelloWorld.java:19)"/>
                <line text="hello.HelloWorld.main(HelloWorld.java:41)"/>
                </stderr>
index 50d8bb0455bbcf1bd0e503fc4a6b358cee50ce39..cb47bb9a0f587102205aede70252d4d7bee66e81 100644 (file)
@@ -3058,7 +3058,7 @@ public class BcelShadow extends Shadow {
         // invoke the advice
         advice.append(munger.getNonTestAdviceInstructions(this));
         advice.append(returnConversionCode);
-               if (getKind()==Shadow.MethodExecution) {
+               if (getKind()==Shadow.MethodExecution && linenumber>0) {
                        advice.getStart().addTargeter(new LineNumberTag(linenumber));
                }
         
index b7a8d862373ce3509a79c335e72893a5810a8f31..d1f593c67c4b891f0abdfddc3d770b23d7fbe187 100644 (file)
@@ -1,6 +1,6 @@
 public abstract class FancyHelloWorld extends java.lang.Object:
   public void <init>():
-                    ALOAD_0     // FancyHelloWorld this   (line 7)
+                    ALOAD_0     // LFancyHelloWorld; this   (line 7)
                     INVOKESPECIAL java.lang.Object.<init> ()V
     constructor-execution(void FancyHelloWorld.<init>())
     |               BIPUSH 1
@@ -24,7 +24,7 @@ public abstract class FancyHelloWorld extends java.lang.Object:
                     ALOAD_0
                     ASTORE 15
     method-execution(void FancyHelloWorld.main(java.lang.String[]))
-    |               BIPUSH 1
+    |               BIPUSH 1   (line 9)
     |               ANEWARRAY java.lang.Object
     |               ASTORE 16
     |               ALOAD 16
@@ -43,7 +43,7 @@ public abstract class FancyHelloWorld extends java.lang.Object:
 
   public static String getName():
     method-execution(java.lang.String FancyHelloWorld.getName())
-    |               BIPUSH 0
+    |               BIPUSH 0   (line 20)
     |               ANEWARRAY java.lang.Object
     |               ASTORE 10
     |               NEW FancyHelloWorld$AjcClosure21
@@ -101,7 +101,7 @@ public abstract class FancyHelloWorld extends java.lang.Object:
                     ASTORE_3   (line 9)
     finally -> E1
     | catch java.lang.Exception -> E0
-    | |             ALOAD_3     // java.io.PrintStream out   (line 11)
+    | |             ALOAD_3     // Ljava/io/PrintStream; out   (line 11)
     | |             LDC "bye"
     | |             ASTORE 5
     | |             ASTORE 7
@@ -127,8 +127,8 @@ public abstract class FancyHelloWorld extends java.lang.Object:
     | |             GOTO L0
     | catch java.lang.Exception -> E0
     |           E0: ASTORE 11   (line 12)
-    |               ALOAD_3     // java.io.PrintStream out   (line 13)
-    |               ALOAD 11     // java.lang.Exception e
+    |               ALOAD_3     // Ljava/io/PrintStream; out   (line 13)
+    |               ALOAD 11     // Ljava/lang/Exception; e
     |               ASTORE 13
     |               ASTORE 15
     | method-call(void java.io.PrintStream.println(java.lang.Object))
@@ -159,7 +159,7 @@ public abstract class FancyHelloWorld extends java.lang.Object:
                 L0: JSR L1
                     GOTO L2
                 L1: ASTORE 21
-                    ALOAD_3     // java.io.PrintStream out   (line 15)
+                    ALOAD_3     // Ljava/io/PrintStream; out   (line 15)
                     LDC "finally"
                     ASTORE 23
                     ASTORE 25
@@ -216,7 +216,7 @@ public abstract class FancyHelloWorld extends java.lang.Object:
   static final String getName_aroundBody20():
                     ICONST_0   (line 20)
                     ISTORE_0
-                    ILOAD_0     // int x   (line 21)
+                    ILOAD_0     // I x   (line 21)
                     LDC "name"
                     ASTORE_2
     method-call(int java.lang.String.hashCode())
@@ -235,7 +235,7 @@ public abstract class FancyHelloWorld extends java.lang.Object:
     |               INVOKESTATIC org.aspectj.runtime.internal.Conversions.intValue (Ljava/lang/Object;)I
     method-call(int java.lang.String.hashCode())
                     IADD
-                    ISTORE_0     // int x
+                    ISTORE_0     // I x
                     LDC "name"   (line 22)
                     ASTORE 6
     constructor-call(void java.lang.StringBuffer.<init>(java.lang.String))
@@ -253,7 +253,7 @@ public abstract class FancyHelloWorld extends java.lang.Object:
     |               INVOKESTATIC Aspect.ajc_around (Lorg/aspectj/runtime/internal/AroundClosure;)Ljava/lang/Object;
     |               CHECKCAST java.lang.StringBuffer
     constructor-call(void java.lang.StringBuffer.<init>(java.lang.String))
-                    ILOAD_0     // int x
+                    ILOAD_0     // I x
                     ISTORE 10
                     ASTORE 12
     method-call(java.lang.StringBuffer java.lang.StringBuffer.append(int))
index ea505e31650622b98ac47a49a908fded0cfef4c5..7adbca1f3a5a5753a93f40a6011bed31ee50f6be 100644 (file)
@@ -1,6 +1,6 @@
 public class HelloWorld extends java.lang.Object:
   public void <init>():
-                    ALOAD_0     // HelloWorld this   (line 5)
+                    ALOAD_0     // LHelloWorld; this   (line 5)
                     INVOKESPECIAL java.lang.Object.<init> ()V
     constructor-execution(void HelloWorld.<init>())
     |               BIPUSH 1
@@ -24,7 +24,7 @@ public class HelloWorld extends java.lang.Object:
                     ALOAD_0
                     ASTORE 5
     method-execution(void HelloWorld.main(java.lang.String[]))
-    |               BIPUSH 1
+    |               BIPUSH 1   (line 8)
     |               ANEWARRAY java.lang.Object
     |               ASTORE 6
     |               ALOAD 6
index a267a335178c0b3b4f99836852b67e552698e7c4..ab1a100f8efbfa9f0d5bc00440b27e1e1583304f 100644 (file)
@@ -44,7 +44,7 @@ public class HelloWorld extends java.lang.Object:
                     INVOKESTATIC org.aspectj.runtime.reflect.Factory.makeJP (Lorg/aspectj/lang/JoinPoint$StaticPart;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Lorg/aspectj/lang/JoinPoint;
                     ASTORE 10
     method-execution(void HelloWorld.main(java.lang.String[]))
-    |               BIPUSH 2
+    |               BIPUSH 2   (line 8)
     |               ANEWARRAY java.lang.Object
     |               ASTORE 12
     |               ALOAD 12
@@ -271,7 +271,7 @@ public class HelloWorld extends java.lang.Object:
   end static final void main_aroundBody12(String[], org.aspectj.lang.JoinPoint)
 
   static final void main_aroundBody14(String[], org.aspectj.lang.JoinPoint):
-                    BIPUSH 2
+                    BIPUSH 2   (line 8)
                     ANEWARRAY java.lang.Object
                     ASTORE_2
                     ALOAD_2
index 4c865494872045e5d76c3fd4b22d82fc5f41a059..92065df5006042dd95f3dec1aceb25d9921c55b1 100644 (file)
@@ -44,7 +44,7 @@ public class HelloWorld extends java.lang.Object:
                     INVOKESTATIC org.aspectj.runtime.reflect.Factory.makeJP (Lorg/aspectj/lang/JoinPoint$StaticPart;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Lorg/aspectj/lang/JoinPoint;
                     ASTORE 8
     method-execution(void HelloWorld.main(java.lang.String[]))
-    |               BIPUSH 2
+    |               BIPUSH 2   (line 8)
     |               ANEWARRAY java.lang.Object
     |               ASTORE 9
     |               ALOAD 9
index 7e313b9113499ed04b61cbad61d8ed91f0cc516d..8589536d66cfeae1b8ba4bb2f63273e7f113880b 100644 (file)
@@ -91,7 +91,7 @@ public class DynamicHelloWorld extends java.lang.Object implements java.io.Seria
   end static final String doit_aroundBody0(DynamicHelloWorld, String, java.util.List)
 
   static final String doit_aroundBody2(DynamicHelloWorld, String, java.util.List):
-                    INVOKESTATIC MyTrace.aspectOf ()LMyTrace;
+                    INVOKESTATIC MyTrace.aspectOf ()LMyTrace;   (line 21)
                     ALOAD_0
                     BIPUSH 3
                     ANEWARRAY java.lang.Object