Selaa lähdekoodia

268710: test and fix: marker interface within generic aspect

tags/pre268419
aclement 15 vuotta sitten
vanhempi
commit
1c9611faa2

+ 26
- 0
tests/bugs164/pr268710/ConcreteAspect.aj Näytä tiedosto

@@ -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");
}
}

+ 16
- 0
tests/bugs164/pr268710/GenericAspect.aj Näytä tiedosto

@@ -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);
}

+ 4
- 0
tests/src/org/aspectj/systemtest/ajc164/Ajc164Tests.java Näytä tiedosto

@@ -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");
}

+ 11
- 3
tests/src/org/aspectj/systemtest/ajc164/ajc164.xml Näytä tiedosto

@@ -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">

Loading…
Peruuta
Tallenna