diff options
-rw-r--r-- | tests/bugs152/pr144465/AnAspect.java | 5 | ||||
-rw-r--r-- | tests/bugs152/pr144465/BigHorribleClass.java | 28 | ||||
-rw-r--r-- | tests/bugs152/pr144465/aop1.xml | 8 | ||||
-rw-r--r-- | tests/src/org/aspectj/systemtest/ajc152/Ajc152Tests.java | 1 | ||||
-rw-r--r-- | tests/src/org/aspectj/systemtest/ajc152/ajc152.xml | 11 |
5 files changed, 53 insertions, 0 deletions
diff --git a/tests/bugs152/pr144465/AnAspect.java b/tests/bugs152/pr144465/AnAspect.java new file mode 100644 index 000000000..eff8137e8 --- /dev/null +++ b/tests/bugs152/pr144465/AnAspect.java @@ -0,0 +1,5 @@ +aspect AnAspect { + before(): staticinitialization(BigHorribleClass) { + + } +}
\ No newline at end of file diff --git a/tests/bugs152/pr144465/BigHorribleClass.java b/tests/bugs152/pr144465/BigHorribleClass.java new file mode 100644 index 000000000..7668307b2 --- /dev/null +++ b/tests/bugs152/pr144465/BigHorribleClass.java @@ -0,0 +1,28 @@ +import java.io.Serializable; +import java.lang.reflect.Field; + +public class BigHorribleClass implements Serializable,Comparable { + public static void main(String[] args) { + try { + BigHorribleClass b = (BigHorribleClass)BigHorribleClass.class.newInstance(); + Field f = BigHorribleClass.class.getDeclaredField("serialVersionUID"); + long l = f.getLong(b); + System.err.println("SerialVersionUID is "+l); + } catch (Exception e) { + System.err.println("Problem: "+e.toString()); + } + } + + public int anInt; + + public static boolean aBoolean = false; + + public long foo = 376; + + public void m() {} + public int compareTo(Object o) { return 0;} + public String m2(boolean b,long l, String s) { return "";} + + public static transient short fo2 = 3; + +}
\ No newline at end of file diff --git a/tests/bugs152/pr144465/aop1.xml b/tests/bugs152/pr144465/aop1.xml new file mode 100644 index 000000000..d429edb23 --- /dev/null +++ b/tests/bugs152/pr144465/aop1.xml @@ -0,0 +1,8 @@ +<aspectj> + <aspects> + <aspect name="AnAspect"/> + </aspects> + + <weaver options="-showWeaveInfo -XaddSerialVersionUID"> + </weaver> +</aspectj> diff --git a/tests/src/org/aspectj/systemtest/ajc152/Ajc152Tests.java b/tests/src/org/aspectj/systemtest/ajc152/Ajc152Tests.java index 67cb7c1db..7cb98a6ef 100644 --- a/tests/src/org/aspectj/systemtest/ajc152/Ajc152Tests.java +++ b/tests/src/org/aspectj/systemtest/ajc152/Ajc152Tests.java @@ -24,6 +24,7 @@ import org.aspectj.testing.XMLBasedAjcTestCase; public class Ajc152Tests extends org.aspectj.testing.XMLBasedAjcTestCase { + public void testLTWAndGeneratingSUID_pr144465() { runTest("ltw with serialversionUID creation"); } public void testAspects14PerSingleton_pr122253() { runTest("aspects14 - persingleton");} public void testAspects14PerCflow_pr122253() { runTest("aspects14 - percflow");} public void testAspects14PerThis_pr122253() { runTest("aspects14 - perthis");} diff --git a/tests/src/org/aspectj/systemtest/ajc152/ajc152.xml b/tests/src/org/aspectj/systemtest/ajc152/ajc152.xml index 5741576b1..03bbb19d6 100644 --- a/tests/src/org/aspectj/systemtest/ajc152/ajc152.xml +++ b/tests/src/org/aspectj/systemtest/ajc152/ajc152.xml @@ -339,6 +339,17 @@ </compile> </ajc-test> + <ajc-test dir="bugs152/pr144465" title="ltw with serialversionUID creation"> + <compile files="BigHorribleClass.java"/> + <compile files="AnAspect.java"/> + <run class="BigHorribleClass" ltw="aop1.xml"> + <stderr> + <line text="weaveinfo Join point 'staticinitialization(void BigHorribleClass.<clinit>())'"/> + <line text="SerialVersionUID is "/> + </stderr> + </run> + </ajc-test> + <ajc-test dir="bugs152/pr125480" title="aop.xml aspect inheriting abstract method "> <compile files="HelloWorld.java"/> <compile files="AbstractMethods.aj, ConcreteMethods.aj" options="-1.5"/> |