From afe41a56ebf6c0dcbe69285a263f0e5739d58028 Mon Sep 17 00:00:00 2001 From: aclement Date: Thu, 8 Jun 2006 08:27:34 +0000 Subject: [PATCH] test for 145950 --- tests/bugs152/pr145950/Indirect.java | 21 +++++++++++++++++++ .../systemtest/ajc152/Ajc152Tests.java | 1 + .../org/aspectj/systemtest/ajc152/ajc152.xml | 9 ++++++++ 3 files changed, 31 insertions(+) create mode 100644 tests/bugs152/pr145950/Indirect.java 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 @@ + + + + + + + + + -- 2.39.5