Changeset 2481 in josm


Ignore:
Timestamp:
Nov 19, 2009 3:18:10 PM (4 years ago)
Author:
Gubaer
Message:

fixed #3967: Relation editor generates conflicts

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/osm/OsmPrimitive.java

    r2474 r2481  
    4141    } 
    4242 
    43     private static class KeysEntry implements Entry<String, String> { 
     43    private static class KeysEntry implements Entry<String, String>{ 
    4444 
    4545        private final String key; 
     
    6363        } 
    6464 
     65        @Override 
     66        public int hashCode() { 
     67            final int prime = 31; 
     68            int result = 1; 
     69            result = prime * result + ((key == null) ? 0 : key.hashCode()); 
     70            result = prime * result + ((value == null) ? 0 : value.hashCode()); 
     71            return result; 
     72        } 
     73 
     74        @Override 
     75        public boolean equals(Object obj) { 
     76            if (this == obj) 
     77                return true; 
     78            if (obj == null) 
     79                return false; 
     80            if (getClass() != obj.getClass()) 
     81                return false; 
     82            KeysEntry other = (KeysEntry) obj; 
     83            if (key == null) { 
     84                if (other.key != null) 
     85                    return false; 
     86            } else if (!key.equals(other.key)) 
     87                return false; 
     88            if (value == null) { 
     89                if (other.value != null) 
     90                    return false; 
     91            } else if (!value.equals(other.value)) 
     92                return false; 
     93            return true; 
     94        } 
    6595    } 
    6696 
     
    142172    private long id = 0; 
    143173 
     174    /** the parent dataset */ 
    144175    private DataSet dataSet; 
    145176 
     
    908939        if (incomplete && ! other.incomplete || !incomplete  && other.incomplete) 
    909940            return false; 
    910         return (keys == null ? other.keys==null : keys.equals(other.keys)); 
     941        return keySet().equals(other.keySet()); 
    911942    } 
    912943 
Note: See TracChangeset for help on using the changeset viewer.