diff options
author | aclement <aclement> | 2006-06-08 08:27:34 +0000 |
---|---|---|
committer | aclement <aclement> | 2006-06-08 08:27:34 +0000 |
commit | afe41a56ebf6c0dcbe69285a263f0e5739d58028 (patch) | |
tree | 57642efbdeecc06aae2a8acaa4afa9d62560527e | |
parent | 5a75601c50821c333d1777f0c4b7236368b175af (diff) | |
download | aspectj-afe41a56ebf6c0dcbe69285a263f0e5739d58028.tar.gz aspectj-afe41a56ebf6c0dcbe69285a263f0e5739d58028.zip |
test for 145950
-rw-r--r-- | tests/bugs152/pr145950/Indirect.java | 21 | ||||
-rw-r--r-- | tests/src/org/aspectj/systemtest/ajc152/Ajc152Tests.java | 1 | ||||
-rw-r--r-- | tests/src/org/aspectj/systemtest/ajc152/ajc152.xml | 9 |
3 files changed, 31 insertions, 0 deletions
diff --git a/tests/bugs152/pr145950/Indirect.java b/tests/bugs152/pr145950/Indirect.java new file mode 100644 index 000000000..68e0f64a9 --- /dev/null +++ b/tests/bugs152/pr145950/Indirect.java @@ -0,0 +1,21 @@ +import java.io.Serializable; +import java.lang.reflect.Field; + +public class Indirect implements I { + public static void main(String[] args) { + try { + Indirect b = (Indirect)Indirect.class.newInstance(); + Field f = Indirect.class.getDeclaredField("serialVersionUID"); + long l = f.getLong(b); + System.err.println("SerialVersionUID is "+l); + } catch (Exception e) { + System.err.println("Problem: "+e.toString()); + } + } +} + +interface I extends Serializable {} + +aspect X { + before(): staticinitialization(Indirect) {} +} diff --git a/tests/src/org/aspectj/systemtest/ajc152/Ajc152Tests.java b/tests/src/org/aspectj/systemtest/ajc152/Ajc152Tests.java index 89962aa34..bc572fc48 100644 --- a/tests/src/org/aspectj/systemtest/ajc152/Ajc152Tests.java +++ b/tests/src/org/aspectj/systemtest/ajc152/Ajc152Tests.java @@ -29,6 +29,7 @@ public class Ajc152Tests extends org.aspectj.testing.XMLBasedAjcTestCase { // public void testBrokenIfArgsCflowAtAj_pr145018() { runTest("ataj crashing with cflow, if and args");} // public void testItdCallingGenericMethod_pr145391() { runTest("itd calling generic method");} // public void testItdCallingGenericMethod_pr145391_2() { runTest("itd calling generic method - 2");} + public void testBrokenAddSerialVersionUID_pr145950() {runTest("fails to discover Serializable");} public void testNoUnnecessaryDeclarationOfThrownExcp_pr129282_1() {runTest("no unnecessary declaration of thrown exception warning - 1");} public void testNoUnnecessaryDeclarationOfThrownExcp_pr129282_2() {runTest("no unnecessary declaration of thrown exception warning - 2");} public void testNoUnnecessaryDeclarationOfThrownExcp_pr129282_3() {runTest("no unnecessary declaration of thrown exception warning - 3");} diff --git a/tests/src/org/aspectj/systemtest/ajc152/ajc152.xml b/tests/src/org/aspectj/systemtest/ajc152/ajc152.xml index ad6ef906f..948741547 100644 --- a/tests/src/org/aspectj/systemtest/ajc152/ajc152.xml +++ b/tests/src/org/aspectj/systemtest/ajc152/ajc152.xml @@ -105,6 +105,15 @@ <compile files="Test.java" options="-1.5"/> </ajc-test> + <ajc-test dir="bugs152/pr145950" title="fails to discover Serializable"> + <compile files="Indirect.java" options="-1.5 -XaddSerialVersionUID"/> + <run class="Indirect"> + <stderr> + <line text="SerialVersionUID is "/> + </stderr> + </run> + </ajc-test> + <ajc-test dir="bugs152/pr145018" title="ataj crashing with cflow, if and args"> <compile files="Broken.aj" options="-1.5"/> <run class="Broken"> |