diff options
author | nickl- <github@jigsoft.co.za> | 2017-10-28 06:18:43 +0200 |
---|---|---|
committer | nickl- <github@jigsoft.co.za> | 2017-10-28 08:59:37 +0200 |
commit | cd3aa325301e1db20c229f9dce92f86e914ad798 (patch) | |
tree | e616f82e21788f2dabd98504e1b005b7dc4b2eb8 /src/test | |
parent | ce84f84a174b279ee3e8a38446ea3a1f23bf8287 (diff) | |
download | javassist-cd3aa325301e1db20c229f9dce92f86e914ad798.tar.gz javassist-cd3aa325301e1db20c229f9dce92f86e914ad798.zip |
Added default serialVersionUID.
Diffstat (limited to 'src/test')
-rw-r--r-- | src/test/javassist/proxyfactory/MyCls.java | 2 | ||||
-rw-r--r-- | src/test/javassist/proxyfactory/ProxyFactoryTest.java | 2 | ||||
-rw-r--r-- | src/test/javassist/proxyfactory/Tester.java | 5 | ||||
-rw-r--r-- | src/test/test/javassist/bytecode/analysis/AnalyzerTest.java | 16 | ||||
-rw-r--r-- | src/test/test/javassist/proxy/ProxySerializationTest.java | 8 | ||||
-rw-r--r-- | src/test/test/javassist/proxy/ProxySimpleTest.java | 9 | ||||
-rw-r--r-- | src/test/test1/GetThrowables.java | 6 | ||||
-rw-r--r-- | src/test/test1/MySerializableClass.java | 2 | ||||
-rw-r--r-- | src/test/test2/NewExprInTry.java | 3 | ||||
-rw-r--r-- | src/test/test2/Prune.java | 2 | ||||
-rw-r--r-- | src/test/test4/GetAllRefInnerTest.java | 3 | ||||
-rw-r--r-- | src/test/test4/JIRA181.java | 3 | ||||
-rw-r--r-- | src/test/testproxy/ProxyFactoryPerformanceTest.java | 3 | ||||
-rw-r--r-- | src/test/testproxy/ProxyTester.java | 9 |
14 files changed, 67 insertions, 6 deletions
diff --git a/src/test/javassist/proxyfactory/MyCls.java b/src/test/javassist/proxyfactory/MyCls.java index 43fcb8dd..c4c5f35e 100644 --- a/src/test/javassist/proxyfactory/MyCls.java +++ b/src/test/javassist/proxyfactory/MyCls.java @@ -7,6 +7,8 @@ import java.io.Serializable; */ public class MyCls implements Serializable { + /** default serialVersionUID */ + private static final long serialVersionUID = 1L; private int i,j; public int getI() { diff --git a/src/test/javassist/proxyfactory/ProxyFactoryTest.java b/src/test/javassist/proxyfactory/ProxyFactoryTest.java index 2b41af7a..dd52619d 100644 --- a/src/test/javassist/proxyfactory/ProxyFactoryTest.java +++ b/src/test/javassist/proxyfactory/ProxyFactoryTest.java @@ -59,6 +59,8 @@ public class ProxyFactoryTest extends TestCase { public static class MyMethodHandler implements MethodHandler, Serializable { + /** default serialVersionUID */ + private static final long serialVersionUID = 1L; private int x; public int getX() { diff --git a/src/test/javassist/proxyfactory/Tester.java b/src/test/javassist/proxyfactory/Tester.java index 601076da..7d484ecb 100644 --- a/src/test/javassist/proxyfactory/Tester.java +++ b/src/test/javassist/proxyfactory/Tester.java @@ -8,12 +8,17 @@ import java.io.ByteArrayOutputStream; import java.lang.reflect.Method; class Hand implements java.io.Serializable { + /** default serialVersionUID */ + private static final long serialVersionUID = 1L; public int setHandler(int i) { return i; } int getHandler() { return 3; } } public class Tester extends TestCase { static class MHandler implements MethodHandler, java.io.Serializable { + /** default serialVersionUID */ + private static final long serialVersionUID = 1L; + public Object invoke(Object self, Method m, Method proceed, Object[] args) throws Throwable { System.out.println("Name: " + m.getName()); diff --git a/src/test/test/javassist/bytecode/analysis/AnalyzerTest.java b/src/test/test/javassist/bytecode/analysis/AnalyzerTest.java index 0c5a77e6..0337cbf8 100644 --- a/src/test/test/javassist/bytecode/analysis/AnalyzerTest.java +++ b/src/test/test/javassist/bytecode/analysis/AnalyzerTest.java @@ -319,13 +319,17 @@ public class AnalyzerTest extends TestCase { public static class A {}; - public static class B1 extends A implements Serializable {}; - public static class B2 extends A implements Serializable {}; - public static class A2 implements Serializable, Cloneable {}; - public static class A3 implements Serializable, Cloneable {}; - + public static class B1 extends A implements Serializable { + private static final long serialVersionUID = 1L;}; + public static class B2 extends A implements Serializable { + private static final long serialVersionUID = 1L;}; + public static class A2 implements Serializable, Cloneable { + private static final long serialVersionUID = 1L;}; + public static class A3 implements Serializable, Cloneable { + private static final long serialVersionUID = 1L;}; public static class B3 extends A {}; - public static class C31 extends B3 implements Serializable {}; + public static class C31 extends B3 implements Serializable { + private static final long serialVersionUID = 1L;}; public void dummy(Serializable s) {} diff --git a/src/test/test/javassist/proxy/ProxySerializationTest.java b/src/test/test/javassist/proxy/ProxySerializationTest.java index 28125de0..42e16ca7 100644 --- a/src/test/test/javassist/proxy/ProxySerializationTest.java +++ b/src/test/test/javassist/proxy/ProxySerializationTest.java @@ -80,6 +80,9 @@ public class ProxySerializationTest extends TestCase public static class TestFilter implements MethodFilter, Serializable { + /** default serialVersionUID */ + private static final long serialVersionUID = 1L; + public boolean isHandled(Method m) { if (m.getName().equals("getName")) { return true; @@ -105,6 +108,9 @@ public class ProxySerializationTest extends TestCase public static class TestHandler implements MethodHandler, Serializable { + /** default serialVersionUID */ + private static final long serialVersionUID = 1L; + public Object invoke(Object self, Method thisMethod, Method proceed, Object[] args) throws Throwable { return proceed.invoke(self, args); @@ -127,6 +133,8 @@ public class ProxySerializationTest extends TestCase public static class TestClass implements Serializable { + /** default serialVersionUID */ + private static final long serialVersionUID = 1L; public String name; public TestClass() diff --git a/src/test/test/javassist/proxy/ProxySimpleTest.java b/src/test/test/javassist/proxy/ProxySimpleTest.java index bbae9d8d..c73ab397 100644 --- a/src/test/test/javassist/proxy/ProxySimpleTest.java +++ b/src/test/test/javassist/proxy/ProxySimpleTest.java @@ -84,6 +84,9 @@ public class ProxySimpleTest extends TestCase { } public static class ReadWriteData implements Serializable { + /** default serialVersionUID */ + private static final long serialVersionUID = 1L; + public int foo() { return 4; } } @@ -102,10 +105,16 @@ public class ProxySimpleTest extends TestCase { } public static class WriteReplace implements Serializable { + /** default serialVersionUID */ + private static final long serialVersionUID = 1L; + public Object writeReplace() { return this; } } public static class WriteReplace2 implements Serializable { + /** default serialVersionUID */ + private static final long serialVersionUID = 1L; + public Object writeReplace(int i) { return Integer.valueOf(i); } } diff --git a/src/test/test1/GetThrowables.java b/src/test/test1/GetThrowables.java index 19e9a8a5..11ff3e05 100644 --- a/src/test/test1/GetThrowables.java +++ b/src/test/test1/GetThrowables.java @@ -1,9 +1,15 @@ package test1; class GetThrow1 extends Exception { + + /** default serialVersionUID */ + private static final long serialVersionUID = 1L; } class GetThrow2 extends Exception { + + /** default serialVersionUID */ + private static final long serialVersionUID = 1L; } public class GetThrowables { diff --git a/src/test/test1/MySerializableClass.java b/src/test/test1/MySerializableClass.java index 486d1b1b..975dd653 100644 --- a/src/test/test1/MySerializableClass.java +++ b/src/test/test1/MySerializableClass.java @@ -7,6 +7,8 @@ import java.io.*; * @author Bob Lee */ public class MySerializableClass implements Serializable, Cloneable { + /** default serialVersionUID */ + private static final long serialVersionUID = 1L; String fieldA; String fieldB; diff --git a/src/test/test2/NewExprInTry.java b/src/test/test2/NewExprInTry.java index e6e1fe90..804a7c8d 100644 --- a/src/test/test2/NewExprInTry.java +++ b/src/test/test2/NewExprInTry.java @@ -3,6 +3,9 @@ package test2; import java.util.HashMap;
class HashMapWrapper extends HashMap {
+ /** default serialVersionUID */
+ private static final long serialVersionUID = 1L;
+
HashMapWrapper(int size, int args) {
super(size);
}
diff --git a/src/test/test2/Prune.java b/src/test/test2/Prune.java index 1daf9cbb..f98f7764 100644 --- a/src/test/test2/Prune.java +++ b/src/test/test2/Prune.java @@ -1,6 +1,8 @@ package test2;
public class Prune extends java.awt.Point implements Cloneable, Runnable {
+ /** default serialVersionUID */
+ private static final long serialVersionUID = 1L;
public int value;
public Prune(int i) {
diff --git a/src/test/test4/GetAllRefInnerTest.java b/src/test/test4/GetAllRefInnerTest.java index 352b3252..a4921caf 100644 --- a/src/test/test4/GetAllRefInnerTest.java +++ b/src/test/test4/GetAllRefInnerTest.java @@ -20,6 +20,9 @@ public class GetAllRefInnerTest<T> { } public Object foo() { return new java.util.HashSet<String>() { + /** default serialVersionUID */ + private static final long serialVersionUID = 1L; + public String toString() { return this.getClass().toString(); } }; } diff --git a/src/test/test4/JIRA181.java b/src/test/test4/JIRA181.java index c3d2f45a..7c0b0930 100644 --- a/src/test/test4/JIRA181.java +++ b/src/test/test4/JIRA181.java @@ -3,6 +3,9 @@ package test4; import java.util.ArrayList; public class JIRA181<T extends Number> extends ArrayList<T> { + /** default serialVersionUID */ + private static final long serialVersionUID = 1L; + public @interface Condition { Class<? extends ICondition> condition(); } diff --git a/src/test/testproxy/ProxyFactoryPerformanceTest.java b/src/test/testproxy/ProxyFactoryPerformanceTest.java index 55bc7849..829f960a 100644 --- a/src/test/testproxy/ProxyFactoryPerformanceTest.java +++ b/src/test/testproxy/ProxyFactoryPerformanceTest.java @@ -163,6 +163,9 @@ class EnhancerUser extends Thread implements InvocationHandler { */
class SampleBean implements Serializable {
+ /** default serialVersionUID */
+ private static final long serialVersionUID = 1L;
+
long oid;
int version;
diff --git a/src/test/testproxy/ProxyTester.java b/src/test/testproxy/ProxyTester.java index f325997d..b7f36bcf 100644 --- a/src/test/testproxy/ProxyTester.java +++ b/src/test/testproxy/ProxyTester.java @@ -398,6 +398,9 @@ public class ProxyTester extends TestCase { } public static class ReadWriteData implements Serializable { + /** default serialVersionUID */ + private static final long serialVersionUID = 1L; + public int foo() { return 4; } } @@ -416,10 +419,16 @@ public class ProxyTester extends TestCase { } public static class WriteReplace implements Serializable { + /** default serialVersionUID */ + private static final long serialVersionUID = 1L; + public Object writeReplace() { return this; } } public static class WriteReplace2 implements Serializable { + /** default serialVersionUID */ + private static final long serialVersionUID = 1L; + public Object writeReplace(int i) { return Integer.valueOf(i); } } |