]> source.dussan.org Git - aspectj.git/commitdiff
Test for Bugzilla Bug 59397
authoraclement <aclement>
Mon, 26 Apr 2004 09:48:34 +0000 (09:48 +0000)
committeraclement <aclement>
Mon, 26 Apr 2004 09:48:34 +0000 (09:48 +0000)
   NPE in compiler when using (an unusual) declare warning against a ctor ITD

tests/ajcTests.xml
tests/bugs/DecwInitializationITD.java [new file with mode: 0644]

index 8588b59f327cba3bd43172451573f8885ac2e2dd..efffb7547269a4c8b4af9403ade1d33304441045 100644 (file)
         </compile>
     </ajc-test>
        
+       <ajc-test dir="bugs"
+       pr="59397"
+               title="NPE in compiler when using (an unusual) declare warning against a ctor ITD">
+        <compile files="DecwInitializationITD.java">
+               <message kind="warning" line="16"/>
+        </compile>
+    </ajc-test>
+       
 </suite>
diff --git a/tests/bugs/DecwInitializationITD.java b/tests/bugs/DecwInitializationITD.java
new file mode 100644 (file)
index 0000000..26bab8b
--- /dev/null
@@ -0,0 +1,16 @@
+
+// The actual ctor that gets put in type 'HW' during compilation is
+// HW(String,A)
+// This is an artifact of the implementation of ctor ITDing - unfortunately this artifact
+// can be seen by the declare warning.  So,
+//  initialization(HW.new(..))  will match our new ctor
+//  initialization(HW.new(String,A)) will match our new ctor
+//  initialization(HW.new(String)) will not match !
+
+aspect A {  
+       HW.new(String s) {}  
+       declare warning : initialization(HW.new(String,A)) : "Funky ctor found!";
+}
+
+
+class HW {}