@@ -0,0 +1,4 @@ | |||
@Configurable | |||
public class Annotated { | |||
} |
@@ -0,0 +1,8 @@ | |||
public aspect AnnotationMatcher { | |||
after() returning : initialization(*.new(..)) && @this(Configurable) { | |||
System.out.println("annotated type initialized"); | |||
} | |||
} |
@@ -0,0 +1,6 @@ | |||
import java.lang.annotation.*; | |||
@Retention(RetentionPolicy.RUNTIME) | |||
public @interface Configurable { | |||
} |
@@ -0,0 +1,7 @@ | |||
public class Main { | |||
public static void main(String[] args) { | |||
new Annotated(); | |||
} | |||
} |
@@ -62,7 +62,8 @@ public class Ajc153Tests extends org.aspectj.testing.XMLBasedAjcTestCase { | |||
} | |||
public void testMatchVolatileField_pr150671() {runTest("match volatile field");}; | |||
public void testDuplicateJVMTIAgents_pr151938() {runTest("Duplicate JVMTI agents");}; | |||
public void testLTWWorldWithAnnotationMatching_pr153572() { runTest("LTWWorld with annotation matching");} | |||
///////////////////////////////////////// | |||
public static Test suite() { | |||
return XMLBasedAjcTestCase.loadSuite(Ajc153Tests.class); |
@@ -291,4 +291,18 @@ | |||
<compile files="EMA.java" options="-1.5"/> | |||
</ajc-test> | |||
<ajc-test dir="bugs153/pr153572" title="LTWWorld with annotation matching"> | |||
<compile | |||
files="Configurable.java, AnnotationMatcher.aj" | |||
options="-1.5" | |||
outjar="aspectlib.jar" | |||
outxmlfile="META-INF/aop.xml"/> | |||
<compile files="Configurable.java,Annotated.java,Main.java" options="-1.5" outjar="myapp.jar"/> | |||
<run class="Main" ltw=""> | |||
<stdout> | |||
<line text="annotated type initialized"/> | |||
</stdout> | |||
</run> | |||
</ajc-test> | |||
</suite> |