Changeset 9371 in josm for trunk/src/org/openstreetmap/josm/data/osm/SimplePrimitiveId.java
- Timestamp:
- 2016-01-09T23:20:37+01:00 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/osm/SimplePrimitiveId.java
r8496 r9371 5 5 import java.util.ArrayList; 6 6 import java.util.List; 7 import java.util.Objects; 7 8 import java.util.regex.MatchResult; 8 9 import java.util.regex.Matcher; … … 42 43 @Override 43 44 public int hashCode() { 44 final int prime = 31; 45 int result = 1; 46 result = prime * result + (int) (id ^ (id >>> 32)); 47 result = prime * result + ((type == null) ? 0 : type.hashCode()); 48 return result; 45 return Objects.hash(id, type); 49 46 } 50 47 51 48 @Override 52 49 public boolean equals(Object obj) { 53 if (this == obj) 54 return true; 55 if (obj == null) 56 return false; 57 if (getClass() != obj.getClass()) 58 return false; 59 SimplePrimitiveId other = (SimplePrimitiveId) obj; 60 if (id != other.id) 61 return false; 62 if (type == null) { 63 if (other.type != null) 64 return false; 65 } else if (!type.equals(other.type)) 66 return false; 67 return true; 50 if (this == obj) return true; 51 if (obj == null || getClass() != obj.getClass()) return false; 52 SimplePrimitiveId that = (SimplePrimitiveId) obj; 53 return id == that.id && 54 type == that.type; 68 55 } 69 56
Note:
See TracChangeset
for help on using the changeset viewer.