2 * See the file LICENSE for redistribution information.
4 * Copyright (c) 2000, 2012 Oracle and/or its affiliates. All rights reserved.
7 package com.sleepycat.collections.test.serial;
10 * @see StoredClassCatalogTest
13 class TestSerial implements java.io.Serializable
15 static final long serialVersionUID = -3738980000390384920L;
18 private TestSerial other;
20 // The following field 's' was added after this class was compiled and
21 // serialized instances were saved in resource files. This allows testing
22 // that the original stored instances can be deserialized after changing
23 // the class. The serialVersionUID is needed for this according to Java
24 // serialization rules, and was generated with the serialver tool.
26 //private String s = "string";
28 TestSerial(TestSerial other)
43 String getStringField()
45 return null; // this returned null before field 's' was added.
48 public boolean equals(Object object)
52 TestSerial o = (TestSerial) object;
53 if ((o.other == null) ? (this.other != null)
54 : (!o.other.equals(this.other)))
58 // the following test was not done before field 's' was added
60 if ((o.s == null) ? (this.s != null)
61 : (!o.s.equals(this.s)))
66 catch (ClassCastException e)