summaryrefslogtreecommitdiffstats
path: root/tests/bugs
diff options
context:
space:
mode:
authoraclement <aclement>2004-08-11 13:18:24 +0000
committeraclement <aclement>2004-08-11 13:18:24 +0000
commitd43a39103f476d95cade6b87b604ee4578de25b3 (patch)
tree88f9042ebb174041e88e97688a5ee99cae473aca /tests/bugs
parent0f21863d2428663a84d914b928fba56e8baa8f14 (diff)
downloadaspectj-d43a39103f476d95cade6b87b604ee4578de25b3.tar.gz
aspectj-d43a39103f476d95cade6b87b604ee4578de25b3.zip
Tests and fix for Bugzilla Bug 54421
Compile time declarations (warning and error) do not accept string concatenation (with +)
Diffstat (limited to 'tests/bugs')
-rw-r--r--tests/bugs/decwStrings.java49
-rw-r--r--tests/bugs/decwStringsErroneous.java29
2 files changed, 78 insertions, 0 deletions
diff --git a/tests/bugs/decwStrings.java b/tests/bugs/decwStrings.java
new file mode 100644
index 000000000..ef392a669
--- /dev/null
+++ b/tests/bugs/decwStrings.java
@@ -0,0 +1,49 @@
+class WarningSample {
+
+ public void method() {}
+ public void anotherMethod() {
+ this.method();
+ }
+
+ }
+
+ aspect WarningAspect {
+
+ pointcut illegalCall(): call(* WarningSample.method())
+ && within(WarningSample);
+
+ // the same thing happens with declare error
+ declare warning: illegalCall() : "Hey, don't " +
+ "do that, that is not nice. You should do something else";
+
+ public void e1() {}
+ declare warning: execution(* e1(..)): "hello " + /* comment */ "world";
+
+ public void e2() {}
+ declare warning: execution(* e2(..)): "hello " /* comment */ + "world";
+
+ public void e3() {}
+ declare warning: execution(* e3(..)): "hello " + // commenthere
+ // comment here too
+ "world";
+
+ public void e4() {}
+ declare warning: execution(* e4()): "hello " //xxx
+ + "world";
+
+ public void e5() {}
+ declare warning: execution(* e5()): "hello " //xxx
+ /* here */
+ + "world";
+
+ public void e6() {}
+ declare warning: execution(* e6()): "abc" +
+ "def" + // def was here
+ "ghijklmnopqrstuv" /* silly
+place
+for a
+comment */ +
+/* oops */
+ "wxyz";
+ }
+
diff --git a/tests/bugs/decwStringsErroneous.java b/tests/bugs/decwStringsErroneous.java
new file mode 100644
index 000000000..11664ac98
--- /dev/null
+++ b/tests/bugs/decwStringsErroneous.java
@@ -0,0 +1,29 @@
+class WarningSample {
+
+ public void method() {}
+ public void anotherMethod() {
+ this.method();
+ }
+
+ }
+
+ aspect WarningAspect {
+
+ pointcut illegalCall(): call(* WarningSample.method())
+ && within(WarningSample);
+
+ // the same thing happens with declare error
+ declare warning: illegalCall() : "Hey, don't " +
+ "do that, that is not nice. You should do something else";
+
+ public void e1() {}
+ declare warning: execution(* e1(..)): "hello " + /* comment */ "world"
+
+ public void e2() {}
+ declare warning: execution(* e2(..)): "hello " /* comment + "world";
+
+ public void e3() {}
+ declare warning: execution(* e3(..)): "hello " + // commenthere
+
+ }
+