📄 testserial.java.original
字号:
/*- * See the file LICENSE for redistribution information. * * Copyright (c) 2000-2006 * Oracle Corporation. All rights reserved. * * $Id: TestSerial.java.original,v 12.6 2006/08/31 18:14:14 bostic Exp $ */package com.sleepycat.collections.test.serial;class TestSerial implements java.io.Serializable{ static final long serialVersionUID = -3738980000390384920L; private int i = 123; private TestSerial other; // The following field 's' was added after this class was compiled and // serialized instances were saved in resource files. This allows testing // that the original stored instances can be deserialized after changing // the class. The serialVersionUID is needed for this according to Java // serialization rules, and was generated with the serialver tool. // //private String s = "string"; TestSerial(TestSerial other) { this.other = other; } TestSerial getOther() { return other; } int getIntField() { return i; } String getStringField() { return null; // this returned null before field 's' was added. } public boolean equals(Object object) { try { TestSerial o = (TestSerial) object; if ((o.other == null) ? (this.other != null) : (!o.other.equals(this.other))) return false; if (this.i != o.i) return false; // the following test was not done before field 's' was added /* if ((o.s == null) ? (this.s != null) : (!o.s.equals(this.s))) return false; */ return true; } catch (ClassCastException e) { return false; } }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -