equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright (c) 2001, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. |
7 * published by the Free Software Foundation. |
29 */ |
29 */ |
30 |
30 |
31 import java.io.*; |
31 import java.io.*; |
32 |
32 |
33 class A implements Serializable { |
33 class A implements Serializable { |
|
34 private static final long serialVersionUID = 1L; |
|
35 |
34 int i1 = 1, i2 = 2; |
36 int i1 = 1, i2 = 2; |
35 String s1 = "foo", s2 = "bar"; |
37 String s1 = "foo", s2 = "bar"; |
36 |
38 |
37 private void readObject(ObjectInputStream in) |
39 private void readObject(ObjectInputStream in) |
38 throws IOException, ClassNotFoundException |
40 throws IOException, ClassNotFoundException |
64 } |
66 } |
65 } |
67 } |
66 } |
68 } |
67 |
69 |
68 class B implements Serializable { |
70 class B implements Serializable { |
|
71 private static final long serialVersionUID = 1L; |
|
72 |
69 int i1 = 1, i2 = 2; |
73 int i1 = 1, i2 = 2; |
70 String s1 = "foo", s2 = "bar"; |
74 String s1 = "foo", s2 = "bar"; |
71 |
75 |
72 private void readObject(ObjectInputStream in) |
76 private void readObject(ObjectInputStream in) |
73 throws IOException, ClassNotFoundException |
77 throws IOException, ClassNotFoundException |
99 } |
103 } |
100 } |
104 } |
101 } |
105 } |
102 |
106 |
103 class C implements Serializable { |
107 class C implements Serializable { |
|
108 private static final long serialVersionUID = 1L; |
|
109 |
104 private void readObject(ObjectInputStream in) |
110 private void readObject(ObjectInputStream in) |
105 throws IOException, ClassNotFoundException |
111 throws IOException, ClassNotFoundException |
106 { |
112 { |
107 in.defaultReadObject(); |
113 in.defaultReadObject(); |
108 try { |
114 try { |