aboutsummaryrefslogtreecommitdiffstats
path: root/tests/bugs150/pr71159
diff options
context:
space:
mode:
authoracolyer <acolyer>2005-08-31 15:44:22 +0000
committeracolyer <acolyer>2005-08-31 15:44:22 +0000
commit7e0c3cdc37b974ef2bba01e19fa90cb9c752f288 (patch)
treed22ab831215e0e6143e2f1da7ddd816be17e2200 /tests/bugs150/pr71159
parent6c8747b590e9e9092ae256f2c7af0db169a6e2e4 (diff)
downloadaspectj-7e0c3cdc37b974ef2bba01e19fa90cb9c752f288.tar.gz
aspectj-7e0c3cdc37b974ef2bba01e19fa90cb9c752f288.zip
tests and fix for pr71159, visibility not taken into account when determining matching signatures with overrides
Diffstat (limited to 'tests/bugs150/pr71159')
-rw-r--r--tests/bugs150/pr71159/PrivateITD.aj34
-rw-r--r--tests/bugs150/pr71159/pkg1/A.java7
-rw-r--r--tests/bugs150/pr71159/pkg1/B.java3
-rw-r--r--tests/bugs150/pr71159/pkg1/C.java7
-rw-r--r--tests/bugs150/pr71159/pkg2/ITDInDiffPackage.aj17
-rw-r--r--tests/bugs150/pr71159/pr71159.aj32
6 files changed, 100 insertions, 0 deletions
diff --git a/tests/bugs150/pr71159/PrivateITD.aj b/tests/bugs150/pr71159/PrivateITD.aj
new file mode 100644
index 000000000..e4649d015
--- /dev/null
+++ b/tests/bugs150/pr71159/PrivateITD.aj
@@ -0,0 +1,34 @@
+class A {
+
+
+
+}
+
+class B extends A {
+
+ protected void foo() {}
+
+}
+
+class C extends B {}
+
+
+class D extends C {
+
+ public void foo() {}
+
+}
+
+aspect X {
+
+ private void A.foo() {}
+
+ void bar() {
+ D d = new D();
+ d.foo();
+ }
+
+ declare warning : call(* B.foo()) : "should match";
+ declare warning : call(* A.foo()) : "should not match";
+
+} \ No newline at end of file
diff --git a/tests/bugs150/pr71159/pkg1/A.java b/tests/bugs150/pr71159/pkg1/A.java
new file mode 100644
index 000000000..f07afe231
--- /dev/null
+++ b/tests/bugs150/pr71159/pkg1/A.java
@@ -0,0 +1,7 @@
+package pkg1;
+
+public class A {
+
+ //public void foo() {}
+
+} \ No newline at end of file
diff --git a/tests/bugs150/pr71159/pkg1/B.java b/tests/bugs150/pr71159/pkg1/B.java
new file mode 100644
index 000000000..e931fe8c9
--- /dev/null
+++ b/tests/bugs150/pr71159/pkg1/B.java
@@ -0,0 +1,3 @@
+package pkg1;
+
+public class B {} \ No newline at end of file
diff --git a/tests/bugs150/pr71159/pkg1/C.java b/tests/bugs150/pr71159/pkg1/C.java
new file mode 100644
index 000000000..48840a420
--- /dev/null
+++ b/tests/bugs150/pr71159/pkg1/C.java
@@ -0,0 +1,7 @@
+package pkg1;
+
+public class C {
+
+ public void foo() {}
+
+} \ No newline at end of file
diff --git a/tests/bugs150/pr71159/pkg2/ITDInDiffPackage.aj b/tests/bugs150/pr71159/pkg2/ITDInDiffPackage.aj
new file mode 100644
index 000000000..fa44cbf82
--- /dev/null
+++ b/tests/bugs150/pr71159/pkg2/ITDInDiffPackage.aj
@@ -0,0 +1,17 @@
+package pkg2;
+import pkg1.*;
+
+public aspect ITDInDiffPackage {
+
+ void B.foo() {}
+
+ void bar() {
+ C c = new C();
+ c.foo();
+ }
+
+ declare warning : call(* B.foo()) : "should not match";
+ declare warning : call(* C.foo()) : "should match";
+
+
+} \ No newline at end of file
diff --git a/tests/bugs150/pr71159/pr71159.aj b/tests/bugs150/pr71159/pr71159.aj
new file mode 100644
index 000000000..d332b4a4d
--- /dev/null
+++ b/tests/bugs150/pr71159/pr71159.aj
@@ -0,0 +1,32 @@
+class A {
+
+ private void foo() {}
+
+}
+
+class B extends A {
+
+ protected void foo() {}
+
+}
+
+class C extends B {}
+
+
+class D extends C {
+
+ public void foo() {}
+
+}
+
+aspect X {
+
+ void bar() {
+ D d = new D();
+ d.foo();
+ }
+
+ declare warning : call(* B.foo()) : "should match";
+ declare warning : call(* A.foo()) : "should not match";
+
+} \ No newline at end of file