summaryrefslogtreecommitdiffstats
path: root/tests/bugs162
diff options
context:
space:
mode:
authoraclement <aclement>2008-07-07 22:32:39 +0000
committeraclement <aclement>2008-07-07 22:32:39 +0000
commitad03f314f66a7c49737f32fc23b4aea6bef3d8cf (patch)
tree8e533b3820ac979178e97c4c2f8179076e12d18b /tests/bugs162
parent3d5b79a6b05bb26b025e9e9e7d4ad2772a85d023 (diff)
downloadaspectj-ad03f314f66a7c49737f32fc23b4aea6bef3d8cf.tar.gz
aspectj-ad03f314f66a7c49737f32fc23b4aea6bef3d8cf.zip
238992: test and fix
Diffstat (limited to 'tests/bugs162')
-rw-r--r--tests/bugs162/pr238992/Foo.java36
-rw-r--r--tests/bugs162/pr238992/Foo2.java36
-rw-r--r--tests/bugs162/pr238992/Foo3.java36
-rw-r--r--tests/bugs162/pr238992/Foo4.java36
4 files changed, 144 insertions, 0 deletions
diff --git a/tests/bugs162/pr238992/Foo.java b/tests/bugs162/pr238992/Foo.java
new file mode 100644
index 000000000..d4fe3600d
--- /dev/null
+++ b/tests/bugs162/pr238992/Foo.java
@@ -0,0 +1,36 @@
+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;
+}
diff --git a/tests/bugs162/pr238992/Foo2.java b/tests/bugs162/pr238992/Foo2.java
new file mode 100644
index 000000000..38f496dd5
--- /dev/null
+++ b/tests/bugs162/pr238992/Foo2.java
@@ -0,0 +1,36 @@
+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;
+}
diff --git a/tests/bugs162/pr238992/Foo3.java b/tests/bugs162/pr238992/Foo3.java
new file mode 100644
index 000000000..5935688ed
--- /dev/null
+++ b/tests/bugs162/pr238992/Foo3.java
@@ -0,0 +1,36 @@
+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;
+}
diff --git a/tests/bugs162/pr238992/Foo4.java b/tests/bugs162/pr238992/Foo4.java
new file mode 100644
index 000000000..87ee3c6b2
--- /dev/null
+++ b/tests/bugs162/pr238992/Foo4.java
@@ -0,0 +1,36 @@
+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;
+}