--- /dev/null
+public aspect Pr73050 {
+
+ pointcut anonymousTypeMatchedByNamePattern() :
+ staticinitialization(Pr73050.*1*);
+
+ pointcut anonymousTypeMatchedByWildCard() :
+ staticinitialization(Pr73050.*);
+
+ declare warning : anonymousTypeMatchedByNamePattern() :
+ "anonymous types shouldn't be matched by name patterns";
+
+ declare warning : anonymousTypeMatchedByWildCard() :
+ "anonymous types should be matched by a * wild card";
+
+ public void foo() {
+ (new Runnable() {
+ public void run() {}
+ }).run();
+ }
+}
\ No newline at end of file
runTest("java 5 pointcuts and declares at pre-java 5 compliance levels");
}
+ public void testAnonymousTypes() {
+ runTest("Anonymous types and nome matching");
+ }
+
// helper methods.....
public SyntheticRepository createRepos(File cpentry) {
</compile>
</ajc-test>
+ <ajc-test dir="bugs150" title="Anonymous types and nome matching">
+ <compile files="Pr73050.aj" outjar="jar1.jar">
+ <message kind="warning" line="16" text="anonymous types should be matched by a * wild card"/>
+ </compile>
+ <compile inpath="jar1.jar">
+ <message kind="warning" line="0" text="anonymous types should be matched by a * wild card"/>
+ </compile>
+ </ajc-test>
+
<ajc-test dir="bugs150/pr86903" title="bcelrenderer bad">
<compile files="GenericService.java,Service.java,Main.java,BadWormhole.java"/>
<run class="Main"/>