From 2a0ce5da6e2839e21345f9cff3327038e40408db Mon Sep 17 00:00:00 2001 From: wisberg Date: Thu, 1 May 2003 11:13:25 +0000 Subject: [PATCH] updated tests for [method|execution] binary join point detection. added narrower knownLimitation test --- tests/ajcTests.xml | 131 ++++++++++++++++++ tests/ajcTestsFailing.xml | 21 +++ .../new/binaryWarnings/injars/app-ajc-1.1.jar | Bin 1143 -> 1180 bytes .../binaryWarnings/injars/app-javac-1.4.jar | Bin 1208 -> 1275 bytes .../injars/appStartLines-ajc-1.1.jar | Bin 0 -> 554 bytes .../injars/appStartLines-javac-1.4.jar | Bin 0 -> 692 bytes tests/new/binaryWarnings/readme.txt | 4 + tests/new/binaryWarnings/src/app/Main.java | 4 +- .../src/app/MainExecStartLines.java | 28 ++++ .../src/aspects/MainExecStartLinesErrors.java | 16 +++ 10 files changed, 202 insertions(+), 2 deletions(-) create mode 100644 tests/new/binaryWarnings/injars/appStartLines-ajc-1.1.jar create mode 100644 tests/new/binaryWarnings/injars/appStartLines-javac-1.4.jar create mode 100644 tests/new/binaryWarnings/src/app/MainExecStartLines.java create mode 100644 tests/new/binaryWarnings/src/aspects/MainExecStartLinesErrors.java diff --git a/tests/ajcTests.xml b/tests/ajcTests.xml index 8553355a5..8c4c21639 100644 --- a/tests/ajcTests.xml +++ b/tests/ajcTests.xml @@ -5913,4 +5913,135 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/ajcTestsFailing.xml b/tests/ajcTestsFailing.xml index 711108e0a..2b914897e 100644 --- a/tests/ajcTestsFailing.xml +++ b/tests/ajcTestsFailing.xml @@ -118,5 +118,26 @@ + + + + + + + + + + + + + diff --git a/tests/new/binaryWarnings/injars/app-ajc-1.1.jar b/tests/new/binaryWarnings/injars/app-ajc-1.1.jar index c05b4224703bd87906bc275112d32ddceb7fc2ed..020b5d00e37952d9abe8eaf50af8f9e8b0c5d5ad 100644 G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XN=>?JwAgP6sNrVBBUXV=$r56NH12XZY Uo&axFHjrv2AZ!5Aa!eo|013ee#Q*>R literal 0 HcmV?d00001 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 -- 2.39.5