--- /dev/null
+import java.lang.annotation.*;
+import java.io.*;
+
+@Entity(indexed=false)
+public class Foo {
+ public static void main(String []argv) {
+ Foo f = new Foo();
+ Goo g = new Goo();
+ if (f instanceof Serializable) {
+ throw new RuntimeException("Foo should not implement it");
+ }
+ if (!(g instanceof Serializable)) {
+ throw new RuntimeException("Goo should implement it");
+ }
+ if (new Hoo() instanceof Serializable) {
+ throw new RuntimeException("Hoo should not implement it");
+ }
+ }
+}
+
+@Entity(indexed=true)
+class Goo {
+}
+
+@Entity // default is false
+class Hoo {
+}
+
+@Retention(RetentionPolicy.RUNTIME)
+@interface Entity {
+ boolean indexed() default false;
+}
+
+aspect X {
+ declare parents: (@Entity(indexed=true) *) implements java.io.Serializable;
+}
--- /dev/null
+import java.lang.annotation.*;
+import java.io.*;
+
+@Entity(indexed=false)
+public class Foo2 {
+ public static void main(String []argv) {
+ Foo2 f = new Foo2();
+ Goo g = new Goo();
+ if (f instanceof Serializable) {
+ throw new RuntimeException("Foo2 should not implement it");
+ }
+ if (!(g instanceof Serializable)) {
+ throw new RuntimeException("Goo should implement it");
+ }
+ if (!(new Hoo() instanceof Serializable)) {
+ throw new RuntimeException("Hoo should implement it");
+ }
+ }
+}
+
+@Entity(indexed=true)
+class Goo {
+}
+
+@Entity // default is true
+class Hoo {
+}
+
+@Retention(RetentionPolicy.RUNTIME)
+@interface Entity {
+ boolean indexed() default true;
+}
+
+aspect X {
+ declare parents: (@Entity(indexed=true) *) implements java.io.Serializable;
+}
--- /dev/null
+import java.lang.annotation.*;
+import java.io.*;
+
+@Entity(i=1)
+public class Foo3 {
+ public static void main(String []argv) {
+ Foo3 f = new Foo3();
+ Goo g = new Goo();
+ if (f instanceof Serializable) {
+ throw new RuntimeException("Foo3 should not implement it");
+ }
+ if (!(g instanceof Serializable)) {
+ throw new RuntimeException("Goo should implement it");
+ }
+ if (new Hoo() instanceof Serializable) {
+ throw new RuntimeException("Hoo should not implement it");
+ }
+ }
+}
+
+@Entity(i=2)
+class Goo {
+}
+
+@Entity // default is 1
+class Hoo {
+}
+
+@Retention(RetentionPolicy.RUNTIME)
+@interface Entity {
+ int i() default 1;
+}
+
+aspect X {
+ declare parents: (@Entity(i=2) *) implements java.io.Serializable;
+}
--- /dev/null
+import java.lang.annotation.*;
+import java.io.*;
+
+@Entity(i=1)
+public class Foo4 {
+ public static void main(String []argv) {
+ Foo4 f = new Foo4();
+ Goo g = new Goo();
+ if (f instanceof Serializable) {
+ throw new RuntimeException("Foo4 should not implement it");
+ }
+ if (!(g instanceof Serializable)) {
+ throw new RuntimeException("Goo should implement it");
+ }
+ if (!(new Hoo() instanceof Serializable)) {
+ throw new RuntimeException("Hoo should implement it");
+ }
+ }
+}
+
+@Entity(i=2)
+class Goo {
+}
+
+@Entity // default is 2
+class Hoo {
+}
+
+@Retention(RetentionPolicy.RUNTIME)
+@interface Entity {
+ int i() default 2;
+}
+
+aspect X {
+ declare parents: (@Entity(i=2) *) implements java.io.Serializable;
+}
public class Ajc162Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
// AspectJ1.6.2
- public void testAnnotationDecp_pr239441() { runTest("annotation decp"); }
-
+// public void testAnnotationDecp_pr239441() { runTest("annotation decp"); }
+ public void testAnnotationValueDecp_pr238992() { runTest("annotation value decp"); }
+ public void testAnnotationValueDecp_pr238992_2() { runTest("annotation value decp - 2"); }
+ public void testAnnotationValueDecp_pr238992_3() { runTest("annotation value decp - 3"); }
+ public void testAnnotationValueDecp_pr238992_4() { runTest("annotation value decp - 4"); }
+
public static Test suite() {
return XMLBasedAjcTestCase.loadSuite(Ajc162Tests.class);
}
<compile files="Test3.java SampleAspect.java" options="-1.5 -showWeaveInfo -XhasMember">
</compile>
</ajc-test>
+
+ <ajc-test dir="bugs162/pr238992" title="annotation value decp">
+ <compile files="Foo.java" options="-1.5 -showWeaveInfo">
+ <message kind="weave" text="Extending interface set for type 'Goo'"/>
+ </compile>
+ <run class="Foo"/>
+ </ajc-test>
+
+ <ajc-test dir="bugs162/pr238992" title="annotation value decp - 2">
+ <compile files="Foo2.java" options="-1.5 -showWeaveInfo">
+ <message kind="weave" text="Extending interface set for type 'Goo'"/>
+ <message kind="weave" text="Extending interface set for type 'Hoo'"/>
+ </compile>
+ <run class="Foo2"/>
+ </ajc-test>
+
+ <ajc-test dir="bugs162/pr238992" title="annotation value decp - 3">
+ <compile files="Foo3.java" options="-1.5 -showWeaveInfo">
+ <message kind="weave" text="Extending interface set for type 'Goo'"/>
+ </compile>
+ <run class="Foo3"/>
+ </ajc-test>
+
+ <ajc-test dir="bugs162/pr238992" title="annotation value decp - 4">
+ <compile files="Foo4.java" options="-1.5 -showWeaveInfo">
+ <message kind="weave" text="Extending interface set for type 'Goo'"/>
+ <message kind="weave" text="Extending interface set for type 'Hoo'"/>
+ </compile>
+ <run class="Foo4"/>
+ </ajc-test>
</suite>
\ No newline at end of file