Browse Source

268710: test and fix: marker interface within generic aspect

tags/pre268419
aclement 15 years ago
parent
commit
1c9611faa2

+ 26
- 0
tests/bugs164/pr268710/ConcreteAspect.aj View File

/**
*
*/
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 View File

/**
*
*/
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 View File

runTest("generics aspects npe"); runTest("generics aspects npe");
} }


public void testGenericAspectsNpe_pr268710() {
runTest("generics aspects incorrect error");
}

public void testGenericsItdNpe_pr267559() { public void testGenericsItdNpe_pr267559() {
runTest("generics and itd npe"); runTest("generics and itd npe");
} }

+ 11
- 3
tests/src/org/aspectj/systemtest/ajc164/ajc164.xml View File



<suite> <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"> <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>
<ajc-test dir="bugs164/pr267559" title="generics and itd npe"> <ajc-test dir="bugs164/pr267559" title="generics and itd npe">

Loading…
Cancel
Save