mirror of
https://github.com/sjsdfg/effective-java-3rd-chinese.git
synced 2025-03-03 13:50:57 +08:00
Update 88. 保护性的编写 readObject 方法.md
This commit is contained in:
parent
32d7db6f19
commit
7d5f09370b
@ -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());
|
||||
|
Loading…
Reference in New Issue
Block a user