summaryrefslogtreecommitdiffstats
path: root/tests/new
diff options
context:
space:
mode:
Diffstat (limited to 'tests/new')
-rw-r--r--tests/new/binaryWarnings/injars/app-ajc-1.1.jarbin1143 -> 1180 bytes
-rw-r--r--tests/new/binaryWarnings/injars/app-javac-1.4.jarbin1208 -> 1275 bytes
-rw-r--r--tests/new/binaryWarnings/injars/appStartLines-ajc-1.1.jarbin0 -> 554 bytes
-rw-r--r--tests/new/binaryWarnings/injars/appStartLines-javac-1.4.jarbin0 -> 692 bytes
-rw-r--r--tests/new/binaryWarnings/readme.txt4
-rw-r--r--tests/new/binaryWarnings/src/app/Main.java4
-rw-r--r--tests/new/binaryWarnings/src/app/MainExecStartLines.java28
-rw-r--r--tests/new/binaryWarnings/src/aspects/MainExecStartLinesErrors.java16
8 files changed, 50 insertions, 2 deletions
diff --git a/tests/new/binaryWarnings/injars/app-ajc-1.1.jar b/tests/new/binaryWarnings/injars/app-ajc-1.1.jar
index c05b42247..020b5d00e 100644
--- a/tests/new/binaryWarnings/injars/app-ajc-1.1.jar
+++ b/tests/new/binaryWarnings/injars/app-ajc-1.1.jar
Binary files differ
diff --git a/tests/new/binaryWarnings/injars/app-javac-1.4.jar b/tests/new/binaryWarnings/injars/app-javac-1.4.jar
index c16325897..fd9832350 100644
--- a/tests/new/binaryWarnings/injars/app-javac-1.4.jar
+++ b/tests/new/binaryWarnings/injars/app-javac-1.4.jar
Binary files differ
diff --git a/tests/new/binaryWarnings/injars/appStartLines-ajc-1.1.jar b/tests/new/binaryWarnings/injars/appStartLines-ajc-1.1.jar
new file mode 100644
index 000000000..a79518649
--- /dev/null
+++ b/tests/new/binaryWarnings/injars/appStartLines-ajc-1.1.jar
Binary files differ
diff --git a/tests/new/binaryWarnings/injars/appStartLines-javac-1.4.jar b/tests/new/binaryWarnings/injars/appStartLines-javac-1.4.jar
new file mode 100644
index 000000000..2824d4a0c
--- /dev/null
+++ b/tests/new/binaryWarnings/injars/appStartLines-javac-1.4.jar
Binary files differ
diff --git a/tests/new/binaryWarnings/readme.txt b/tests/new/binaryWarnings/readme.txt
index 6b6eb486e..a6f0a69a4 100644
--- a/tests/new/binaryWarnings/readme.txt
+++ b/tests/new/binaryWarnings/readme.txt
@@ -23,6 +23,10 @@ Bugs: 37020, 37021, 37023
- all test specifications should have exactly the same warnings
as each other as as specified in MainWarnings.java
+- the ExecStartLine variants show that for binary join points,
+ we detect the first line of code in the associated block,
+ not the first line of the block. This is a known limitation.
+
To build the injar sources from the src directory:
Using javac:
diff --git a/tests/new/binaryWarnings/src/app/Main.java b/tests/new/binaryWarnings/src/app/Main.java
index a2daee1d9..a118555d4 100644
--- a/tests/new/binaryWarnings/src/app/Main.java
+++ b/tests/new/binaryWarnings/src/app/Main.java
@@ -23,14 +23,14 @@ public class Main {
Main() { // 23
}
- void go(String s) { // 26
+ void go(String s) { String t = "..".substring(0); // 26
try {
String temp = this.s; // 29
this.s = temp + ", " + s; // 31
- } catch (RuntimeException e) { // 33
+ } catch (RuntimeException e) { String u = "..".substring(0); // 33
stop(); // 35
diff --git a/tests/new/binaryWarnings/src/app/MainExecStartLines.java b/tests/new/binaryWarnings/src/app/MainExecStartLines.java
new file mode 100644
index 000000000..826fd29b2
--- /dev/null
+++ b/tests/new/binaryWarnings/src/app/MainExecStartLines.java
@@ -0,0 +1,28 @@
+
+package app;
+
+public class MainExecStartLines {
+
+ public static void main(String[] args) // 6
+ { // 7
+
+
+
+
+ String t = "....".substring(0); // 12
+ }
+ void go(String s) {
+ try {
+ String t = "....".substring(0);
+ } catch (RuntimeException e) { // 17
+
+
+ String t = "....".substring(0); // 20
+ }
+ }
+}
+/*
+ * known limitation:
+ * For static shadow of [method|handler] execution join points
+ * in binary form, only can detect first line of code.
+ */
diff --git a/tests/new/binaryWarnings/src/aspects/MainExecStartLinesErrors.java b/tests/new/binaryWarnings/src/aspects/MainExecStartLinesErrors.java
new file mode 100644
index 000000000..704afa98d
--- /dev/null
+++ b/tests/new/binaryWarnings/src/aspects/MainExecStartLinesErrors.java
@@ -0,0 +1,16 @@
+
+package aspects;
+
+import app.MainExecStartLines;
+
+// WARNING: do not change message text without changing test specification
+public privileged aspect MainExecStartLinesErrors {
+
+ declare error : execution(void MainExecStartLines.main(String[]))
+ : "execution(void MainExecStartLines.main(String[]))";
+
+ declare error : handler(RuntimeException)
+ && within(MainExecStartLines)
+ : "handler(RuntimeException) && within(MainExecStartLines)";
+
+} \ No newline at end of file