Changeset 215 for VirtualCollectionRegistry/trunk/VirtualCollectionRegistry/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/model/User.java
- Timestamp:
- 03/04/10 12:11:07 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
VirtualCollectionRegistry/trunk/VirtualCollectionRegistry/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/model/User.java
r191 r215 52 52 public void setName(String name) { 53 53 if (name == null) { 54 throw new IllegalArgumentException("name == null"); 54 throw new NullPointerException("name == null"); 55 } 56 name = name.trim(); 57 if (name.isEmpty()) { 58 throw new IllegalArgumentException("empty name is not allowed"); 55 59 } 56 60 this.name = name; 57 61 } 58 62 59 63 public String getName() { 60 64 return name; … … 67 71 public boolean equals(Object o) { 68 72 if (o == null) { 69 throw new IllegalArgumentException("o == null");73 throw new NullPointerException("o == null"); 70 74 } 71 75 if (o instanceof User) { … … 78 82 public boolean equalsPrincipal(Principal principal) { 79 83 if (principal == null) { 80 throw new IllegalArgumentException("principal == null");84 throw new NullPointerException("principal == null"); 81 85 } 82 86 return name.equals(principal.getName());
Note: See TracChangeset
for help on using the changeset viewer.