summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tests/ajcTests.xml171
-rw-r--r--tests/bugs/serialVersionUID/AfterReturningStaticinitializationAdvice.aj9
-rw-r--r--tests/bugs/serialVersionUID/AroundClosureExecutionAdvice.aj22
-rw-r--r--tests/bugs/serialVersionUID/AroundExecutionAdvice.aj14
-rw-r--r--tests/bugs/serialVersionUID/BeforeExecutionAdvice.aj9
-rw-r--r--tests/bugs/serialVersionUID/ClinitTest.java16
-rw-r--r--tests/bugs/serialVersionUID/DeclareExtends.aj5
-rw-r--r--tests/bugs/serialVersionUID/DeclareImplements.aj5
-rw-r--r--tests/bugs/serialVersionUID/DeclareImplementsSerializable.aj7
-rw-r--r--tests/bugs/serialVersionUID/ITDField.aj5
-rw-r--r--tests/bugs/serialVersionUID/ITDField.classbin0 -> 1705 bytes
-rw-r--r--tests/bugs/serialVersionUID/ITDMethod.aj7
-rw-r--r--tests/bugs/serialVersionUID/NonSerializableTest.java14
-rw-r--r--tests/bugs/serialVersionUID/PerThisAspect$ajcMightHaveAspect.classbin0 -> 247 bytes
-rw-r--r--tests/bugs/serialVersionUID/PerThisAspect.aj10
-rw-r--r--tests/bugs/serialVersionUID/PerThisAspect.classbin0 -> 2181 bytes
-rw-r--r--tests/bugs/serialVersionUID/PrivilegedAspect.aj13
-rw-r--r--tests/bugs/serialVersionUID/SuidTest.java16
-rw-r--r--tests/bugs/serialVersionUID/TJP.aj34
-rw-r--r--tests/bugs/serialVersionUID/Test.classbin0 -> 1068 bytes
-rw-r--r--tests/bugs/serialVersionUID/Test.java17
-rw-r--r--tests/bugs/serialVersionUID/Util.classbin0 -> 2609 bytes
-rw-r--r--tests/bugs/serialVersionUID/Util.java74
-rw-r--r--tests/bugs/serialVersionUID/Xlint.properties2
-rw-r--r--tests/bugs/serialVersionUID/injar.jarbin0 -> 2099 bytes
-rw-r--r--weaver/testdata/StaticEnclosingTjpBeforeHelloWorld.txt4
-rw-r--r--weaver/testdata/StaticTjpBeforeHelloWorld.txt8
-rw-r--r--weaver/testdata/TjpAround2HelloWorld.txt8
-rw-r--r--weaver/testdata/TjpAroundHelloWorld.txt8
-rw-r--r--weaver/testdata/TjpBeforeHelloWorld.txt8
-rw-r--r--weaver/testdata/TraceJarHello.txt20
-rw-r--r--weaver/testdata/dummyAspect.jarbin594 -> 613 bytes
-rw-r--r--weaver/testdata/megatrace.jarbin4933 -> 3777 bytes
-rw-r--r--weaver/testdata/megatrace0easy.jarbin2895 -> 3039 bytes
-rw-r--r--weaver/testdata/megatrace0hard.jarbin2795 -> 2940 bytes
-rw-r--r--weaver/testdata/megatraceNoweave.jarbin2734 -> 2832 bytes
-rw-r--r--weaver/testdata/tracing.jarbin2301 -> 2406 bytes
-rw-r--r--weaver/testsrc/org/aspectj/weaver/bcel/MoveInstructionsWeaveTestCase.java6
-rw-r--r--weaver/testsrc/org/aspectj/weaver/bcel/WeaveTestCase.java2
39 files changed, 479 insertions, 35 deletions
diff --git a/tests/ajcTests.xml b/tests/ajcTests.xml
index 06585a262..a3050d48b 100644
--- a/tests/ajcTests.xml
+++ b/tests/ajcTests.xml
@@ -5493,6 +5493,7 @@
<compile files="DeclareSoftCf.java" options="-Xlint:warning">
<message kind="warning" line="28"/>
<message kind="error" line="29"/>
+ <message kind="warning"/>
</compile>
</ajc-test>
@@ -7235,6 +7236,168 @@
</compile>
</ajc-test>
+
+ <ajc-test dir="bugs/serialVersionUID"
+ title="SUID: Before execution advice" pr="41181">
+ <compile files="Test.java, Util.java"/>
+ <run class="Test"/>
+ <compile files="Test.java, Util.java, BeforeExecutionAdvice.aj" options="-Xlint:warning"/>
+ <run class="Util"/>
+ </ajc-test>
+
+ <ajc-test dir="bugs/serialVersionUID"
+ title="SUID: Around execution advice" comment="OK because around_body private" pr="41181">
+ <compile files="Test.java, Util.java"/>
+ <run class="Test"/>
+ <compile files="Test.java, Util.java, AroundExecutionAdvice.aj" options="-Xlint:warning"/>
+ <run class="Util"/>
+ </ajc-test>
+
+ <ajc-test dir="bugs/serialVersionUID"
+ title="SUID: Around closure execution advice (-Xlint:ignore)" comment="OK because ignoring warnings"
+ pr="41181">
+ <compile files="Test.java, Util.java"/>
+ <run class="Test"/>
+ <compile files="Test.java, Util.java, AroundClosureExecutionAdvice.aj" options="-Xlint:ignore"/>
+ <run class="Util" options="-fail"/>
+ </ajc-test>
+
+ <ajc-test dir="bugs/serialVersionUID"
+ title="SUID: Around closure execution advice" comment="Warning because around_body non-private"
+ pr="41181">
+ <compile files="Test.java, Util.java"/>
+ <run class="Test"/>
+ <compile files="Test.java, Util.java, AroundClosureExecutionAdvice.aj"
+ xlintfile="Xlint.properties">
+ <message kind="warning" line="9"/>
+ </compile>
+ <run class="Util" options="-fail"/>
+ </ajc-test>
+
+ <ajc-test dir="bugs/serialVersionUID"
+ title="SUID: thisJoinPoint" comment="Warning because of introduced clinit" pr="41181">
+ <compile files="Test.java, Util.java"/>
+ <run class="Test"/>
+ <compile
+ files="Test.java, Util.java, TJP.aj" options="-Xlint:warning">
+ <message kind="warning" line="6"/>
+ <message kind="warning" line="13"/>
+ <message kind="warning" line="17"/>
+ <message kind="warning" line="24"/>
+ <message kind="warning" line="31"/>
+ </compile>
+ <run class="Util" options="-fail"/>
+ </ajc-test>
+
+ <ajc-test dir="bugs/serialVersionUID"
+ title="SUID: thisJoinPoint with clinit method" comment="OK if tjp private and existing clinit"
+ pr="41181">
+ <compile files="ClinitTest.java, Util.java"/>
+ <run class="ClinitTest"/>
+ <compile files="ClinitTest.java, Util.java, TJP.aj" options="-Xlint:warning"/>
+ <run class="Util" options="-read"/>
+ </ajc-test>
+
+ <ajc-test dir="bugs/serialVersionUID"
+ title="SUID: After returning staticinitialization advice" comment="Warning because of added clinit"
+ pr="41181">
+ <compile files="Test.java, Util.java"/>
+ <run class="Test"/>
+ <compile
+ files="Test.java, Util.java, AfterReturningStaticinitializationAdvice.aj" options="-Xlint:warning">
+ <message kind="warning" line="6"/>
+ </compile>
+ <run class="Util" options="-fail"/>
+ </ajc-test>
+
+ <ajc-test dir="bugs/serialVersionUID"
+ title="SUID: After returning staticinitialization advice with serialVersionUID field"
+ comment="OK because of serialVersionUID field" pr="41181">
+ <compile files="SuidTest.java, Util.java" />
+ <run class="SuidTest"/>
+ <compile files="SuidTest.java, Util.java, AfterReturningStaticinitializationAdvice.aj" options="-Xlint:warning"/>
+ <run class="Util"/>
+ </ajc-test>
+
+ <ajc-test dir="bugs/serialVersionUID"
+ title="SUID: ITD field" comment="Error because added field may not be initialized" pr="41181">
+ <compile files="Test.java, Util.java"/>
+ <run class="Test"/>
+ <compile files="Test.java, Util.java, ITDField.aj" options="-Xlint:error">
+ <message kind="error" line="0"/>
+ </compile>
+ </ajc-test>
+
+ <ajc-test dir="bugs/serialVersionUID"
+ title="SUID: ITD method" comment="Warning because of added method" pr="41181">
+ <compile files="Test.java, Util.java" />
+ <run class="Test"/>
+ <compile files="Test.java, Util.java, ITDMethod.aj" options="-Xlint:warning">
+ <message kind="warning" line="3"/>
+ </compile>
+ <run class="Util" options="-fail"/>
+ </ajc-test>
+
+ <ajc-test dir="bugs/serialVersionUID"
+ title="SUID: Declare extends" comment="OK" pr="41181">
+ <compile files="Test.java, Util.java" />
+ <run class="Test"/>
+ <compile files="Test.java, Util.java, DeclareExtends.aj" options="-Xlint:warning"/>
+ <run class="Util"/>
+ </ajc-test>
+
+ <ajc-test dir="bugs/serialVersionUID"
+ title="SUID: Declare implements (compile)" comment="Warning because of added interface" pr="41181">
+ <compile files="Test.java, Util.java" />
+ <run class="Test"/>
+ <compile files="Test.java, Util.java, DeclareImplements.aj" options="-Xlint:warning">
+ <message kind="warning"/>
+ </compile>
+ <run class="Util" options="-fail"/>
+ </ajc-test>
+
+ <ajc-test dir="bugs/serialVersionUID"
+ title="SUID: Declare implements non-Serializable (compile)" comment="OK because not Serializable"
+ pr="41181">
+ <compile files="NonSerializableTest.java, DeclareImplements.aj" options="-Xlint:warning"/>
+ </ajc-test>
+
+ <ajc-test dir="bugs/serialVersionUID"
+ title="SUID: Declare implements Serializable (compile)" comment="OK because adding Serializable"
+ pr="41181">
+ <compile files="NonSerializableTest.java, DeclareImplementsSerializable.aj" options="-Xlint:warning"/>
+ </ajc-test>
+
+ <ajc-test dir="bugs/serialVersionUID"
+ title="SUID: Declare implements (weave)" comment="Warning because of added interface" pr="41181">
+ <compile files="Test.java, Util.java" />
+ <run class="Test"/>
+ <compile files="injar.jar, DeclareImplements.aj" options="-Xlint:warning">
+ <message kind="warning" line="0"/>
+ </compile>
+ <run class="Util" options="-fail"/>
+ </ajc-test>
+
+ <ajc-test dir="bugs/serialVersionUID" title="SUID: Priviliged aspect" pr="41181">
+ <compile files="Test.java, Util.java"/>
+ <run class="Test"/>
+ <compile files="Test.java, Util.java, PrivilegedAspect.aj" options="-Xlint:warning">
+ <message kind="warning" line="1"/>
+ </compile>
+ <run class="Util" options="-fail"/>
+ </ajc-test>
+
+ <ajc-test dir="bugs/serialVersionUID"
+ title="SUID: Perthis aspect"
+ comment="Warning because added of added interface MightHaveAspect. Added field is private transient"
+ pr="41181">
+ <compile files="Test.java, Util.java" />
+ <run class="Test"/>
+ <compile files="Test.java, Util.java, PerThisAspect.aj" options="-Xlint:warning">
+ <message kind="warning" line="0"/>
+ </compile>
+ <run class="Util" options="-fail"/>
+ </ajc-test>
<ajc-test dir="bugs/fieldsOnInterfaces"
pr="52107"
@@ -7267,8 +7430,8 @@
title="fail in compiling aspect with overriding method introduction with different throws clause ">
<compile files="IntertypeDifferentThrows.java" />
</ajc-test>
-
- <ajc-test dir="new"
+
+ <ajc-test dir="new"
comment="in ajc 1.1.1, VerifyError Illegal use of nonvirtual function call"
title="super call in anonymous class created in around advice">
<compile files="SuperClosure.java" />
@@ -7303,8 +7466,8 @@
<message kind="error" line="6"/>
</compile>
</ajc-test>
-
- <ajc-test dir="bugs" pr="51322"
+
+ <ajc-test dir="bugs" pr="51322"
title="Introduce Unknown Type to class causes Null pointer exception" >
<compile files="Pr51322.java">
<message kind="error" line="5"/>
diff --git a/tests/bugs/serialVersionUID/AfterReturningStaticinitializationAdvice.aj b/tests/bugs/serialVersionUID/AfterReturningStaticinitializationAdvice.aj
new file mode 100644
index 000000000..0415a4b20
--- /dev/null
+++ b/tests/bugs/serialVersionUID/AfterReturningStaticinitializationAdvice.aj
@@ -0,0 +1,9 @@
+public aspect AfterReturningStaticinitializationAdvice {
+
+ pointcut staticInit () :
+ staticinitialization(*Test);
+
+ after () returning : staticInit() {
+ System.out.println("? AfterReturningStaticinitializationAdvice.staticInit()");
+ }
+}
diff --git a/tests/bugs/serialVersionUID/AroundClosureExecutionAdvice.aj b/tests/bugs/serialVersionUID/AroundClosureExecutionAdvice.aj
new file mode 100644
index 000000000..43211d6ec
--- /dev/null
+++ b/tests/bugs/serialVersionUID/AroundClosureExecutionAdvice.aj
@@ -0,0 +1,22 @@
+import java.io.InvalidClassException;
+import org.aspectj.testing.Tester;
+
+public aspect AroundClosureExecutionAdvice {
+
+ pointcut run () :
+ execution(public void run());
+
+ void around () : run () {
+ Runnable runnable = new Runnable() {
+ public void run () {
+ System.out.println("> AroundClosureExecutionAdvice.run()");
+
+ proceed();
+
+ System.out.println("< AroundClosureExecutionAdvice.run()");
+ }
+ };
+ runnable.run();
+ }
+
+}
diff --git a/tests/bugs/serialVersionUID/AroundExecutionAdvice.aj b/tests/bugs/serialVersionUID/AroundExecutionAdvice.aj
new file mode 100644
index 000000000..6da62e42a
--- /dev/null
+++ b/tests/bugs/serialVersionUID/AroundExecutionAdvice.aj
@@ -0,0 +1,14 @@
+public aspect AroundExecutionAdvice {
+
+ pointcut run () :
+ execution(public void run());
+
+ void around () : run () {
+ System.out.println("> AroundExecutionAdvice.run()");
+
+ proceed();
+
+ System.out.println("< AroundExecutionAdvice.run()");
+ }
+
+}
diff --git a/tests/bugs/serialVersionUID/BeforeExecutionAdvice.aj b/tests/bugs/serialVersionUID/BeforeExecutionAdvice.aj
new file mode 100644
index 000000000..109cddc37
--- /dev/null
+++ b/tests/bugs/serialVersionUID/BeforeExecutionAdvice.aj
@@ -0,0 +1,9 @@
+public aspect BeforeExecutionAdvice {
+
+ pointcut run (Test test) :
+ execution(public void run()) && this(test);
+
+ before (Test test) : run (test) {
+ System.out.println("? BeforeExecutionAdvice.run() test=" + test);
+ }
+} \ No newline at end of file
diff --git a/tests/bugs/serialVersionUID/ClinitTest.java b/tests/bugs/serialVersionUID/ClinitTest.java
new file mode 100644
index 000000000..367f35b51
--- /dev/null
+++ b/tests/bugs/serialVersionUID/ClinitTest.java
@@ -0,0 +1,16 @@
+import java.io.Serializable;
+
+public class ClinitTest implements Serializable {
+
+ private int i;
+ private static boolean b = true;
+
+ public void run () {
+ System.out.println("? Clinit.run()");
+ }
+
+ public static void main(String[] args) throws Exception {
+ ClinitTest test = new ClinitTest();
+ Util.write(Util.DEFAULT_NAME,test);
+ }
+} \ No newline at end of file
diff --git a/tests/bugs/serialVersionUID/DeclareExtends.aj b/tests/bugs/serialVersionUID/DeclareExtends.aj
new file mode 100644
index 000000000..e2114ed1a
--- /dev/null
+++ b/tests/bugs/serialVersionUID/DeclareExtends.aj
@@ -0,0 +1,5 @@
+public aspect DeclareExtends {
+
+ declare parents : Test extends Thread;
+
+}
diff --git a/tests/bugs/serialVersionUID/DeclareImplements.aj b/tests/bugs/serialVersionUID/DeclareImplements.aj
new file mode 100644
index 000000000..9f311793f
--- /dev/null
+++ b/tests/bugs/serialVersionUID/DeclareImplements.aj
@@ -0,0 +1,5 @@
+public aspect DeclareImplements {
+
+ declare parents : *Test implements Runnable;
+
+}
diff --git a/tests/bugs/serialVersionUID/DeclareImplementsSerializable.aj b/tests/bugs/serialVersionUID/DeclareImplementsSerializable.aj
new file mode 100644
index 000000000..7c0daa130
--- /dev/null
+++ b/tests/bugs/serialVersionUID/DeclareImplementsSerializable.aj
@@ -0,0 +1,7 @@
+import java.io.Serializable;
+
+public aspect DeclareImplementsSerializable {
+
+ declare parents : NonSerializableTest implements Serializable;
+
+}
diff --git a/tests/bugs/serialVersionUID/ITDField.aj b/tests/bugs/serialVersionUID/ITDField.aj
new file mode 100644
index 000000000..26d4e52a0
--- /dev/null
+++ b/tests/bugs/serialVersionUID/ITDField.aj
@@ -0,0 +1,5 @@
+public aspect ITDField {
+
+ private long Test.longField = 999999999L;
+
+}
diff --git a/tests/bugs/serialVersionUID/ITDField.class b/tests/bugs/serialVersionUID/ITDField.class
new file mode 100644
index 000000000..9904cf76e
--- /dev/null
+++ b/tests/bugs/serialVersionUID/ITDField.class
Binary files differ
diff --git a/tests/bugs/serialVersionUID/ITDMethod.aj b/tests/bugs/serialVersionUID/ITDMethod.aj
new file mode 100644
index 000000000..a7a635a1f
--- /dev/null
+++ b/tests/bugs/serialVersionUID/ITDMethod.aj
@@ -0,0 +1,7 @@
+public aspect ITDMethod {
+
+ private void Test.voidMethod () {
+ System.out.println("? ITDMethod.voidMethod()");
+ }
+
+}
diff --git a/tests/bugs/serialVersionUID/NonSerializableTest.java b/tests/bugs/serialVersionUID/NonSerializableTest.java
new file mode 100644
index 000000000..b321495f2
--- /dev/null
+++ b/tests/bugs/serialVersionUID/NonSerializableTest.java
@@ -0,0 +1,14 @@
+public class NonSerializableTest {
+
+ private int i;
+
+ public void run () {
+ System.out.println("NonSerializableTest.run()");
+ i++;
+ }
+
+ public static void main (String[] args) throws Exception {
+ NonSerializableTest test = new NonSerializableTest();
+ test.run();
+ }
+} \ No newline at end of file
diff --git a/tests/bugs/serialVersionUID/PerThisAspect$ajcMightHaveAspect.class b/tests/bugs/serialVersionUID/PerThisAspect$ajcMightHaveAspect.class
new file mode 100644
index 000000000..df5dc53f0
--- /dev/null
+++ b/tests/bugs/serialVersionUID/PerThisAspect$ajcMightHaveAspect.class
Binary files differ
diff --git a/tests/bugs/serialVersionUID/PerThisAspect.aj b/tests/bugs/serialVersionUID/PerThisAspect.aj
new file mode 100644
index 000000000..df31e0253
--- /dev/null
+++ b/tests/bugs/serialVersionUID/PerThisAspect.aj
@@ -0,0 +1,10 @@
+public aspect PerThisAspect perthis(this(Test)) {
+
+ pointcut run (Test test) :
+ execution(public void run()) && this(test);
+
+ before (Test test) : run (test) {
+ System.out.println("? PerThisAspect.run() test=" + test + " this=" + this);
+ }
+
+}
diff --git a/tests/bugs/serialVersionUID/PerThisAspect.class b/tests/bugs/serialVersionUID/PerThisAspect.class
new file mode 100644
index 000000000..906edd329
--- /dev/null
+++ b/tests/bugs/serialVersionUID/PerThisAspect.class
Binary files differ
diff --git a/tests/bugs/serialVersionUID/PrivilegedAspect.aj b/tests/bugs/serialVersionUID/PrivilegedAspect.aj
new file mode 100644
index 000000000..0a959f7e6
--- /dev/null
+++ b/tests/bugs/serialVersionUID/PrivilegedAspect.aj
@@ -0,0 +1,13 @@
+import java.io.InvalidClassException;
+import org.aspectj.testing.Tester;
+
+public privileged aspect PrivilegedAspect {
+
+ pointcut run (Test test) :
+ execution(public void run()) && this(test);
+
+ before (Test test) : run (test) {
+ System.out.println("? PrivilegedAspect.run() i=" + test.i);
+ }
+
+}
diff --git a/tests/bugs/serialVersionUID/SuidTest.java b/tests/bugs/serialVersionUID/SuidTest.java
new file mode 100644
index 000000000..9e93283ed
--- /dev/null
+++ b/tests/bugs/serialVersionUID/SuidTest.java
@@ -0,0 +1,16 @@
+import java.io.Serializable;
+
+public class SuidTest implements Serializable {
+
+ static final long serialVersionUID = 8904684881596717140L;
+ private int i;
+
+ public void run () {
+ System.out.println("? SuidTest.run()");
+ }
+
+ public static void main(String[] args) throws Exception {
+ SuidTest test = new SuidTest();
+ Util.write(Util.DEFAULT_NAME,test);
+ }
+} \ No newline at end of file
diff --git a/tests/bugs/serialVersionUID/TJP.aj b/tests/bugs/serialVersionUID/TJP.aj
new file mode 100644
index 000000000..585426042
--- /dev/null
+++ b/tests/bugs/serialVersionUID/TJP.aj
@@ -0,0 +1,34 @@
+public aspect TJP {
+
+ pointcut run () :
+ execution(public void *.run());
+
+ before () : run () {
+ System.out.println("? TJP.execRun() thisJoinPointStaticPart=" + thisJoinPointStaticPart);
+ }
+
+ pointcut write () :
+ call(public void *.run());
+
+ before () : write () {
+ System.out.println("? TJP.callRun() thisJoinPointStaticPart=" + thisJoinPointStaticPart);
+ }
+
+ before () : write () {
+ System.out.println("? TJP.callRun() thisEnclosingJoinPointStaticPart=" + thisEnclosingJoinPointStaticPart);
+ }
+
+ pointcut getI () :
+ get(int i);
+
+ before () : getI () {
+ System.out.println("? TJP.getI() thisJoinPoint=" + thisJoinPoint);
+ }
+
+ pointcut setI () :
+ set(int i);
+
+ before () : setI () {
+ System.out.println("? TJP.setI() thisJoinPoint=" + thisJoinPoint);
+ }
+} \ No newline at end of file
diff --git a/tests/bugs/serialVersionUID/Test.class b/tests/bugs/serialVersionUID/Test.class
new file mode 100644
index 000000000..6b4e2fea1
--- /dev/null
+++ b/tests/bugs/serialVersionUID/Test.class
Binary files differ
diff --git a/tests/bugs/serialVersionUID/Test.java b/tests/bugs/serialVersionUID/Test.java
new file mode 100644
index 000000000..2e267b3b3
--- /dev/null
+++ b/tests/bugs/serialVersionUID/Test.java
@@ -0,0 +1,17 @@
+import java.io.Serializable;
+
+public class Test implements Serializable {
+
+ private int i;
+
+ public void run () {
+ System.out.println("Test.run()");
+ i++;
+ }
+
+ public static void main (String[] args) throws Exception {
+ Test test = new Test();
+ test.run();
+ Util.write(Util.DEFAULT_NAME,test);
+ }
+}
diff --git a/tests/bugs/serialVersionUID/Util.class b/tests/bugs/serialVersionUID/Util.class
new file mode 100644
index 000000000..c9ff29160
--- /dev/null
+++ b/tests/bugs/serialVersionUID/Util.class
Binary files differ
diff --git a/tests/bugs/serialVersionUID/Util.java b/tests/bugs/serialVersionUID/Util.java
new file mode 100644
index 000000000..ec98bd149
--- /dev/null
+++ b/tests/bugs/serialVersionUID/Util.java
@@ -0,0 +1,74 @@
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.InvalidClassException;
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.io.ObjectStreamClass;
+//import java.util.Arrays;
+//import java.util.List;
+
+import org.aspectj.testing.Tester;
+
+public class Util {
+
+ public final static String DEFAULT_COMMAND = "-read";
+ public final static String DEFAULT_NAME = "test.ser";
+
+ public static void fail (String name) throws Exception {
+ try {
+ Object obj = read(name);
+ Tester.checkFailed("java.io.InvalidClassException");
+ }
+ catch (InvalidClassException ex) {
+ System.out.println("? Util.fail() ex=" + ex);
+ }
+ }
+
+ public static Object read (String name) throws Exception {
+ Object obj;
+ File file = new File(name);
+ file.deleteOnExit();
+ ObjectInputStream in = null;
+
+ try {
+ in = new ObjectInputStream(new FileInputStream(file));
+ obj = in.readObject();
+ System.out.println("? Util.read() obj=" + obj);
+ }
+ finally {
+ in.close();
+ }
+
+ return obj;
+ }
+
+ public static void write (String name, Object obj) throws IOException {
+
+ File file = new File(name);
+// File file = File.createTempFile(name,null);
+ ObjectOutputStream out = new ObjectOutputStream(new FileOutputStream(file));
+ out.writeObject(obj);
+ out.close();
+
+ System.out.println("? Util.write() suid=" + ObjectStreamClass.lookup(obj.getClass()));
+ }
+
+ public static void main (String[] args) throws Exception {
+ String command = (args.length > 0)? args[0] : DEFAULT_COMMAND;
+ String name = (args.length > 1)? args[1] : DEFAULT_NAME;
+
+ if (command.equals("-read")) {
+ Object obj = read(name);
+ }
+ else if (command.equals("-fail")) {
+ fail(name);
+ }
+// if (args.length > 0) {
+// }
+// else {
+// System.out.println("Usage: Util -fail | -read [name]");
+// }
+ }
+}
diff --git a/tests/bugs/serialVersionUID/Xlint.properties b/tests/bugs/serialVersionUID/Xlint.properties
new file mode 100644
index 000000000..79715ef12
--- /dev/null
+++ b/tests/bugs/serialVersionUID/Xlint.properties
@@ -0,0 +1,2 @@
+shadowNotInStructure = ignore
+needsSerialVersionUIDField = warning
diff --git a/tests/bugs/serialVersionUID/injar.jar b/tests/bugs/serialVersionUID/injar.jar
new file mode 100644
index 000000000..7a8996bb2
--- /dev/null
+++ b/tests/bugs/serialVersionUID/injar.jar
Binary files differ
diff --git a/weaver/testdata/StaticEnclosingTjpBeforeHelloWorld.txt b/weaver/testdata/StaticEnclosingTjpBeforeHelloWorld.txt
index 985dca28a..da186fc4f 100644
--- a/weaver/testdata/StaticEnclosingTjpBeforeHelloWorld.txt
+++ b/weaver/testdata/StaticEnclosingTjpBeforeHelloWorld.txt
@@ -1,6 +1,6 @@
public class HelloWorld extends java.lang.Object:
- public static final org.aspectj.lang.JoinPoint$StaticPart ajc$tjp_0
- public static final org.aspectj.lang.JoinPoint$StaticPart ajc$tjp_1
+ private static final org.aspectj.lang.JoinPoint$StaticPart ajc$tjp_0
+ private static final org.aspectj.lang.JoinPoint$StaticPart ajc$tjp_1
public void <init>():
ALOAD_0 // HelloWorld this (line 5)
INVOKESPECIAL java.lang.Object.<init> ()V
diff --git a/weaver/testdata/StaticTjpBeforeHelloWorld.txt b/weaver/testdata/StaticTjpBeforeHelloWorld.txt
index 70ad24125..84bc0a284 100644
--- a/weaver/testdata/StaticTjpBeforeHelloWorld.txt
+++ b/weaver/testdata/StaticTjpBeforeHelloWorld.txt
@@ -1,8 +1,8 @@
public class HelloWorld extends java.lang.Object:
- public static final org.aspectj.lang.JoinPoint$StaticPart ajc$tjp_0
- public static final org.aspectj.lang.JoinPoint$StaticPart ajc$tjp_1
- public static final org.aspectj.lang.JoinPoint$StaticPart ajc$tjp_2
- public static final org.aspectj.lang.JoinPoint$StaticPart ajc$tjp_3
+ private static final org.aspectj.lang.JoinPoint$StaticPart ajc$tjp_0
+ private static final org.aspectj.lang.JoinPoint$StaticPart ajc$tjp_1
+ private static final org.aspectj.lang.JoinPoint$StaticPart ajc$tjp_2
+ private static final org.aspectj.lang.JoinPoint$StaticPart ajc$tjp_3
public void <init>():
ALOAD_0 // HelloWorld this (line 5)
INVOKESPECIAL java.lang.Object.<init> ()V
diff --git a/weaver/testdata/TjpAround2HelloWorld.txt b/weaver/testdata/TjpAround2HelloWorld.txt
index 3531db917..355f5cbbd 100644
--- a/weaver/testdata/TjpAround2HelloWorld.txt
+++ b/weaver/testdata/TjpAround2HelloWorld.txt
@@ -1,8 +1,8 @@
public class HelloWorld extends java.lang.Object:
- public static final org.aspectj.lang.JoinPoint$StaticPart ajc$tjp_0
- public static final org.aspectj.lang.JoinPoint$StaticPart ajc$tjp_1
- public static final org.aspectj.lang.JoinPoint$StaticPart ajc$tjp_2
- public static final org.aspectj.lang.JoinPoint$StaticPart ajc$tjp_3
+ private static final org.aspectj.lang.JoinPoint$StaticPart ajc$tjp_0
+ private static final org.aspectj.lang.JoinPoint$StaticPart ajc$tjp_1
+ private static final org.aspectj.lang.JoinPoint$StaticPart ajc$tjp_2
+ private static final org.aspectj.lang.JoinPoint$StaticPart ajc$tjp_3
public void <init>():
ALOAD_0 // HelloWorld this (line 5)
INVOKESPECIAL java.lang.Object.<init> ()V
diff --git a/weaver/testdata/TjpAroundHelloWorld.txt b/weaver/testdata/TjpAroundHelloWorld.txt
index 65ca8bc5e..6cb565f84 100644
--- a/weaver/testdata/TjpAroundHelloWorld.txt
+++ b/weaver/testdata/TjpAroundHelloWorld.txt
@@ -1,8 +1,8 @@
public class HelloWorld extends java.lang.Object:
- public static final org.aspectj.lang.JoinPoint$StaticPart ajc$tjp_0
- public static final org.aspectj.lang.JoinPoint$StaticPart ajc$tjp_1
- public static final org.aspectj.lang.JoinPoint$StaticPart ajc$tjp_2
- public static final org.aspectj.lang.JoinPoint$StaticPart ajc$tjp_3
+ private static final org.aspectj.lang.JoinPoint$StaticPart ajc$tjp_0
+ private static final org.aspectj.lang.JoinPoint$StaticPart ajc$tjp_1
+ private static final org.aspectj.lang.JoinPoint$StaticPart ajc$tjp_2
+ private static final org.aspectj.lang.JoinPoint$StaticPart ajc$tjp_3
public void <init>():
ALOAD_0 // HelloWorld this (line 5)
INVOKESPECIAL java.lang.Object.<init> ()V
diff --git a/weaver/testdata/TjpBeforeHelloWorld.txt b/weaver/testdata/TjpBeforeHelloWorld.txt
index ce462ec68..47fdec6bc 100644
--- a/weaver/testdata/TjpBeforeHelloWorld.txt
+++ b/weaver/testdata/TjpBeforeHelloWorld.txt
@@ -1,8 +1,8 @@
public class HelloWorld extends java.lang.Object:
- public static final org.aspectj.lang.JoinPoint$StaticPart ajc$tjp_0
- public static final org.aspectj.lang.JoinPoint$StaticPart ajc$tjp_1
- public static final org.aspectj.lang.JoinPoint$StaticPart ajc$tjp_2
- public static final org.aspectj.lang.JoinPoint$StaticPart ajc$tjp_3
+ private static final org.aspectj.lang.JoinPoint$StaticPart ajc$tjp_0
+ private static final org.aspectj.lang.JoinPoint$StaticPart ajc$tjp_1
+ private static final org.aspectj.lang.JoinPoint$StaticPart ajc$tjp_2
+ private static final org.aspectj.lang.JoinPoint$StaticPart ajc$tjp_3
public void <init>():
ALOAD_0 // HelloWorld this (line 5)
INVOKESPECIAL java.lang.Object.<init> ()V
diff --git a/weaver/testdata/TraceJarHello.txt b/weaver/testdata/TraceJarHello.txt
index 6be336249..f4e9cb084 100644
--- a/weaver/testdata/TraceJarHello.txt
+++ b/weaver/testdata/TraceJarHello.txt
@@ -44,7 +44,7 @@ public class DynamicHelloWorld extends java.lang.Object implements java.io.Seria
method-execution(java.lang.String DynamicHelloWorld.doit(java.lang.String, java.util.List))
| INVOKESTATIC MyTrace.aspectOf ()LMyTrace;
| ALOAD_0
- | INVOKEVIRTUAL Trace.ajc$before$Trace$51 (Ljava/lang/Object;)V
+ | INVOKEVIRTUAL Trace.ajc$before$Trace$1$26352be2 (Ljava/lang/Object;)V
| ALOAD_0
| ALOAD_3
| ALOAD 4
@@ -58,12 +58,12 @@ public class DynamicHelloWorld extends java.lang.Object implements java.io.Seria
| INVOKESTATIC MyTrace.aspectOf ()LMyTrace;
| ALOAD_0
| ALOAD 5
- | INVOKEVIRTUAL MyTrace.ajc$afterReturning$MyTrace$6e (Ljava/lang/Object;Ljava/lang/Object;)V
+ | INVOKEVIRTUAL MyTrace.ajc$afterReturning$MyTrace$1$2b31dfa3 (Ljava/lang/Object;Ljava/lang/Object;)V
| ARETURN
method-execution(java.lang.String DynamicHelloWorld.doit(java.lang.String, java.util.List))
end String doit(String, java.util.List)
- static final String doit_aroundBody0(DynamicHelloWorld, String, java.util.List):
+ private static final String doit_aroundBody0(DynamicHelloWorld, String, java.util.List):
ALOAD_2 (line 21)
ALOAD_1
INVOKEINTERFACE java.util.List.add (Ljava/lang/Object;)Z
@@ -71,9 +71,9 @@ public class DynamicHelloWorld extends java.lang.Object implements java.io.Seria
ALOAD_2 (line 22)
INVOKEVIRTUAL java.lang.Object.toString ()Ljava/lang/String;
ARETURN
- end static final String doit_aroundBody0(DynamicHelloWorld, String, java.util.List)
+ end private static final String doit_aroundBody0(DynamicHelloWorld, String, java.util.List)
- static final Object doit_aroundBody1$advice(DynamicHelloWorld, String, java.util.List, Trace, Object, org.aspectj.runtime.internal.AroundClosure):
+ private static final Object doit_aroundBody1$advice(DynamicHelloWorld, String, java.util.List, Trace, Object, org.aspectj.runtime.internal.AroundClosure):
GETSTATIC java.lang.System.out Ljava/io/PrintStream; (line 17)
NEW java.lang.StringBuffer
DUP
@@ -104,9 +104,9 @@ public class DynamicHelloWorld extends java.lang.Object implements java.io.Seria
INVOKEVIRTUAL java.io.PrintStream.println (Ljava/lang/String;)V
ALOAD 6 (line 20)
ARETURN
- end static final Object doit_aroundBody1$advice(DynamicHelloWorld, String, java.util.List, Trace, Object, org.aspectj.runtime.internal.AroundClosure)
+ end private static final Object doit_aroundBody1$advice(DynamicHelloWorld, String, java.util.List, Trace, Object, org.aspectj.runtime.internal.AroundClosure)
- static final String doit_aroundBody2(DynamicHelloWorld, String, java.util.List):
+ private static final String doit_aroundBody2(DynamicHelloWorld, String, java.util.List):
ALOAD_0
ALOAD_1
ALOAD_2
@@ -116,9 +116,9 @@ public class DynamicHelloWorld extends java.lang.Object implements java.io.Seria
INVOKESTATIC DynamicHelloWorld.doit_aroundBody1$advice (LDynamicHelloWorld;Ljava/lang/String;Ljava/util/List;LTrace;Ljava/lang/Object;Lorg/aspectj/runtime/internal/AroundClosure;)Ljava/lang/Object;
CHECKCAST java.lang.String
ARETURN
- end static final String doit_aroundBody2(DynamicHelloWorld, String, java.util.List)
+ end private static final String doit_aroundBody2(DynamicHelloWorld, String, java.util.List)
- static final Object doit_aroundBody3$advice(DynamicHelloWorld, String, java.util.List, Trace, org.aspectj.runtime.internal.AroundClosure):
+ private static final Object doit_aroundBody3$advice(DynamicHelloWorld, String, java.util.List, Trace, org.aspectj.runtime.internal.AroundClosure):
LDC "Hi" (line 9)
ASTORE 5
GETSTATIC java.lang.System.out Ljava/io/PrintStream; (line 10)
@@ -148,5 +148,5 @@ public class DynamicHelloWorld extends java.lang.Object implements java.io.Seria
INVOKEVIRTUAL java.io.PrintStream.println (Ljava/lang/String;)V
ALOAD 6 (line 13)
ARETURN
- end static final Object doit_aroundBody3$advice(DynamicHelloWorld, String, java.util.List, Trace, org.aspectj.runtime.internal.AroundClosure)
+ end private static final Object doit_aroundBody3$advice(DynamicHelloWorld, String, java.util.List, Trace, org.aspectj.runtime.internal.AroundClosure)
end public class DynamicHelloWorld
diff --git a/weaver/testdata/dummyAspect.jar b/weaver/testdata/dummyAspect.jar
index 032cf2662..321efc4e4 100644
--- a/weaver/testdata/dummyAspect.jar
+++ b/weaver/testdata/dummyAspect.jar
Binary files differ
diff --git a/weaver/testdata/megatrace.jar b/weaver/testdata/megatrace.jar
index daf8d6029..31c8d0dc2 100644
--- a/weaver/testdata/megatrace.jar
+++ b/weaver/testdata/megatrace.jar
Binary files differ
diff --git a/weaver/testdata/megatrace0easy.jar b/weaver/testdata/megatrace0easy.jar
index 2589a616a..a7499e84d 100644
--- a/weaver/testdata/megatrace0easy.jar
+++ b/weaver/testdata/megatrace0easy.jar
Binary files differ
diff --git a/weaver/testdata/megatrace0hard.jar b/weaver/testdata/megatrace0hard.jar
index 0d65a46b4..114217106 100644
--- a/weaver/testdata/megatrace0hard.jar
+++ b/weaver/testdata/megatrace0hard.jar
Binary files differ
diff --git a/weaver/testdata/megatraceNoweave.jar b/weaver/testdata/megatraceNoweave.jar
index f44894c27..f51ebb94f 100644
--- a/weaver/testdata/megatraceNoweave.jar
+++ b/weaver/testdata/megatraceNoweave.jar
Binary files differ
diff --git a/weaver/testdata/tracing.jar b/weaver/testdata/tracing.jar
index a72e3c5be..93f0d578a 100644
--- a/weaver/testdata/tracing.jar
+++ b/weaver/testdata/tracing.jar
Binary files differ
diff --git a/weaver/testsrc/org/aspectj/weaver/bcel/MoveInstructionsWeaveTestCase.java b/weaver/testsrc/org/aspectj/weaver/bcel/MoveInstructionsWeaveTestCase.java
index 4e51ed2ad..955a893cd 100644
--- a/weaver/testsrc/org/aspectj/weaver/bcel/MoveInstructionsWeaveTestCase.java
+++ b/weaver/testsrc/org/aspectj/weaver/bcel/MoveInstructionsWeaveTestCase.java
@@ -36,7 +36,9 @@ public class MoveInstructionsWeaveTestCase extends WeaveTestCase {
BcelShadow shadow = (BcelShadow) s;
LazyMethodGen newMethod =
shadow.extractMethod(
- shadow.getSignature().getExtractableName() + "_extracted");
+ shadow.getSignature().getExtractableName() + "_extracted",
+ 0,
+ this);
shadow.getRange().append(shadow.makeCallToCallback(newMethod));
if (!shadow.isFallsThrough()) {
@@ -58,7 +60,7 @@ public class MoveInstructionsWeaveTestCase extends WeaveTestCase {
}
public void implementOn(Shadow s) {
BcelShadow shadow = (BcelShadow) s;
- LazyMethodGen newMethod = shadow.extractMethod(shadow.getSignature().getExtractableName() + "_extracted" + counter++);
+ LazyMethodGen newMethod = shadow.extractMethod(shadow.getSignature().getExtractableName() + "_extracted" + counter++, 0, this);
shadow.getRange().append(shadow.makeCallToCallback(newMethod));
if (! shadow.isFallsThrough()) {
diff --git a/weaver/testsrc/org/aspectj/weaver/bcel/WeaveTestCase.java b/weaver/testsrc/org/aspectj/weaver/bcel/WeaveTestCase.java
index 9048a9afc..64171b9ac 100644
--- a/weaver/testsrc/org/aspectj/weaver/bcel/WeaveTestCase.java
+++ b/weaver/testsrc/org/aspectj/weaver/bcel/WeaveTestCase.java
@@ -154,7 +154,7 @@ public abstract class WeaveTestCase extends TestCase {
}
void realCheckClass(LazyClassGen gen, String outDir, String expectedFile) throws IOException {
- TestUtil.assertMultiLineStringEquals("classes",
+ TestUtil.assertMultiLineStringEquals(expectedFile/*"classes"*/,
FileUtil.readAsString(new File(TESTDATA_DIR, expectedFile)),
gen.toLongString());
}