]> source.dussan.org Git - aspectj.git/commitdiff
353936
authoraclement <aclement>
Fri, 5 Aug 2011 16:06:26 +0000 (16:06 +0000)
committeraclement <aclement>
Fri, 5 Aug 2011 16:06:26 +0000 (16:06 +0000)
tests/src/org/aspectj/systemtest/ajc1612/Ajc1612Tests.java
tests/src/org/aspectj/systemtest/ajc1612/ajc1612.xml

index 223c2f2c0de9fe02899ca2ef83940c195d260b3b..c0907c43b74d7b977ec8ff888c3ceefadbb87b8c 100644 (file)
@@ -14,6 +14,8 @@ import java.io.File;
 
 import junit.framework.Test;
 
+import org.aspectj.apache.bcel.classfile.JavaClass;
+import org.aspectj.apache.bcel.classfile.Method;
 import org.aspectj.testing.XMLBasedAjcTestCase;
 
 /**
@@ -25,6 +27,27 @@ public class Ajc1612Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
        // runTest("anno copying");
        // }
 
+       public void testRangeForLocalVariables_353936() throws ClassNotFoundException {
+               runTest("local variable tables");
+               JavaClass jc = getClassFrom(ajc.getSandboxDirectory(), "X");
+               Method[] meths = jc.getMethods();
+               boolean checked = false;
+               for (int i = 0; i < meths.length; i++) {
+                       Method method = meths[i];
+                       if (method.getName().equals("ajc$before$X$2$3444dde4")) {
+                               System.out.println(method.getName());
+                               System.out.println(stringify(method.getLocalVariableTable()));
+                               System.out.println(method.getCode().getLength());
+                               checked = true;
+                               assertEquals("LX; this(0) start=0 len=48", stringify(method.getLocalVariableTable(), 0));
+                               assertEquals("Lorg/aspectj/lang/JoinPoint; thisJoinPoint(1) start=0 len=48",
+                                               stringify(method.getLocalVariableTable(), 1));
+                               assertEquals("I i(2) start=8 len=22", stringify(method.getLocalVariableTable(), 2));
+                       }
+               }
+               assertTrue(checked);
+       }
+
        public void testEmptyPattern_pr352363() {
                runTest("empty pattern");
        }
index 87412fe0690bed68af64a0f361bdb183f6cd4f90..c06b0218ad99688f507d374eaa9104868ed86d98 100644 (file)
@@ -2,6 +2,10 @@
 
 <suite>
 
+<ajc-test dir="bugs1612/pr353936" title="local variable tables">
+<compile files="Code.java" options="-1.5"/>
+</ajc-test>
+
 <ajc-test dir="bugs1612/pr352363" title="empty pattern">
 <compile files="Code.java" options="-1.5">
   <message line="12" kind="warning" text="name is empty1"/>