From: wisberg Date: Thu, 1 May 2003 11:13:25 +0000 (+0000) Subject: updated tests for [method|execution] binary join point detection. X-Git-Tag: V1_1_0_RC2~99 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=2a0ce5da6e2839e21345f9cff3327038e40408db;p=aspectj.git updated tests for [method|execution] binary join point detection. added narrower knownLimitation test --- 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 c05b42247..020b5d00e 100644 Binary files a/tests/new/binaryWarnings/injars/app-ajc-1.1.jar and b/tests/new/binaryWarnings/injars/app-ajc-1.1.jar 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 Binary files a/tests/new/binaryWarnings/injars/app-javac-1.4.jar and b/tests/new/binaryWarnings/injars/app-javac-1.4.jar 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 Binary files /dev/null and b/tests/new/binaryWarnings/injars/appStartLines-ajc-1.1.jar 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 Binary files /dev/null and b/tests/new/binaryWarnings/injars/appStartLines-javac-1.4.jar 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