diff options
author | aclement <aclement> | 2006-08-22 07:34:46 +0000 |
---|---|---|
committer | aclement <aclement> | 2006-08-22 07:34:46 +0000 |
commit | 8b393cc90d5d63171154713e5a73044a1a2fddaf (patch) | |
tree | aaabfb93b35ba91a8343191af1574c020c36cda8 /tests/features151 | |
parent | 0185a0214f790c6611b48b986e01ef97a399b6ae (diff) | |
download | aspectj-8b393cc90d5d63171154713e5a73044a1a2fddaf.tar.gz aspectj-8b393cc90d5d63171154713e5a73044a1a2fddaf.zip |
oops! fix for serial version uid calculation (abstract class problem)
Diffstat (limited to 'tests/features151')
-rw-r--r-- | tests/features151/serialveruid/ATest.java | 7 | ||||
-rw-r--r-- | tests/features151/serialveruid/Test.java | 7 | ||||
-rw-r--r-- | tests/features151/serialveruid/TwoTypes.java | 57 |
3 files changed, 71 insertions, 0 deletions
diff --git a/tests/features151/serialveruid/ATest.java b/tests/features151/serialveruid/ATest.java new file mode 100644 index 000000000..70dee2a38 --- /dev/null +++ b/tests/features151/serialveruid/ATest.java @@ -0,0 +1,7 @@ +package com.testware.ejb.common; +import java.io.Serializable; + +// ATest: static final long serialVersionUID = -7843094187906014027L; +public abstract class ATest implements Serializable{ + abstract void getid(); +}
\ No newline at end of file diff --git a/tests/features151/serialveruid/Test.java b/tests/features151/serialveruid/Test.java new file mode 100644 index 000000000..767715369 --- /dev/null +++ b/tests/features151/serialveruid/Test.java @@ -0,0 +1,7 @@ +package com.testware.ejb.common; + +// Test: static final long serialVersionUID = 2486685186022095906L; +public class Test extends ATest { + void getid() { + } +}
\ No newline at end of file diff --git a/tests/features151/serialveruid/TwoTypes.java b/tests/features151/serialveruid/TwoTypes.java new file mode 100644 index 000000000..c61ffac27 --- /dev/null +++ b/tests/features151/serialveruid/TwoTypes.java @@ -0,0 +1,57 @@ +import java.io.Serializable; +import java.lang.reflect.Field; +import com.testware.ejb.common.*; + +// when in a package, AJ worked out: +//Test SerialVersionUID is 8593816477552447372 +//ATest SerialVersionUID is -5439116922937363745 +// atest serialveruid: -5439116922937363745L +// test serialveruid: 8593816477552447372L + + +//ATest: static final long serialVersionUID = 9091955077097551023L; +//Test: static final long serialVersionUID = 1583992244946994789L; + +//ATest SerialVersionUID is 9091955077097551023 +//Test SerialVersionUID is 1583992244946994789 +// +aspect X { + before(): staticinitialization(*Test) {} +} + +public class TwoTypes implements Serializable { + public static void main(String[] args) { + try { + Test c = (Test)Test.class.newInstance(); + Field f = Test.class.getDeclaredField("serialVersionUID"); + f.setAccessible(true); + long l = f.getLong(c); + System.err.println("Test SerialVersionUID is "+l); + + + // ATest b = (ATest)ATest.class.newInstance(); + f = ATest.class.getDeclaredField("serialVersionUID"); + f.setAccessible(true); + l = f.getLong(Test.class.getSuperclass()); + System.err.println("ATest SerialVersionUID is "+l); + + + } catch (Exception e) { + System.err.println("Problem: "+e.toString()); + e.printStackTrace(); + } + } +// +// 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 |