]> source.dussan.org Git - aspectj.git/commitdiff
335783
authoraclement <aclement>
Mon, 31 Jan 2011 20:34:12 +0000 (20:34 +0000)
committeraclement <aclement>
Mon, 31 Jan 2011 20:34:12 +0000 (20:34 +0000)
tests/bugs1611/pr335783/A.java [new file with mode: 0644]
tests/bugs1611/pr335783/X.aj [new file with mode: 0644]
tests/bugs1611/pr335783/aop.xml [new file with mode: 0644]
tests/src/org/aspectj/systemtest/ajc1611/Ajc1611Tests.java
tests/src/org/aspectj/systemtest/ajc1611/ajc1611.xml

diff --git a/tests/bugs1611/pr335783/A.java b/tests/bugs1611/pr335783/A.java
new file mode 100644 (file)
index 0000000..5b399ea
--- /dev/null
@@ -0,0 +1,38 @@
+
+       import java.util.Hashtable;
+
+       import javax.naming.Context;
+       import javax.naming.NamingException;
+       import javax.naming.directory.DirContext;
+       import javax.naming.directory.InitialDirContext;
+/*******************************************************************************
+ * Copyright (c) 2010 Contributors
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *    Andy Clement - Repro test case
+ *    Abraham Nevado 
+ *******************************************************************************/
+
+
+       public class A implements java.io.Serializable{
+                   
+                 public A()  
+                 {  
+                 }  
+                 public void doSomething() throws Exception  
+                 {  
+
+
+                }  
+                public static void main(String[] args) throws Exception {  
+                        A lc = new A();  
+                        lc.doSomething();  
+                 
+                  }  
+       }
+       
+
diff --git a/tests/bugs1611/pr335783/X.aj b/tests/bugs1611/pr335783/X.aj
new file mode 100644 (file)
index 0000000..c14cd2b
--- /dev/null
@@ -0,0 +1,23 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Contributors All rights reserved. This program and the
+ * accompanying materials are made available under the terms of the Eclipse
+ * Public License v1.0 which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors: Abraham Nevado
+ *******************************************************************************/
+
+aspect X {
+
+       public pointcut doSomething(Object o): 
+       execution(* *()) && target(o);
+
+       before(Object o) : doSomething(o) {
+               try {
+                       String signature = thisJoinPointStaticPart.getSignature().toString();
+                       System.out.println("OK");
+               } catch (NullPointerException npe) {
+                       System.out.println("KO");
+               }
+       }
+}
diff --git a/tests/bugs1611/pr335783/aop.xml b/tests/bugs1611/pr335783/aop.xml
new file mode 100644 (file)
index 0000000..d142731
--- /dev/null
@@ -0,0 +1,10 @@
+<aspectj>
+       <aspects>
+               <aspect name="X"/>
+       </aspects>
+
+       <weaver options="-XaddSerialVersionUID -Xset:targetRuntime1_6_10=true,fastWeaving=true,weaveJavaxPackages=true -XhasMember -XlazyTjp -Xreweavable">
+               <include within="*"/>
+       </weaver>
+       
+</aspectj>
\ No newline at end of file
index 7123f7a61d996b914d6b0701162921db040e80f2..3468d5e48590d8fdffbdd6e4385c1936bcfeac75 100644 (file)
@@ -21,6 +21,10 @@ import org.aspectj.testing.XMLBasedAjcTestCase;
  */
 public class Ajc1611Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
 
+       public void testNPEAddSerialVersionUID_bug335783() {
+               runTest("pr335783");
+       }
+
        public void testGenericsAndItds_333469() {
                runTest("pr333469");
        }
@@ -36,18 +40,18 @@ public class Ajc1611Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
        public void testDeclareField_328840() {
                runTest("pr328840");
        }
-       
-//     public void testAnnoStyleAdviceChain_333274() {
-//                     runTest("anno style advice chain");
-//     }
-//
-//     public void testAnnoStyleAdviceChain_333274_2() {
-//                     runTest("code style advice chain");
-//     }
-//     
-//     public void testAnnoStyleAdviceChain_333274_3() {
-//             runTest("code style advice chain - no inline");
-//     }
+
+       // public void testAnnoStyleAdviceChain_333274() {
+       // runTest("anno style advice chain");
+       // }
+       //
+       // public void testAnnoStyleAdviceChain_333274_2() {
+       // runTest("code style advice chain");
+       // }
+       //
+       // public void testAnnoStyleAdviceChain_333274_3() {
+       // runTest("code style advice chain - no inline");
+       // }
 
        // ---
 
index d77ddeeb49cc950df6c6311511f1e3a340c8907a..663ad68a08330638ecc035fde5033bd6997a6e1e 100644 (file)
@@ -1,6 +1,17 @@
 <!DOCTYPE suite SYSTEM "../tests/ajcTestSuite.dtd"[]>
 
 <suite>
+
+  <ajc-test dir="bugs1611/pr335783" title="pr335783">
+    <compile files="A.java" options="-1.5"/>
+    <compile files="X.aj" options="-1.5 -Xlint:ignore" />
+    <run class="A" ltw="aop.xml">
+    <stdout>
+           <line text="OK"/>
+    </stdout>
+    </run>
+  </ajc-test>
+  
   <ajc-test dir="bugs1611/pr333274" title="anno style advice chain">
   <compile files="ma/Annotation1.java  ma/aspect1/Aspect1.java  ma/aspect3/Aspect3.java ma/Main.java ma/Precedence.java" options="-1.5"/>
   <run class="ma.Main">