Changeset 10583 in josm for trunk/src


Ignore:
Timestamp:
2016-07-21T02:17:39+02:00 (8 years ago)
Author:
Don-vip
Message:

see #11390, fix #12952 - Java 8: Disable auto boxing for hashCode/equals (patch by michael2402) - gsoc-core

Location:
trunk/src/org/openstreetmap/josm/data/osm
Files:
2 edited

Legend:

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

    r10378 r10583  
    176176    @Override
    177177    public boolean isNewOrUndeleted() {
    178         return (id <= 0) || ((flags & (FLAG_VISIBLE + FLAG_DELETED)) == 0);
     178        return isNew() || ((flags & (FLAG_VISIBLE + FLAG_DELETED)) == 0);
    179179    }
    180180
  • trunk/src/org/openstreetmap/josm/data/osm/OsmPrimitive.java

    r10469 r10583  
    1717import java.util.Locale;
    1818import java.util.Map;
    19 import java.util.Objects;
    2019import java.util.Set;
    2120
     
    13851384    @Override
    13861385    public boolean equals(Object obj) {
    1387         if (this == obj) return true;
    1388         if (obj == null || getClass() != obj.getClass()) return false;
    1389         OsmPrimitive that = (OsmPrimitive) obj;
    1390         return Objects.equals(id, that.id);
     1386        if (this == obj) {
     1387            return true;
     1388        } else if (obj == null || getClass() != obj.getClass()) {
     1389            return false;
     1390        } else {
     1391            OsmPrimitive that = (OsmPrimitive) obj;
     1392            return id == that.id;
     1393        }
    13911394    }
    13921395
     
    13981401    @Override
    13991402    public int hashCode() {
    1400         return Objects.hash(id);
     1403        return Long.hashCode(id);
    14011404    }
    14021405
Note: See TracChangeset for help on using the changeset viewer.