- Timestamp:
- 2008-05-11T01:00:31+02:00 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/osm/OsmPrimitive.java
r627 r629 161 161 162 162 /** 163 * Equal, if the id (and class) is equal. If both ids are 0, use the super classes 164 * equal instead. 163 * Equal, if the id (and class) is equal. 165 164 * 166 165 * An primitive is equal to its incomplete counter part. 167 166 */ 168 @Override public final boolean equals(Object obj) { 169 if (obj == null || getClass() != obj.getClass() || id == 0 || ((OsmPrimitive)obj).id == 0) 170 return super.equals(obj); 171 return id == ((OsmPrimitive)obj).id; 172 } 167 @Override public boolean equals(Object obj) { 168 if (id == 0) return obj == this; 169 if (obj instanceof OsmPrimitive) { // not null too 170 return ((OsmPrimitive)obj).id == id && obj.getClass() == getClass(); 171 } 172 return false; 173 } 173 174 174 175 /**
Note:
See TracChangeset
for help on using the changeset viewer.