]> source.dussan.org Git - aspectj.git/commitdiff
268689: test and fix for npe in generic aspect
authoraclement <aclement>
Mon, 16 Mar 2009 04:53:47 +0000 (04:53 +0000)
committeraclement <aclement>
Mon, 16 Mar 2009 04:53:47 +0000 (04:53 +0000)
tests/bugs164/pr268689/ConcreteAspect.aj [new file with mode: 0644]
tests/bugs164/pr268689/GenericAspect.aj [new file with mode: 0644]
tests/src/org/aspectj/systemtest/ajc164/Ajc164Tests.java
tests/src/org/aspectj/systemtest/ajc164/ajc164.xml

diff --git a/tests/bugs164/pr268689/ConcreteAspect.aj b/tests/bugs164/pr268689/ConcreteAspect.aj
new file mode 100644 (file)
index 0000000..10da726
--- /dev/null
@@ -0,0 +1,12 @@
+/**
+ * 
+ */
+package none;
+
+/**
+ * @author Dawid Pytel
+ *
+ */
+public aspect ConcreteAspect extends GenericAspect<String> {
+
+}
diff --git a/tests/bugs164/pr268689/GenericAspect.aj b/tests/bugs164/pr268689/GenericAspect.aj
new file mode 100644 (file)
index 0000000..c102dc3
--- /dev/null
@@ -0,0 +1,16 @@
+/**
+ * 
+ */
+package none;
+
+/**
+ * @author Dawid Pytel
+ * 
+ */
+public abstract aspect GenericAspect<T> {
+
+       interface SomeInterface {
+       }
+
+       pointcut SomeConstructor(SomeInterface var) : execution(* SomeInterface(..)) && this(var);
+}
index 14356587c62d5a8ad772c3aec1209953ac5a4c7c..1afbf4b42d977e26669d216c4bc9c417da376f20 100644 (file)
@@ -34,6 +34,10 @@ import org.aspectj.testing.XMLBasedAjcTestCase;
 
 public class Ajc164Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
 
+       public void testGenericAspectsNpe_pr268689() {
+               runTest("generics aspects npe");
+       }
+
        public void testGenericsItdNpe_pr267559() {
                runTest("generics and itd npe");
        }
index 373d4b71174f93762109676a4aa22e09b299eb35..ae770bbae28e77205b9f0606a605214ecd9e7629 100644 (file)
@@ -1,6 +1,12 @@
 <!DOCTYPE suite SYSTEM "../tests/ajcTestSuite.dtd"[]>
 
 <suite>
+
+   <ajc-test dir="bugs164/pr268689" title="generics aspects npe">
+     <compile files="GenericAspect.aj ConcreteAspect.aj" options="-1.5">
+       <message kind="error" line="15" text="parameterized types not supported for this and target pointcuts (erasure limitation)"/>
+     </compile>
+   </ajc-test>
    
    <ajc-test dir="bugs164/pr267559" title="generics and itd npe">
      <compile files="IMarker.java ClassB.java Aspect.java ClassA.java" options="-1.5"/>