Changeset 10660 in josm for trunk/src/org
- Timestamp:
- 2016-07-27T23:18:28+02:00 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/osm/OsmPrimitive.java
r10657 r10660 1005 1005 /** 1006 1006 * Add new referrer. If referrer is already included then no action is taken 1007 * @param referrer The referrer to add. Must not be null 1008 * @throws NullPointerException if {@code referrer} is null 1007 * @param referrer The referrer to add 1009 1008 */ 1010 1009 protected void addReferrer(OsmPrimitive referrer) { … … 1012 1011 referrers = referrer; 1013 1012 } else if (referrers instanceof OsmPrimitive) { 1014 if ( !referrer.equals(referrers)) {1013 if (referrers != referrer) { 1015 1014 referrers = new OsmPrimitive[] {(OsmPrimitive) referrers, referrer}; 1016 1015 } 1017 1016 } else { 1018 1017 for (OsmPrimitive primitive:(OsmPrimitive[]) referrers) { 1019 if ( referrer.equals(primitive))1018 if (primitive == referrer) 1020 1019 return; 1021 1020 } … … 1026 1025 /** 1027 1026 * Remove referrer. No action is taken if referrer is not registered 1028 * @param referrer The referrer to remove. Must not be null 1029 * @throws NullPointerException if {@code referrer} is null 1027 * @param referrer The referrer to remove 1030 1028 */ 1031 1029 protected void removeReferrer(OsmPrimitive referrer) { 1032 1030 if (referrers instanceof OsmPrimitive) { 1033 if (referrer .equals(referrers)) {1031 if (referrers == referrer) { 1034 1032 referrers = null; 1035 1033 } … … 1038 1036 int idx = -1; 1039 1037 for (int i = 0; i < orig.length; i++) { 1040 if ( referrer.equals(orig[i])) {1038 if (orig[i] == referrer) { 1041 1039 idx = i; 1042 1040 break;
Note:
See TracChangeset
for help on using the changeset viewer.