]> source.dussan.org Git - aspectj.git/commitdiff
268710: test and fix: marker interface within generic aspect
authoraclement <aclement>
Mon, 16 Mar 2009 18:40:12 +0000 (18:40 +0000)
committeraclement <aclement>
Mon, 16 Mar 2009 18:40:12 +0000 (18:40 +0000)
tests/bugs164/pr268710/ConcreteAspect.aj [new file with mode: 0644]
tests/bugs164/pr268710/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/pr268710/ConcreteAspect.aj b/tests/bugs164/pr268710/ConcreteAspect.aj
new file mode 100644 (file)
index 0000000..14abbfc
--- /dev/null
@@ -0,0 +1,26 @@
+/**
+ * 
+ */
+package none;
+
+/**
+ * @author Dawid Pytel
+ *
+ */
+public aspect ConcreteAspect extends GenericAspect<String> {
+
+  public static void main(String [] argv) {
+    new C();
+  }
+
+
+  before(SomeInterface v): SomeConstructor(v) {
+    System.out.println("Building an object "+v.getClass());
+  }
+}
+
+class C implements GenericAspect.SomeInterface {
+  public C() {
+    System.out.println("C.init");
+  }
+}
diff --git a/tests/bugs164/pr268710/GenericAspect.aj b/tests/bugs164/pr268710/GenericAspect.aj
new file mode 100644 (file)
index 0000000..b4df9fd
--- /dev/null
@@ -0,0 +1,16 @@
+/**
+ * 
+ */
+package none;
+
+/**
+ * @author Dawid Pytel
+ * 
+ */
+public abstract aspect GenericAspect<T> {
+
+       interface SomeInterface {
+       }
+
+       pointcut SomeConstructor(SomeInterface var) : execution(SomeInterface+.new(..)) && this(var);
+}
index 1afbf4b42d977e26669d216c4bc9c417da376f20..bc78b7108214d8b0f66993de8588496bf124e9b4 100644 (file)
@@ -38,6 +38,10 @@ public class Ajc164Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
                runTest("generics aspects npe");
        }
 
+       public void testGenericAspectsNpe_pr268710() {
+               runTest("generics aspects incorrect error");
+       }
+
        public void testGenericsItdNpe_pr267559() {
                runTest("generics and itd npe");
        }
index ae770bbae28e77205b9f0606a605214ecd9e7629..371b206c0b0ee39499177dd0571bac618aa62e38 100644 (file)
@@ -2,10 +2,18 @@
 
 <suite>
 
+   <ajc-test dir="bugs164/pr268710" title="generics aspects incorrect error">
+     <compile files="GenericAspect.aj ConcreteAspect.aj" options="-1.5"/>
+     <run class="none.ConcreteAspect">
+       <stdout>
+         <line text="Building an object class none.C"/>
+         <line text="C.init"/>
+       </stdout>
+     </run>
+   </ajc-test>
+
    <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>
+     <compile files="GenericAspect.aj ConcreteAspect.aj" options="-1.5"/>
    </ajc-test>
    
    <ajc-test dir="bugs164/pr267559" title="generics and itd npe">