summaryrefslogtreecommitdiffstats
path: root/tests/hasmember/HasPrivateMethodInherited.aj
diff options
context:
space:
mode:
authoracolyer <acolyer>2005-08-21 19:53:30 +0000
committeracolyer <acolyer>2005-08-21 19:53:30 +0000
commit262edc95da3a65bb4c86024abf531ac0ddf8bd69 (patch)
tree8c42083fa9677838168e3ddc6a8fd5ad7b1f8e7e /tests/hasmember/HasPrivateMethodInherited.aj
parentce7e64ba610a2957b81d373986668c6cf60b8722 (diff)
downloadaspectj-262edc95da3a65bb4c86024abf531ac0ddf8bd69.tar.gz
aspectj-262edc95da3a65bb4c86024abf531ac0ddf8bd69.zip
hasmember (hasmethod / hasfield) tests - not linked into main suite at this point in time
Diffstat (limited to 'tests/hasmember/HasPrivateMethodInherited.aj')
-rw-r--r--tests/hasmember/HasPrivateMethodInherited.aj28
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/hasmember/HasPrivateMethodInherited.aj b/tests/hasmember/HasPrivateMethodInherited.aj
new file mode 100644
index 000000000..dff672b6a
--- /dev/null
+++ b/tests/hasmember/HasPrivateMethodInherited.aj
@@ -0,0 +1,28 @@
+public aspect HasPrivateMethodInherited {
+
+ declare parents : D && hasmethod(* print(..)) implements Printable;
+
+ public static void main(String[] args) {
+ C c = new C();
+ if ((c instanceof Printable)) {
+ throw new RuntimeException("declare parents : hasmethod failed on super");
+ }
+ D d = new D();
+ if ((d instanceof Printable)) {
+ throw new RuntimeException("declare parents : hasmethod failed on sub");
+ }
+
+ }
+}
+
+class C {
+
+ private void print() {}
+
+}
+
+class D extends C {
+
+}
+
+interface Printable {}; \ No newline at end of file