]> source.dussan.org Git - aspectj.git/commitdiff
test for Bugzilla Bug 39479
authorjhugunin <jhugunin>
Thu, 3 Jul 2003 00:06:53 +0000 (00:06 +0000)
committerjhugunin <jhugunin>
Thu, 3 Jul 2003 00:06:53 +0000 (00:06 +0000)
   NPE in bcel.LazyMethodGen when delegating from one ctor to a second that includes a switch.

tests/ajcTestsFailing.xml
tests/bugs/NewSwitch.java [new file with mode: 0644]
tests/jimTests.xml

index 4292bacbde668edfac1b68eac739aef9a3753a53..25314b7775c1c0f86c6844d971a23bd1ec0585c2 100644 (file)
@@ -9,5 +9,11 @@
         <compile files="lib.jar,TestAspect.aj,Test.java"/>
         <run class="Test"/>
     </ajc-test>
+    
+    <ajc-test dir="bugs" pr="39479"
+        title="NPE in bcel.LazyMethodGen when delegating from one ctor to a second that includes a switch">
+        <compile files="NewSwitch.java"/>
+        <run class="NewSwitch"/>
+    </ajc-test>
 
 </suite>
diff --git a/tests/bugs/NewSwitch.java b/tests/bugs/NewSwitch.java
new file mode 100644 (file)
index 0000000..f07efba
--- /dev/null
@@ -0,0 +1,31 @@
+import org.aspectj.lang.JoinPoint;
+import org.aspectj.lang.Signature;
+import org.aspectj.lang.reflect.SourceLocation;
+
+public class NewSwitch {
+  public static void main(String[] args) {
+       new NewSwitch(2);
+  }
+
+  protected NewSwitch() {
+       this(3);
+  }
+
+  protected NewSwitch(int p) {
+       switch (p) {
+         case 3: break;
+       }
+  }
+}
+
+aspect FFDC {
+
+       pointcut initializers( ) : staticinitialization( * ) || initialization( *.new(..) );
+       pointcut methodsAndConstructors( ) : execution(* *(..)) || execution(new(..) );
+       pointcut guarded( ) :  initializers( ) || methodsAndConstructors( );    
+
+       final pointcut nonStaticContext( Object o ) : this( o );
+
+       after(Object o) throwing(Throwable t) : guarded( ) && nonStaticContext( o ) { }
+
+}
index 353042abe63176a53be2c53dad8969b46603d2f7..c10a38f4a118d549db9684cff5aedf9429fd36d3 100644 (file)
@@ -1,9 +1,9 @@
 <!DOCTYPE suite SYSTEM "../tests/ajcTestSuite.dtd">
 <suite> 
-    <ajc-test dir="bugs" pr="38345" keywords="purejava"
-        title="try switch VerifyError, InconsistentStackHeight">
-        <compile files="TrySwitch.java"/>
-        <run class="TrySwitch"/>
+    <ajc-test dir="bugs" pr="39479"
+        title="NPE in bcel.LazyMethodGen when delegating from one ctor to a second that includes a switch">
+        <compile files="NewSwitch.java"/>
+        <run class="NewSwitch"/>
     </ajc-test>
 
 </suite>
\ No newline at end of file