aboutsummaryrefslogtreecommitdiffstats
path: root/tests/new/binaryWarnings/src
diff options
context:
space:
mode:
authorwisberg <wisberg>2003-04-28 20:08:56 +0000
committerwisberg <wisberg>2003-04-28 20:08:56 +0000
commit9b30f9f9d9e55ff51dc6c05ee88e00c1d84c8abf (patch)
tree253ba1792a13cab460b07fe12fe43e1398cc8d4a /tests/new/binaryWarnings/src
parent7d144321837cac05cdbe2a30323d670dfcc9809a (diff)
downloadaspectj-9b30f9f9d9e55ff51dc6c05ee88e00c1d84c8abf.tar.gz
aspectj-9b30f9f9d9e55ff51dc6c05ee88e00c1d84c8abf.zip
test cases for binary warnings (bugs 37020, 37021, 37023)
Diffstat (limited to 'tests/new/binaryWarnings/src')
-rw-r--r--tests/new/binaryWarnings/src/app/Main.java55
-rw-r--r--tests/new/binaryWarnings/src/aspects/MainWarnings.java56
2 files changed, 111 insertions, 0 deletions
diff --git a/tests/new/binaryWarnings/src/app/Main.java b/tests/new/binaryWarnings/src/app/Main.java
new file mode 100644
index 000000000..a2daee1d9
--- /dev/null
+++ b/tests/new/binaryWarnings/src/app/Main.java
@@ -0,0 +1,55 @@
+
+package app;
+// WARNING: do not change lineation without changing test specification!!
+public class Main {
+
+ static String staticString = "hello";
+
+ String s = "me";
+
+ public static void main(String[] args) {
+
+ String temp = staticString; // 12
+
+ staticString = temp + " world!"; // 14
+
+ Main main = new Main(); // 16
+
+ for (int i = 0; i < args.length; i++) {
+ main.go(args[i]); // 19
+ }
+ }
+
+ Main() { // 23
+ }
+
+ void go(String s) { // 26
+ try {
+
+ String temp = this.s; // 29
+
+ this.s = temp + ", " + s; // 31
+
+ } catch (RuntimeException e) { // 33
+
+ stop(); // 35
+
+ }
+ }
+
+ void stop() { // 40
+
+ new Main(); // 42
+
+ }
+}
+
+
+class C {
+
+ C() { // 50
+
+ }
+
+}
+
diff --git a/tests/new/binaryWarnings/src/aspects/MainWarnings.java b/tests/new/binaryWarnings/src/aspects/MainWarnings.java
new file mode 100644
index 000000000..4debf1f3b
--- /dev/null
+++ b/tests/new/binaryWarnings/src/aspects/MainWarnings.java
@@ -0,0 +1,56 @@
+
+package aspects;
+
+import app.Main;
+
+// WARNING: do not change message text without changing test specification
+public privileged aspect MainWarnings {
+
+ declare warning : staticinitialization(Main)
+ : "staticinitializtion(Main)";
+
+ declare warning : initialization(Main.new())
+ : "initialization(Main.new())";
+
+ declare warning : execution(Main.new())
+ : "execution(Main.new())";
+
+ declare warning : execution(void Main.go(String))
+ : "execution(void Main.go(String))";
+
+ declare warning : call(Main.new())
+ : "call(Main.new())";
+
+ declare warning : call(void Main.go(String))
+ : "call(void Main.go(String))";
+
+ declare warning : call(Main.new())
+ && withincode(void Main.stop())
+ : "call(Main.new()) && withincode(void Main.stop())";
+
+ declare warning : call(void Main.stop())
+ && withincode(void Main.go(String))
+ : "call(void Main.stop()) && withincode(void Main.go(String))";
+
+ declare warning : get(String Main.s)
+ : "get(String Main.s)";
+
+ declare warning : set(String Main.s)
+ : "set(String Main.s)";
+
+ declare warning : get(String Main.staticString)
+ : "get(String Main.staticString)";
+
+ declare warning : set(String Main.staticString)
+ : "set(String Main.staticString)";
+
+ declare warning : handler(RuntimeException)
+ && within(Main)
+ : "handler(RuntimeException) && within(Main)";
+
+ declare warning : preinitialization(app.C.new())
+ : "preinitialization(app.C.new())";
+
+// declare warning : adviceexecution() && within(app.AdvisingAspect)
+// : "adviceexecution() && within(app.AdvisingAspect)";
+} \ No newline at end of file