mirror of
https://github.com/sjsdfg/effective-java-3rd-chinese.git
synced 2026-08-31 03:47:54 +08:00
Update 88. 保护性的编写 readObject 方法.md
This commit is contained in:
@@ -17,8 +17,7 @@ public final class Period {
|
||||
this.start = new Date(start.getTime());
|
||||
this.end = new Date(end.getTime());
|
||||
if (this.start.compareTo(this.end) > 0)
|
||||
throw new IllegalArgumentException(
|
||||
start + " after " + end);
|
||||
throw new IllegalArgumentException(start + " after " + end);
|
||||
}
|
||||
public Date start () {
|
||||
return new Date(start.getTime());
|
||||
|
||||
Reference in New Issue
Block a user