aboutsummaryrefslogtreecommitdiffstats
path: root/tests/bugs/typeVisibilityProblem
diff options
context:
space:
mode:
authoraclement <aclement>2004-08-05 09:24:52 +0000
committeraclement <aclement>2004-08-05 09:24:52 +0000
commitd8fa2e2f2706279779f3818b2af9825396f5e574 (patch)
treeece1a7717e581c36778562b474e29c033c188389 /tests/bugs/typeVisibilityProblem
parentaafe4244db32cb6b75c80bd712ef6188bb2a1d4e (diff)
downloadaspectj-d8fa2e2f2706279779f3818b2af9825396f5e574.tar.gz
aspectj-d8fa2e2f2706279779f3818b2af9825396f5e574.zip
Tests for
Bugzilla Bug 71273 - RuntimeException thrown: Could not find instruction: org.apache.bcel.generic.B2I Bugzilla Bug 67591 - invalid warning indicating no match when a match really occurs
Diffstat (limited to 'tests/bugs/typeVisibilityProblem')
-rw-r--r--tests/bugs/typeVisibilityProblem/Main.java44
1 files changed, 44 insertions, 0 deletions
diff --git a/tests/bugs/typeVisibilityProblem/Main.java b/tests/bugs/typeVisibilityProblem/Main.java
new file mode 100644
index 000000000..2783284e3
--- /dev/null
+++ b/tests/bugs/typeVisibilityProblem/Main.java
@@ -0,0 +1,44 @@
+public class Main {
+
+ private static class Foo {
+ int x;
+ Foo(int x) { this.x = x; }
+ };
+
+ private static int foo(int x) { return x+1; }
+
+ public static void main (String args[])
+ { Main.foo(1);
+ new Foo(2);
+ }
+
+ }
+
+ aspect Aspect {
+ // calls to a private method
+ before () : call(* foo(..))
+ { System.out.println("Matches * foo(..)");
+ }
+
+ before () : call(int foo(int))
+ { System.out.println("Matches int foo(int)");
+ }
+
+ before () : call(private * foo(..))
+ { System.out.println("Matches private * foo(..)");
+ }
+
+ before () : call(* foo*(..))
+ { System.out.println("Matches * foo*(..)");
+ }
+
+ // calls to a constructor that is in a private inner class
+ before () : call(Main.Foo.new(..)) // <- warning from here
+ { System.out.println("Matches Main.Foo.new(..)");
+ }
+
+ before () : call(Main.Foo*.new(..))
+ { System.out.println("Matches Main.Foo*.new(..)");
+ }
+
+ } \ No newline at end of file