aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authoracolyer <acolyer>2004-08-19 12:29:04 +0000
committeracolyer <acolyer>2004-08-19 12:29:04 +0000
commit65c67a4e848311efb7402f5d06bd1a833720b94b (patch)
treefdb6a106aa7059922e42adb079516a04c4093514 /tests
parent2834a7c26b42b8d98af57ef9733ae94fa4aa4a5b (diff)
downloadaspectj-65c67a4e848311efb7402f5d06bd1a833720b94b.tar.gz
aspectj-65c67a4e848311efb7402f5d06bd1a833720b94b.zip
fix for Bugzilla Bug 37020
wrong line for method execution join point
Diffstat (limited to 'tests')
-rw-r--r--tests/bugs/StringToString/helloworld.jarbin1019 -> 1066 bytes
-rw-r--r--tests/bugs/serialVersionUID/injar.jarbin2099 -> 2381 bytes
-rw-r--r--tests/design/sourceLines/TestSourceLines.java52
-rw-r--r--tests/new/DeclareWarningMain.java4
-rw-r--r--tests/new/declare/DeclareWarning.java4
-rw-r--r--tests/new/options11/aspectlib1.jarbin1209 -> 1547 bytes
-rw-r--r--tests/new/options11/aspectlib2.jarbin974 -> 1223 bytes
-rw-r--r--tests/new/options11/injar.jarbin363 -> 597 bytes
-rw-r--r--tests/src/org/aspectj/systemtest/ajc10x/ajc10x-tests.xml2
-rw-r--r--tests/src/org/aspectj/systemtest/ajc11/ajc11-tests.xml4
-rw-r--r--tests/src/org/aspectj/systemtest/incremental/IncrementalTests.java2
-rw-r--r--tests/src/org/aspectj/systemtest/incremental/incremental-junit-tests.xml2
-rw-r--r--tests/src/org/aspectj/systemtest/incremental/incremental-tests.xml2
-rw-r--r--tests/src/org/aspectj/systemtest/pre10x/pre10x-tests.xml3
14 files changed, 64 insertions, 11 deletions
diff --git a/tests/bugs/StringToString/helloworld.jar b/tests/bugs/StringToString/helloworld.jar
index 185b8eb2b..447374ddc 100644
--- a/tests/bugs/StringToString/helloworld.jar
+++ b/tests/bugs/StringToString/helloworld.jar
Binary files differ
diff --git a/tests/bugs/serialVersionUID/injar.jar b/tests/bugs/serialVersionUID/injar.jar
index 7a8996bb2..a5dbf9798 100644
--- a/tests/bugs/serialVersionUID/injar.jar
+++ b/tests/bugs/serialVersionUID/injar.jar
Binary files differ
diff --git a/tests/design/sourceLines/TestSourceLines.java b/tests/design/sourceLines/TestSourceLines.java
new file mode 100644
index 000000000..8a97048e8
--- /dev/null
+++ b/tests/design/sourceLines/TestSourceLines.java
@@ -0,0 +1,52 @@
+public class TestSourceLines { // L1
+
+ private int i = 0; // L3
+
+ private static int J = 1; // L5
+ private static int K; // L6
+
+ static { // L8
+ System.out.println("K = 2");
+ }
+
+ public TestSourceLines() { // L12
+ i = 3;
+ }
+
+ public TestSourceLines(int i) { // L16
+ this.i = i;
+ }
+
+ public void foo() { // L20
+ System.out.println(i);
+ }
+
+ private void bar() { System.out.println(i); } // L24
+
+ protected // L26
+ void
+ goo() // L28
+ {
+ System.out.println(i);
+ }
+
+}
+
+class NoStaticInitBlock { // L35
+
+}
+
+aspect CheckLineNumbers { // L39
+
+ declare warning : execution(* TestSourceLines.*(..)) : "method execution";
+ declare warning : execution(TestSourceLines.new(..)) : "cons execution";
+ declare warning : staticinitialization(*) : "static init";
+ declare warning : initialization(*.new(..)) : "init";
+ declare warning : preinitialization(*.new(..)) : "pre-init";
+
+ before() : execution(* TestSourceLines.*(..)) { // L47
+ System.out.println("boo");
+ }
+
+ declare warning : adviceexecution() : "advice";
+} \ No newline at end of file
diff --git a/tests/new/DeclareWarningMain.java b/tests/new/DeclareWarningMain.java
index 243a4668b..add8ff01e 100644
--- a/tests/new/DeclareWarningMain.java
+++ b/tests/new/DeclareWarningMain.java
@@ -1,7 +1,7 @@
import org.aspectj.testing.*;
public class DeclareWarningMain {
- public static void main (String[] args) { // DW 5 main
+ public static void main (String[] args) { // DW 4 main
Tester.checkAllEvents();
}
static {
@@ -10,7 +10,7 @@ public class DeclareWarningMain {
}
aspect Warnings {
- declare warning : execution(static void main(String[])) : "main"; // for DW 5 main
+ declare warning : execution(static void main(String[])) : "main"; // for DW 4 main
// just to show that pointcut is valid - works if warning removed
before() : execution(static void main(String[])) {
diff --git a/tests/new/declare/DeclareWarning.java b/tests/new/declare/DeclareWarning.java
index 1ea56b2b8..9f7efccf5 100644
--- a/tests/new/declare/DeclareWarning.java
+++ b/tests/new/declare/DeclareWarning.java
@@ -69,8 +69,8 @@ aspect A {
declare warning: adviceexecution() && within(A)
: "adviceExecution() && within(A)";
- before() : initialization(DeclareWarning.new(..)) {
- // CW 74
+ before() : initialization(DeclareWarning.new(..)) { // CW 72
+
long l = System.currentTimeMillis();
if (0l == l) {
throw new Error("never thrown");
diff --git a/tests/new/options11/aspectlib1.jar b/tests/new/options11/aspectlib1.jar
index fbe0d3610..722c97ff3 100644
--- a/tests/new/options11/aspectlib1.jar
+++ b/tests/new/options11/aspectlib1.jar
Binary files differ
diff --git a/tests/new/options11/aspectlib2.jar b/tests/new/options11/aspectlib2.jar
index 05e82c363..22647696d 100644
--- a/tests/new/options11/aspectlib2.jar
+++ b/tests/new/options11/aspectlib2.jar
Binary files differ
diff --git a/tests/new/options11/injar.jar b/tests/new/options11/injar.jar
index d4ac54e79..7acf3a083 100644
--- a/tests/new/options11/injar.jar
+++ b/tests/new/options11/injar.jar
Binary files differ
diff --git a/tests/src/org/aspectj/systemtest/ajc10x/ajc10x-tests.xml b/tests/src/org/aspectj/systemtest/ajc10x/ajc10x-tests.xml
index 9e04c610e..0c085c7f0 100644
--- a/tests/src/org/aspectj/systemtest/ajc10x/ajc10x-tests.xml
+++ b/tests/src/org/aspectj/systemtest/ajc10x/ajc10x-tests.xml
@@ -1860,7 +1860,7 @@
<ajc-test dir="new" title="simple declare warning (NPE)"
keywords="from-resolved_105">
<compile files="DeclareWarningMain.java">
- <message kind="warning" line="5"/>
+ <message kind="warning" line="4"/>
</compile>
<run class="DeclareWarningMain"/>
</ajc-test>
diff --git a/tests/src/org/aspectj/systemtest/ajc11/ajc11-tests.xml b/tests/src/org/aspectj/systemtest/ajc11/ajc11-tests.xml
index 95fe34a0b..37bab3371 100644
--- a/tests/src/org/aspectj/systemtest/ajc11/ajc11-tests.xml
+++ b/tests/src/org/aspectj/systemtest/ajc11/ajc11-tests.xml
@@ -237,7 +237,7 @@
<ajc-test dir="new" pr="838"
title="checking around join point for advice return type - numeric">
<compile files="AroundNumericCastCE.java">
- <message kind="error" line="12"/>
+ <message kind="error" line="11"/>
<message kind="error" line="17"/>
</compile>
</ajc-test>
@@ -406,7 +406,7 @@
<message kind="warning" line="33" text="handler(OutOfMemoryError) &amp;&amp; within(DeclareWarning)"/>
<message kind="warning" line="36" text="handler(Error)"/>
<message kind="warning" line="39" text="handler(RuntimeException) &amp;&amp; withincode(DeclareWarning.new())"/>
- <message kind="warning" line="74" text="adviceExecution() &amp;&amp; within(A)"/>
+ <message kind="warning" line="72" text="adviceExecution() &amp;&amp; within(A)"/>
</compile>
</ajc-test>
diff --git a/tests/src/org/aspectj/systemtest/incremental/IncrementalTests.java b/tests/src/org/aspectj/systemtest/incremental/IncrementalTests.java
index 0cd0d6db3..aa34783b9 100644
--- a/tests/src/org/aspectj/systemtest/incremental/IncrementalTests.java
+++ b/tests/src/org/aspectj/systemtest/incremental/IncrementalTests.java
@@ -132,7 +132,7 @@ public class IncrementalTests extends org.aspectj.testing.XMLBasedAjcTestCase {
public void test012() throws Exception {
runTest("incremental with aspect-driven full rebuild");
nextIncrement(false);
- MessageSpec messageSpec = new MessageSpec(newMessageList(new Message(4,"Main.java",null,null)),null);
+ MessageSpec messageSpec = new MessageSpec(newMessageList(new Message(3,"Main.java",null,null)),null);
copyFileAndDoIncrementalBuild("changes/Aspect.20.java","src/Aspect.java",messageSpec);
run("Main");
}
diff --git a/tests/src/org/aspectj/systemtest/incremental/incremental-junit-tests.xml b/tests/src/org/aspectj/systemtest/incremental/incremental-junit-tests.xml
index d24c5428b..b3fb62d8b 100644
--- a/tests/src/org/aspectj/systemtest/incremental/incremental-junit-tests.xml
+++ b/tests/src/org/aspectj/systemtest/incremental/incremental-junit-tests.xml
@@ -189,7 +189,7 @@
</compile>
<!--
<inc-compile tag="20">
- <message kind="warning" line="4" file="Main.java"/>
+ <message kind="warning" line="3" file="Main.java"/>
</inc-compile>
<run class="Main"/>
-->
diff --git a/tests/src/org/aspectj/systemtest/incremental/incremental-tests.xml b/tests/src/org/aspectj/systemtest/incremental/incremental-tests.xml
index 24b7a234a..532b22398 100644
--- a/tests/src/org/aspectj/systemtest/incremental/incremental-tests.xml
+++ b/tests/src/org/aspectj/systemtest/incremental/incremental-tests.xml
@@ -176,7 +176,7 @@
<message kind="error" line="3" file="Aspect.java"/>
</compile>
<inc-compile tag="20">
- <message kind="warning" line="4" file="Main.java"/>
+ <message kind="warning" line="3" file="Main.java"/>
</inc-compile>
<run class="Main"/>
</ajc-test>
diff --git a/tests/src/org/aspectj/systemtest/pre10x/pre10x-tests.xml b/tests/src/org/aspectj/systemtest/pre10x/pre10x-tests.xml
index 90a1de463..d96bc3e4b 100644
--- a/tests/src/org/aspectj/systemtest/pre10x/pre10x-tests.xml
+++ b/tests/src/org/aspectj/systemtest/pre10x/pre10x-tests.xml
@@ -128,7 +128,8 @@
title="decent errors for around return type not matching target point"
keywords="from-errors">
<compile files="AroundReturnType.java">
- <message kind="error" line="3"/>
+ <message kind="error" line="2"/>
+ <message kind="error" line="6"/>
<message kind="error" line="7"/>
<message kind="error" line="16"/>
<message kind="error" line="21"/>