]> source.dussan.org Git - aspectj.git/commitdiff
#114875 cannot reproduce NPE in @AJ abstract aspect
authoravasseur <avasseur>
Mon, 7 Nov 2005 10:50:55 +0000 (10:50 +0000)
committeravasseur <avasseur>
Mon, 7 Nov 2005 10:50:55 +0000 (10:50 +0000)
tests/java5/ataspectj/ataspectj/bugs/AbstractAspectNPEChild.java [new file with mode: 0644]
tests/java5/ataspectj/ataspectj/bugs/AbstractAspectNPEParent.java [new file with mode: 0644]
tests/src/org/aspectj/systemtest/ajc150/ataspectj/AtAjSyntaxTests.java
tests/src/org/aspectj/systemtest/ajc150/ataspectj/syntax.xml

diff --git a/tests/java5/ataspectj/ataspectj/bugs/AbstractAspectNPEChild.java b/tests/java5/ataspectj/ataspectj/bugs/AbstractAspectNPEChild.java
new file mode 100644 (file)
index 0000000..0adbf41
--- /dev/null
@@ -0,0 +1,31 @@
+/*******************************************************************************
+ * Copyright (c) 2005 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://eclipse.org/legal/epl-v10.html 
+ * 
+ * Contributors:
+ *   Alexandre Vasseur         initial implementation
+ *******************************************************************************/
+package ataspectj.bugs;
+
+import org.aspectj.lang.annotation.Aspect;
+import org.aspectj.lang.annotation.Pointcut;
+import org.aspectj.lang.annotation.Before;
+
+/**
+ * @author <a href="mailto:alex AT gnilux DOT com">Alexandre Vasseur</a>
+ */
+@Aspect
+public class AbstractAspectNPEChild extends AbstractAspectNPEParent {
+
+    @Pointcut("execution(* ataspectj.bugs.AbstractAspectNPEParent.main(..))")
+    void method(){};
+
+    @Before("method()")
+    public void test(){
+
+    }
+}
diff --git a/tests/java5/ataspectj/ataspectj/bugs/AbstractAspectNPEParent.java b/tests/java5/ataspectj/ataspectj/bugs/AbstractAspectNPEParent.java
new file mode 100644 (file)
index 0000000..8cba4b3
--- /dev/null
@@ -0,0 +1,28 @@
+/*******************************************************************************
+ * Copyright (c) 2005 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://eclipse.org/legal/epl-v10.html 
+ * 
+ * Contributors:
+ *   Alexandre Vasseur         initial implementation
+ *******************************************************************************/
+package ataspectj.bugs;
+
+import org.aspectj.lang.annotation.Pointcut;
+import org.aspectj.lang.annotation.Aspect;
+
+/**
+ * @author <a href="mailto:alex AT gnilux DOT com">Alexandre Vasseur</a>
+ */
+@Aspect
+public abstract class AbstractAspectNPEParent {
+
+    @Pointcut
+    abstract void method();//NPE at AJC time
+
+    public static void main(String args[]){
+    }
+}
index 5e802c4a7ca82865d57190fc97a0eed1edffedf8..c462cdea8f3746a040e4758f0fa5c381bb1bafd3 100644 (file)
@@ -128,4 +128,9 @@ public class AtAjSyntaxTests extends XMLBasedAjcTestCase {
     public void testDeclareParentsImplements() {
         runTest("DeclareParentsImplements");
     }
-}
\ No newline at end of file
+
+    public void testAbstractAspectNPE() {
+        runTest("AbstractAspectNPE");
+    }
+
+}
index cf6c106b0323f5740a7df68015396513b581f3e1..015d8c1dc9ba02773f277ff20b11a2b3133e5eae 100644 (file)
         <run class="ataspectj.DeclareParentsImplementsTest"/>
     </ajc-test>
 
+    <ajc-test dir="java5/ataspectj" title="AbstractAspectNPE">
+        <compile files="ataspectj/bugs/AbstractAspectNPEParent.java,ataspectj/bugs/AbstractAspectNPEChild.java"
+            options="-1.5 -showWeaveInfo">
+            <message kind="weave" text="Join point 'method-execution(void ataspectj.bugs.AbstractAspectNPEParent.main"/>            
+        </compile>
+    </ajc-test>
+
 </suite>
\ No newline at end of file