@@ -3,22 +3,21 @@ import java.lang.annotation.*; | |||
@Retention(RetentionPolicy.RUNTIME) | |||
@interface Anno { | |||
Class value(); | |||
//int i(); | |||
} | |||
public class C { | |||
@Anno(String.class) | |||
//@Anno(i=3) | |||
public int i; | |||
@Anno(Integer.class) | |||
public int j; | |||
public static void main(String []argv) { | |||
System.out.println(new C().i); | |||
System.out.println(new C().j); | |||
} | |||
} | |||
aspect X { | |||
//before(): get(@Anno(String.class) * *(..)) {} | |||
before(): get(@Anno(value=String.class) * *) {} | |||
//before(): get(@Anno(i=3) * *) {} | |||
} |
@@ -5,16 +5,23 @@ import java.lang.annotation.*; | |||
int i(); | |||
} | |||
public class C { | |||
public class D { | |||
@Anno(i=3) | |||
public int i; | |||
@Anno(i=4) | |||
public int j; | |||
@Anno(i=5) | |||
public int k; | |||
public static void main(String []argv) { | |||
System.out.println(new C().i); | |||
System.out.println(new D().i); | |||
System.out.println(new D().j); | |||
System.out.println(new D().k); | |||
} | |||
} | |||
aspect X { | |||
before(): get(@Anno(i!=3) * *) {} | |||
before(): get(@Anno(i!=5) * *) {} | |||
} |
@@ -0,0 +1,23 @@ | |||
import java.lang.annotation.*; | |||
@Retention(RetentionPolicy.RUNTIME) | |||
@interface Anno { | |||
Class value() default String.class; | |||
} | |||
public class E { | |||
@Anno | |||
public int i; | |||
@Anno(Integer.class) | |||
public int j; | |||
public static void main(String []argv) { | |||
System.out.println(new E().i); | |||
System.out.println(new E().j); | |||
} | |||
} | |||
aspect X { | |||
before(): get(@Anno(value=String.class) * *) {} | |||
} |
@@ -0,0 +1,27 @@ | |||
import java.lang.annotation.*; | |||
@Retention(RetentionPolicy.RUNTIME) | |||
@interface Anno { | |||
Class i() default Number.class; | |||
} | |||
public class F { | |||
@Anno(i=Integer.class) | |||
public int i; | |||
@Anno | |||
public int j; | |||
@Anno(i=String.class) | |||
public int k; | |||
public static void main(String []argv) { | |||
System.out.println(new F().i); | |||
System.out.println(new F().j); | |||
System.out.println(new F().k); | |||
} | |||
} | |||
aspect X { | |||
before(): get(@Anno(i!=String.class) * *) {} | |||
} |
@@ -0,0 +1,23 @@ | |||
import java.lang.annotation.*; | |||
@Retention(RetentionPolicy.RUNTIME) | |||
@interface Anno { | |||
Class value(); | |||
} | |||
public class G { | |||
@Anno(String.class) | |||
public int i; | |||
@Anno(Integer.class) | |||
public int j; | |||
public static void main(String []argv) { | |||
System.out.println(new G().i); | |||
System.out.println(new G().j); | |||
} | |||
} | |||
aspect X { | |||
before(): get(@Anno(value=Foo.class) * *) {} | |||
} |
@@ -35,12 +35,24 @@ public class Ajc1612Tests extends org.aspectj.testing.XMLBasedAjcTestCase { | |||
// runTest("itd split compilation"); | |||
// } | |||
public void testClassRef() throws Exception { | |||
public void testNotEqualWithAnnotationValues_357013() throws Exception { | |||
runTest("annotation values not equal"); | |||
} | |||
public void testNotEqualWithAnnotationValues_357013_2() throws Exception { | |||
runTest("annotation values not equal 2"); | |||
} | |||
public void testClassRef_357012() throws Exception { | |||
runTest("class reference in annotation value"); | |||
} | |||
public void testClassRef2() throws Exception { | |||
runTest("class reference in annotation value 2"); | |||
public void testClassRefInvalidName_357012_2() throws Exception { | |||
runTest("class reference in annotation value - invalid typename"); | |||
} | |||
public void testClassRef_357012_3() throws Exception { | |||
runTest("class reference in annotation value 3"); | |||
} | |||
public void testAnnotationFieldBindingOptimization_356612() throws Exception { |
@@ -3,17 +3,46 @@ | |||
<suite> | |||
<ajc-test dir="bugs1612/prx" title="class reference in annotation value"> | |||
<compile files="C.java" options="-1.5"/> | |||
<compile files="C.java" options="-1.5 -showWeaveInfo"> | |||
<message kind="weave" text="Join point 'field-get(int C.i)' in Type 'C' (C.java:17) advised by before advice from 'X' (C.java:22)"/> | |||
</compile> | |||
<run class="C"> | |||
</run> | |||
</ajc-test> | |||
<ajc-test dir="bugs1612/prx" title="class reference in annotation value 2"> | |||
<compile files="D.java" options="-1.5"/> | |||
<ajc-test dir="bugs1612/prx" title="annotation values not equal"> | |||
<compile files="D.java" options="-1.5 -showWeaveInfo"> | |||
<message kind="weave" text="Join point 'field-get(int D.i)' in Type 'D' (D.java:20) advised by before advice from 'X' (D.java:26)"/> | |||
<message kind="weave" text="Join point 'field-get(int D.j)' in Type 'D' (D.java:21) advised by before advice from 'X' (D.java:26)"/> | |||
</compile> | |||
<run class="D"> | |||
</run> | |||
</ajc-test> | |||
<ajc-test dir="bugs1612/prx" title="class reference in annotation value 3"> | |||
<compile files="E.java" options="-1.5 -showWeaveInfo"> | |||
<message kind="weave" text="Join point 'field-get(int E.i)' in Type 'E' (E.java:17) advised by before advice from 'X' (E.java:22)"/> | |||
</compile> | |||
<run class="E"> | |||
</run> | |||
</ajc-test> | |||
<ajc-test dir="bugs1612/prx" title="annotation values not equal 2"> | |||
<compile files="F.java" options="-1.5 -showWeaveInfo"> | |||
<message kind="weave" text="Join point 'field-get(int F.i)' in Type 'F' (F.java:20) advised by before advice from 'X' (F.java:26)"/> | |||
<message kind="weave" text="Join point 'field-get(int F.j)' in Type 'F' (F.java:21) advised by before advice from 'X' (F.java:26)"/> | |||
</compile> | |||
<run class="F"> | |||
</run> | |||
</ajc-test> | |||
<ajc-test dir="bugs1612/prx" title="class reference in annotation value - invalid typename"> | |||
<compile files="G.java" options="-1.5 -showWeaveInfo"> | |||
<message kind="weave" text="Join point 'field-get(int C.i)' in Type 'C' (C.java:17) advised by before advice from 'X' (C.java:22)"/> | |||
</compile> | |||
</ajc-test> | |||
<ajc-test dir="bugs1612/pr356612" title="annotation field binding optimization"> | |||
<compile files="AnnoBinding.java" options="-1.5"/> | |||
<run class="AnnoBinding"> |