Index: trunk/src/org/openstreetmap/josm/actions/CombineWayAction.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/CombineWayAction.java	(revision 9370)
+++ trunk/src/org/openstreetmap/josm/actions/CombineWayAction.java	(revision 9371)
@@ -16,4 +16,5 @@
 import java.util.List;
 import java.util.Map;
+import java.util.Objects;
 import java.util.Set;
 import java.util.Stack;
@@ -343,31 +344,14 @@
         @Override
         public int hashCode() {
-            final int prime = 31;
-            int result = 1;
-            result = prime * result + ((a == null) ? 0 : a.hashCode());
-            result = prime * result + ((b == null) ? 0 : b.hashCode());
-            return result;
+            return Objects.hash(a, b);
         }
 
         @Override
         public boolean equals(Object obj) {
-            if (this == obj)
-                return true;
-            if (obj == null)
-                return false;
-            if (getClass() != obj.getClass())
-                return false;
-            NodePair other = (NodePair) obj;
-            if (a == null) {
-                if (other.a != null)
-                    return false;
-            } else if (!a.equals(other.a))
-                return false;
-            if (b == null) {
-                if (other.b != null)
-                    return false;
-            } else if (!b.equals(other.b))
-                return false;
-            return true;
+            if (this == obj) return true;
+            if (obj == null || getClass() != obj.getClass()) return false;
+            NodePair nodePair = (NodePair) obj;
+            return Objects.equals(a, nodePair.a) &&
+                    Objects.equals(b, nodePair.b);
         }
     }
Index: trunk/src/org/openstreetmap/josm/actions/ExtensionFileFilter.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/ExtensionFileFilter.java	(revision 9370)
+++ trunk/src/org/openstreetmap/josm/actions/ExtensionFileFilter.java	(revision 9371)
@@ -11,4 +11,5 @@
 import java.util.LinkedList;
 import java.util.List;
+import java.util.Objects;
 import java.util.ServiceConfigurationError;
 
@@ -350,37 +351,15 @@
     @Override
     public int hashCode() {
-        final int prime = 31;
-        int result = 1;
-        result = prime * result + ((defaultExtension == null) ? 0 : defaultExtension.hashCode());
-        result = prime * result + ((description == null) ? 0 : description.hashCode());
-        result = prime * result + ((extensions == null) ? 0 : extensions.hashCode());
-        return result;
+        return Objects.hash(extensions, description, defaultExtension);
     }
 
     @Override
     public boolean equals(Object obj) {
-        if (this == obj)
-            return true;
-        if (obj == null)
-            return false;
-        if (getClass() != obj.getClass())
-            return false;
-        ExtensionFileFilter other = (ExtensionFileFilter) obj;
-        if (defaultExtension == null) {
-            if (other.defaultExtension != null)
-                return false;
-        } else if (!defaultExtension.equals(other.defaultExtension))
-            return false;
-        if (description == null) {
-            if (other.description != null)
-                return false;
-        } else if (!description.equals(other.description))
-            return false;
-        if (extensions == null) {
-            if (other.extensions != null)
-                return false;
-        } else if (!extensions.equals(other.extensions))
-            return false;
-        return true;
+        if (this == obj) return true;
+        if (obj == null || getClass() != obj.getClass()) return false;
+        ExtensionFileFilter that = (ExtensionFileFilter) obj;
+        return Objects.equals(extensions, that.extensions) &&
+                Objects.equals(description, that.description) &&
+                Objects.equals(defaultExtension, that.defaultExtension);
     }
 }
Index: trunk/src/org/openstreetmap/josm/actions/JoinAreasAction.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/JoinAreasAction.java	(revision 9370)
+++ trunk/src/org/openstreetmap/josm/actions/JoinAreasAction.java	(revision 9371)
@@ -17,4 +17,5 @@
 import java.util.List;
 import java.util.Map;
+import java.util.Objects;
 import java.util.Set;
 import java.util.TreeMap;
@@ -92,12 +93,14 @@
         @Override
         public int hashCode() {
-            return rel.hashCode();
+            return Objects.hash(rel, role);
         }
 
         @Override
         public boolean equals(Object other) {
-            if (!(other instanceof RelationRole)) return false;
-            RelationRole otherMember = (RelationRole) other;
-            return otherMember.role.equals(role) && otherMember.rel.equals(rel);
+            if (this == other) return true;
+            if (other == null || getClass() != other.getClass()) return false;
+            RelationRole that = (RelationRole) other;
+            return Objects.equals(rel, that.rel) &&
+                    Objects.equals(role, that.role);
         }
     }
@@ -120,12 +123,14 @@
         @Override
         public int hashCode() {
-            return way.hashCode();
+            return Objects.hash(way, insideToTheRight);
         }
 
         @Override
         public boolean equals(Object other) {
-            if (!(other instanceof WayInPolygon)) return false;
-            WayInPolygon otherMember = (WayInPolygon) other;
-            return otherMember.way.equals(this.way) && otherMember.insideToTheRight == this.insideToTheRight;
+            if (this == other) return true;
+            if (other == null || getClass() != other.getClass()) return false;
+            WayInPolygon that = (WayInPolygon) other;
+            return insideToTheRight == that.insideToTheRight &&
+                    Objects.equals(way, that.way);
         }
     }
Index: trunk/src/org/openstreetmap/josm/actions/search/SearchAction.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/search/SearchAction.java	(revision 9370)
+++ trunk/src/org/openstreetmap/josm/actions/search/SearchAction.java	(revision 9371)
@@ -24,4 +24,5 @@
 import java.util.List;
 import java.util.Map;
+import java.util.Objects;
 import java.util.Set;
 
@@ -677,18 +678,18 @@
         @Override
         public boolean equals(Object other) {
-            if (!(other instanceof SearchSetting))
-                return false;
-            SearchSetting o = (SearchSetting) other;
-            return o.caseSensitive == this.caseSensitive
-                    && o.regexSearch == this.regexSearch
-                    && o.mapCSSSearch == this.mapCSSSearch
-                    && o.allElements == this.allElements
-                    && o.mode.equals(this.mode)
-                    && o.text.equals(this.text);
+            if (this == other) return true;
+            if (other == null || getClass() != other.getClass()) return false;
+            SearchSetting that = (SearchSetting) other;
+            return caseSensitive == that.caseSensitive &&
+                    regexSearch == that.regexSearch &&
+                    mapCSSSearch == that.mapCSSSearch &&
+                    allElements == that.allElements &&
+                    Objects.equals(text, that.text) &&
+                    mode == that.mode;
         }
 
         @Override
         public int hashCode() {
-            return text.hashCode();
+            return Objects.hash(text, mode, caseSensitive, regexSearch, mapCSSSearch, allElements);
         }
 
Index: trunk/src/org/openstreetmap/josm/command/AddCommand.java
===================================================================
--- trunk/src/org/openstreetmap/josm/command/AddCommand.java	(revision 9370)
+++ trunk/src/org/openstreetmap/josm/command/AddCommand.java	(revision 9371)
@@ -7,4 +7,5 @@
 import java.util.Collection;
 import java.util.Collections;
+import java.util.Objects;
 
 import javax.swing.Icon;
@@ -99,25 +100,14 @@
     @Override
     public int hashCode() {
-        final int prime = 31;
-        int result = super.hashCode();
-        result = prime * result + ((osm == null) ? 0 : osm.hashCode());
-        return result;
+        return Objects.hash(super.hashCode(), osm);
     }
 
     @Override
     public boolean equals(Object obj) {
-        if (this == obj)
-            return true;
-        if (!super.equals(obj))
-            return false;
-        if (getClass() != obj.getClass())
-            return false;
-        AddCommand other = (AddCommand) obj;
-        if (osm == null) {
-            if (other.osm != null)
-                return false;
-        } else if (!osm.equals(other.osm))
-            return false;
-        return true;
+        if (this == obj) return true;
+        if (obj == null || getClass() != obj.getClass()) return false;
+        if (!super.equals(obj)) return false;
+        AddCommand that = (AddCommand) obj;
+        return Objects.equals(osm, that.osm);
     }
 }
Index: trunk/src/org/openstreetmap/josm/command/AddPrimitivesCommand.java
===================================================================
--- trunk/src/org/openstreetmap/josm/command/AddPrimitivesCommand.java	(revision 9370)
+++ trunk/src/org/openstreetmap/josm/command/AddPrimitivesCommand.java	(revision 9371)
@@ -8,4 +8,5 @@
 import java.util.HashSet;
 import java.util.List;
+import java.util.Objects;
 
 import javax.swing.Icon;
@@ -176,43 +177,17 @@
     @Override
     public int hashCode() {
-        final int prime = 31;
-        int result = super.hashCode();
-        result = prime * result + ((createdPrimitives == null) ? 0 : createdPrimitives.hashCode());
-        result = prime * result + ((createdPrimitivesToSelect == null) ? 0 : createdPrimitivesToSelect.hashCode());
-        result = prime * result + ((data == null) ? 0 : data.hashCode());
-        result = prime * result + ((toSelect == null) ? 0 : toSelect.hashCode());
-        return result;
+        return Objects.hash(super.hashCode(), data, toSelect, createdPrimitives, createdPrimitivesToSelect);
     }
 
     @Override
     public boolean equals(Object obj) {
-        if (this == obj)
-            return true;
-        if (!super.equals(obj))
-            return false;
-        if (getClass() != obj.getClass())
-            return false;
-        AddPrimitivesCommand other = (AddPrimitivesCommand) obj;
-        if (createdPrimitives == null) {
-            if (other.createdPrimitives != null)
-                return false;
-        } else if (!createdPrimitives.equals(other.createdPrimitives))
-            return false;
-        if (createdPrimitivesToSelect == null) {
-            if (other.createdPrimitivesToSelect != null)
-                return false;
-        } else if (!createdPrimitivesToSelect.equals(other.createdPrimitivesToSelect))
-            return false;
-        if (data == null) {
-            if (other.data != null)
-                return false;
-        } else if (!data.equals(other.data))
-            return false;
-        if (toSelect == null) {
-            if (other.toSelect != null)
-                return false;
-        } else if (!toSelect.equals(other.toSelect))
-            return false;
-        return true;
+        if (this == obj) return true;
+        if (obj == null || getClass() != obj.getClass()) return false;
+        if (!super.equals(obj)) return false;
+        AddPrimitivesCommand that = (AddPrimitivesCommand) obj;
+        return Objects.equals(data, that.data) &&
+                Objects.equals(toSelect, that.toSelect) &&
+                Objects.equals(createdPrimitives, that.createdPrimitives) &&
+                Objects.equals(createdPrimitivesToSelect, that.createdPrimitivesToSelect);
     }
 }
Index: trunk/src/org/openstreetmap/josm/command/ChangeCommand.java
===================================================================
--- trunk/src/org/openstreetmap/josm/command/ChangeCommand.java	(revision 9370)
+++ trunk/src/org/openstreetmap/josm/command/ChangeCommand.java	(revision 9371)
@@ -6,4 +6,5 @@
 
 import java.util.Collection;
+import java.util.Objects;
 
 import javax.swing.Icon;
@@ -91,31 +92,15 @@
     @Override
     public int hashCode() {
-        final int prime = 31;
-        int result = super.hashCode();
-        result = prime * result + ((newOsm == null) ? 0 : newOsm.hashCode());
-        result = prime * result + ((osm == null) ? 0 : osm.hashCode());
-        return result;
+        return Objects.hash(super.hashCode(), osm, newOsm);
     }
 
     @Override
     public boolean equals(Object obj) {
-        if (this == obj)
-            return true;
-        if (!super.equals(obj))
-            return false;
-        if (getClass() != obj.getClass())
-            return false;
-        ChangeCommand other = (ChangeCommand) obj;
-        if (newOsm == null) {
-            if (other.newOsm != null)
-                return false;
-        } else if (!newOsm.equals(other.newOsm))
-            return false;
-        if (osm == null) {
-            if (other.osm != null)
-                return false;
-        } else if (!osm.equals(other.osm))
-            return false;
-        return true;
+        if (this == obj) return true;
+        if (obj == null || getClass() != obj.getClass()) return false;
+        if (!super.equals(obj)) return false;
+        ChangeCommand that = (ChangeCommand) obj;
+        return Objects.equals(osm, that.osm) &&
+                Objects.equals(newOsm, that.newOsm);
     }
 }
Index: trunk/src/org/openstreetmap/josm/command/ChangeNodesCommand.java
===================================================================
--- trunk/src/org/openstreetmap/josm/command/ChangeNodesCommand.java	(revision 9370)
+++ trunk/src/org/openstreetmap/josm/command/ChangeNodesCommand.java	(revision 9371)
@@ -6,4 +6,5 @@
 import java.util.Collection;
 import java.util.List;
+import java.util.Objects;
 
 import javax.swing.Icon;
@@ -64,31 +65,15 @@
     @Override
     public int hashCode() {
-        final int prime = 31;
-        int result = super.hashCode();
-        result = prime * result + ((newNodes == null) ? 0 : newNodes.hashCode());
-        result = prime * result + ((way == null) ? 0 : way.hashCode());
-        return result;
+        return Objects.hash(super.hashCode(), way, newNodes);
     }
 
     @Override
     public boolean equals(Object obj) {
-        if (this == obj)
-            return true;
-        if (!super.equals(obj))
-            return false;
-        if (getClass() != obj.getClass())
-            return false;
-        ChangeNodesCommand other = (ChangeNodesCommand) obj;
-        if (newNodes == null) {
-            if (other.newNodes != null)
-                return false;
-        } else if (!newNodes.equals(other.newNodes))
-            return false;
-        if (way == null) {
-            if (other.way != null)
-                return false;
-        } else if (!way.equals(other.way))
-            return false;
-        return true;
+        if (this == obj) return true;
+        if (obj == null || getClass() != obj.getClass()) return false;
+        if (!super.equals(obj)) return false;
+        ChangeNodesCommand that = (ChangeNodesCommand) obj;
+        return Objects.equals(way, that.way) &&
+                Objects.equals(newNodes, that.newNodes);
     }
 }
Index: trunk/src/org/openstreetmap/josm/command/ChangePropertyCommand.java
===================================================================
--- trunk/src/org/openstreetmap/josm/command/ChangePropertyCommand.java	(revision 9370)
+++ trunk/src/org/openstreetmap/josm/command/ChangePropertyCommand.java	(revision 9371)
@@ -14,4 +14,5 @@
 import java.util.List;
 import java.util.Map;
+import java.util.Objects;
 
 import javax.swing.Icon;
@@ -249,31 +250,15 @@
     @Override
     public int hashCode() {
-        final int prime = 31;
-        int result = super.hashCode();
-        result = prime * result + ((objects == null) ? 0 : objects.hashCode());
-        result = prime * result + ((tags == null) ? 0 : tags.hashCode());
-        return result;
+        return Objects.hash(super.hashCode(), objects, tags);
     }
 
     @Override
     public boolean equals(Object obj) {
-        if (this == obj)
-            return true;
-        if (!super.equals(obj))
-            return false;
-        if (getClass() != obj.getClass())
-            return false;
-        ChangePropertyCommand other = (ChangePropertyCommand) obj;
-        if (objects == null) {
-            if (other.objects != null)
-                return false;
-        } else if (!objects.equals(other.objects))
-            return false;
-        if (tags == null) {
-            if (other.tags != null)
-                return false;
-        } else if (!tags.equals(other.tags))
-            return false;
-        return true;
+        if (this == obj) return true;
+        if (obj == null || getClass() != obj.getClass()) return false;
+        if (!super.equals(obj)) return false;
+        ChangePropertyCommand that = (ChangePropertyCommand) obj;
+        return Objects.equals(objects, that.objects) &&
+                Objects.equals(tags, that.tags);
     }
 }
Index: trunk/src/org/openstreetmap/josm/command/ChangePropertyKeyCommand.java
===================================================================
--- trunk/src/org/openstreetmap/josm/command/ChangePropertyKeyCommand.java	(revision 9370)
+++ trunk/src/org/openstreetmap/josm/command/ChangePropertyKeyCommand.java	(revision 9371)
@@ -10,4 +10,5 @@
 import java.util.LinkedList;
 import java.util.List;
+import java.util.Objects;
 
 import javax.swing.Icon;
@@ -129,37 +130,16 @@
     @Override
     public int hashCode() {
-        final int prime = 31;
-        int result = super.hashCode();
-        result = prime * result + ((key == null) ? 0 : key.hashCode());
-        result = prime * result + ((newKey == null) ? 0 : newKey.hashCode());
-        result = prime * result + ((objects == null) ? 0 : objects.hashCode());
-        return result;
+        return Objects.hash(super.hashCode(), objects, key, newKey);
     }
 
     @Override
     public boolean equals(Object obj) {
-        if (this == obj)
-            return true;
-        if (!super.equals(obj))
-            return false;
-        if (getClass() != obj.getClass())
-            return false;
-        ChangePropertyKeyCommand other = (ChangePropertyKeyCommand) obj;
-        if (key == null) {
-            if (other.key != null)
-                return false;
-        } else if (!key.equals(other.key))
-            return false;
-        if (newKey == null) {
-            if (other.newKey != null)
-                return false;
-        } else if (!newKey.equals(other.newKey))
-            return false;
-        if (objects == null) {
-            if (other.objects != null)
-                return false;
-        } else if (!objects.equals(other.objects))
-            return false;
-        return true;
+        if (this == obj) return true;
+        if (obj == null || getClass() != obj.getClass()) return false;
+        if (!super.equals(obj)) return false;
+        ChangePropertyKeyCommand that = (ChangePropertyKeyCommand) obj;
+        return Objects.equals(objects, that.objects) &&
+                Objects.equals(key, that.key) &&
+                Objects.equals(newKey, that.newKey);
     }
 }
Index: trunk/src/org/openstreetmap/josm/command/ChangeRelationMemberRoleCommand.java
===================================================================
--- trunk/src/org/openstreetmap/josm/command/ChangeRelationMemberRoleCommand.java	(revision 9370)
+++ trunk/src/org/openstreetmap/josm/command/ChangeRelationMemberRoleCommand.java	(revision 9371)
@@ -5,4 +5,5 @@
 
 import java.util.Collection;
+import java.util.Objects;
 
 import javax.swing.Icon;
@@ -84,46 +85,18 @@
     @Override
     public int hashCode() {
-        final int prime = 31;
-        int result = super.hashCode();
-        result = prime * result + ((newRole == null) ? 0 : newRole.hashCode());
-        result = prime * result + ((oldModified == null) ? 0 : oldModified.hashCode());
-        result = prime * result + ((oldRole == null) ? 0 : oldRole.hashCode());
-        result = prime * result + position;
-        result = prime * result + ((relation == null) ? 0 : relation.hashCode());
-        return result;
+        return Objects.hash(super.hashCode(), relation, position, newRole, oldRole, oldModified);
     }
 
     @Override
     public boolean equals(Object obj) {
-        if (this == obj)
-            return true;
-        if (!super.equals(obj))
-            return false;
-        if (getClass() != obj.getClass())
-            return false;
-        ChangeRelationMemberRoleCommand other = (ChangeRelationMemberRoleCommand) obj;
-        if (newRole == null) {
-            if (other.newRole != null)
-                return false;
-        } else if (!newRole.equals(other.newRole))
-            return false;
-        if (oldModified == null) {
-            if (other.oldModified != null)
-                return false;
-        } else if (!oldModified.equals(other.oldModified))
-            return false;
-        if (oldRole == null) {
-            if (other.oldRole != null)
-                return false;
-        } else if (!oldRole.equals(other.oldRole))
-            return false;
-        if (position != other.position)
-            return false;
-        if (relation == null) {
-            if (other.relation != null)
-                return false;
-        } else if (!relation.equals(other.relation))
-            return false;
-        return true;
+        if (this == obj) return true;
+        if (obj == null || getClass() != obj.getClass()) return false;
+        if (!super.equals(obj)) return false;
+        ChangeRelationMemberRoleCommand that = (ChangeRelationMemberRoleCommand) obj;
+        return position == that.position &&
+                Objects.equals(relation, that.relation) &&
+                Objects.equals(newRole, that.newRole) &&
+                Objects.equals(oldRole, that.oldRole) &&
+                Objects.equals(oldModified, that.oldModified);
     }
 }
Index: trunk/src/org/openstreetmap/josm/command/Command.java
===================================================================
--- trunk/src/org/openstreetmap/josm/command/Command.java	(revision 9370)
+++ trunk/src/org/openstreetmap/josm/command/Command.java	(revision 9371)
@@ -9,4 +9,5 @@
 import java.util.Map;
 import java.util.Map.Entry;
+import java.util.Objects;
 
 import javax.swing.JOptionPane;
@@ -105,34 +106,15 @@
         @Override
         public int hashCode() {
-            final int prime = 31;
-            int result = 1;
-            result = prime * result + ((eastNorth == null) ? 0 : eastNorth.hashCode());
-            result = prime * result + ((latlon == null) ? 0 : latlon.hashCode());
-            result = prime * result + (modified ? 1231 : 1237);
-            return result;
+            return Objects.hash(latlon, eastNorth, modified);
         }
 
         @Override
         public boolean equals(Object obj) {
-            if (this == obj)
-                return true;
-            if (obj == null)
-                return false;
-            if (getClass() != obj.getClass())
-                return false;
-            OldNodeState other = (OldNodeState) obj;
-            if (eastNorth == null) {
-                if (other.eastNorth != null)
-                    return false;
-            } else if (!eastNorth.equals(other.eastNorth))
-                return false;
-            if (latlon == null) {
-                if (other.latlon != null)
-                    return false;
-            } else if (!latlon.equals(other.latlon))
-                return false;
-            if (modified != other.modified)
-                return false;
-            return true;
+            if (this == obj) return true;
+            if (obj == null || getClass() != obj.getClass()) return false;
+            OldNodeState that = (OldNodeState) obj;
+            return modified == that.modified &&
+                    Objects.equals(latlon, that.latlon) &&
+                    Objects.equals(eastNorth, that.eastNorth);
         }
     }
@@ -306,31 +288,14 @@
     @Override
     public int hashCode() {
-        final int prime = 31;
-        int result = 1;
-        result = prime * result + ((cloneMap == null) ? 0 : cloneMap.hashCode());
-        result = prime * result + ((layer == null) ? 0 : layer.hashCode());
-        return result;
+        return Objects.hash(cloneMap, layer);
     }
 
     @Override
     public boolean equals(Object obj) {
-        if (this == obj)
-            return true;
-        if (obj == null)
-            return false;
-        if (getClass() != obj.getClass())
-            return false;
-        Command other = (Command) obj;
-        if (cloneMap == null) {
-            if (other.cloneMap != null)
-                return false;
-        } else if (!cloneMap.equals(other.cloneMap))
-            return false;
-        if (layer == null) {
-            if (other.layer != null)
-                return false;
-        } else if (!layer.equals(other.layer))
-            return false;
-        return true;
+        if (this == obj) return true;
+        if (obj == null || getClass() != obj.getClass()) return false;
+        Command command = (Command) obj;
+        return Objects.equals(cloneMap, command.cloneMap) &&
+                Objects.equals(layer, command.layer);
     }
 }
Index: trunk/src/org/openstreetmap/josm/command/DeleteCommand.java
===================================================================
--- trunk/src/org/openstreetmap/josm/command/DeleteCommand.java	(revision 9370)
+++ trunk/src/org/openstreetmap/josm/command/DeleteCommand.java	(revision 9371)
@@ -18,4 +18,5 @@
 import java.util.Map;
 import java.util.Map.Entry;
+import java.util.Objects;
 import java.util.Set;
 
@@ -518,31 +519,15 @@
     @Override
     public int hashCode() {
-        final int prime = 31;
-        int result = super.hashCode();
-        result = prime * result + ((clonedPrimitives == null) ? 0 : clonedPrimitives.hashCode());
-        result = prime * result + ((toDelete == null) ? 0 : toDelete.hashCode());
-        return result;
+        return Objects.hash(super.hashCode(), toDelete, clonedPrimitives);
     }
 
     @Override
     public boolean equals(Object obj) {
-        if (this == obj)
-            return true;
-        if (!super.equals(obj))
-            return false;
-        if (getClass() != obj.getClass())
-            return false;
-        DeleteCommand other = (DeleteCommand) obj;
-        if (clonedPrimitives == null) {
-            if (other.clonedPrimitives != null)
-                return false;
-        } else if (!clonedPrimitives.equals(other.clonedPrimitives))
-            return false;
-        if (toDelete == null) {
-            if (other.toDelete != null)
-                return false;
-        } else if (!toDelete.equals(other.toDelete))
-            return false;
-        return true;
+        if (this == obj) return true;
+        if (obj == null || getClass() != obj.getClass()) return false;
+        if (!super.equals(obj)) return false;
+        DeleteCommand that = (DeleteCommand) obj;
+        return Objects.equals(toDelete, that.toDelete) &&
+                Objects.equals(clonedPrimitives, that.clonedPrimitives);
     }
 }
Index: trunk/src/org/openstreetmap/josm/command/MoveCommand.java
===================================================================
--- trunk/src/org/openstreetmap/josm/command/MoveCommand.java	(revision 9370)
+++ trunk/src/org/openstreetmap/josm/command/MoveCommand.java	(revision 9371)
@@ -9,4 +9,5 @@
 import java.util.LinkedList;
 import java.util.List;
+import java.util.Objects;
 
 import javax.swing.Icon;
@@ -246,54 +247,20 @@
     @Override
     public int hashCode() {
-        final int prime = 31;
-        int result = super.hashCode();
-        long temp;
-        temp = Double.doubleToLongBits(backupX);
-        result = prime * result + (int) (temp ^ (temp >>> 32));
-        temp = Double.doubleToLongBits(backupY);
-        result = prime * result + (int) (temp ^ (temp >>> 32));
-        result = prime * result + ((nodes == null) ? 0 : nodes.hashCode());
-        result = prime * result + ((oldState == null) ? 0 : oldState.hashCode());
-        result = prime * result + ((startEN == null) ? 0 : startEN.hashCode());
-        temp = Double.doubleToLongBits(x);
-        result = prime * result + (int) (temp ^ (temp >>> 32));
-        temp = Double.doubleToLongBits(y);
-        result = prime * result + (int) (temp ^ (temp >>> 32));
-        return result;
+        return Objects.hash(super.hashCode(), nodes, startEN, x, y, backupX, backupY, oldState);
     }
 
     @Override
     public boolean equals(Object obj) {
-        if (this == obj)
-            return true;
-        if (!super.equals(obj))
-            return false;
-        if (getClass() != obj.getClass())
-            return false;
-        MoveCommand other = (MoveCommand) obj;
-        if (Double.doubleToLongBits(backupX) != Double.doubleToLongBits(other.backupX))
-            return false;
-        if (Double.doubleToLongBits(backupY) != Double.doubleToLongBits(other.backupY))
-            return false;
-        if (nodes == null) {
-            if (other.nodes != null)
-                return false;
-        } else if (!nodes.equals(other.nodes))
-            return false;
-        if (oldState == null) {
-            if (other.oldState != null)
-                return false;
-        } else if (!oldState.equals(other.oldState))
-            return false;
-        if (startEN == null) {
-            if (other.startEN != null)
-                return false;
-        } else if (!startEN.equals(other.startEN))
-            return false;
-        if (Double.doubleToLongBits(x) != Double.doubleToLongBits(other.x))
-            return false;
-        if (Double.doubleToLongBits(y) != Double.doubleToLongBits(other.y))
-            return false;
-        return true;
+        if (this == obj) return true;
+        if (obj == null || getClass() != obj.getClass()) return false;
+        if (!super.equals(obj)) return false;
+        MoveCommand that = (MoveCommand) obj;
+        return Double.compare(that.x, x) == 0 &&
+                Double.compare(that.y, y) == 0 &&
+                Double.compare(that.backupX, backupX) == 0 &&
+                Double.compare(that.backupY, backupY) == 0 &&
+                Objects.equals(nodes, that.nodes) &&
+                Objects.equals(startEN, that.startEN) &&
+                Objects.equals(oldState, that.oldState);
     }
 }
Index: trunk/src/org/openstreetmap/josm/command/PurgeCommand.java
===================================================================
--- trunk/src/org/openstreetmap/josm/command/PurgeCommand.java	(revision 9370)
+++ trunk/src/org/openstreetmap/josm/command/PurgeCommand.java	(revision 9371)
@@ -11,4 +11,5 @@
 import java.util.List;
 import java.util.Map;
+import java.util.Objects;
 import java.util.Set;
 
@@ -279,49 +280,18 @@
     @Override
     public int hashCode() {
-        final int prime = 31;
-        int result = super.hashCode();
-        result = prime * result + ((ds == null) ? 0 : ds.hashCode());
-        result = prime * result + ((makeIncompleteData == null) ? 0 : makeIncompleteData.hashCode());
-        result = prime * result + ((makeIncompleteDataByPrimId == null) ? 0 : makeIncompleteDataByPrimId.hashCode());
-        result = prime * result + ((purgedConflicts == null) ? 0 : purgedConflicts.hashCode());
-        result = prime * result + ((toPurge == null) ? 0 : toPurge.hashCode());
-        return result;
+        return Objects.hash(super.hashCode(), toPurge, makeIncompleteData, makeIncompleteDataByPrimId, purgedConflicts, ds);
     }
 
     @Override
     public boolean equals(Object obj) {
-        if (this == obj)
-            return true;
-        if (!super.equals(obj))
-            return false;
-        if (getClass() != obj.getClass())
-            return false;
-        PurgeCommand other = (PurgeCommand) obj;
-        if (ds == null) {
-            if (other.ds != null)
-                return false;
-        } else if (!ds.equals(other.ds))
-            return false;
-        if (makeIncompleteData == null) {
-            if (other.makeIncompleteData != null)
-                return false;
-        } else if (!makeIncompleteData.equals(other.makeIncompleteData))
-            return false;
-        if (makeIncompleteDataByPrimId == null) {
-            if (other.makeIncompleteDataByPrimId != null)
-                return false;
-        } else if (!makeIncompleteDataByPrimId.equals(other.makeIncompleteDataByPrimId))
-            return false;
-        if (purgedConflicts == null) {
-            if (other.purgedConflicts != null)
-                return false;
-        } else if (!purgedConflicts.equals(other.purgedConflicts))
-            return false;
-        if (toPurge == null) {
-            if (other.toPurge != null)
-                return false;
-        } else if (!toPurge.equals(other.toPurge))
-            return false;
-        return true;
+        if (this == obj) return true;
+        if (obj == null || getClass() != obj.getClass()) return false;
+        if (!super.equals(obj)) return false;
+        PurgeCommand that = (PurgeCommand) obj;
+        return Objects.equals(toPurge, that.toPurge) &&
+                Objects.equals(makeIncompleteData, that.makeIncompleteData) &&
+                Objects.equals(makeIncompleteDataByPrimId, that.makeIncompleteDataByPrimId) &&
+                Objects.equals(purgedConflicts, that.purgedConflicts) &&
+                Objects.equals(ds, that.ds);
     }
 }
Index: trunk/src/org/openstreetmap/josm/command/RemoveNodesCommand.java
===================================================================
--- trunk/src/org/openstreetmap/josm/command/RemoveNodesCommand.java	(revision 9370)
+++ trunk/src/org/openstreetmap/josm/command/RemoveNodesCommand.java	(revision 9371)
@@ -7,4 +7,5 @@
 import java.util.HashSet;
 import java.util.List;
+import java.util.Objects;
 import java.util.Set;
 
@@ -65,31 +66,15 @@
     @Override
     public int hashCode() {
-        final int prime = 31;
-        int result = super.hashCode();
-        result = prime * result + ((rmNodes == null) ? 0 : rmNodes.hashCode());
-        result = prime * result + ((way == null) ? 0 : way.hashCode());
-        return result;
+        return Objects.hash(super.hashCode(), way, rmNodes);
     }
 
     @Override
     public boolean equals(Object obj) {
-        if (this == obj)
-            return true;
-        if (!super.equals(obj))
-            return false;
-        if (getClass() != obj.getClass())
-            return false;
-        RemoveNodesCommand other = (RemoveNodesCommand) obj;
-        if (rmNodes == null) {
-            if (other.rmNodes != null)
-                return false;
-        } else if (!rmNodes.equals(other.rmNodes))
-            return false;
-        if (way == null) {
-            if (other.way != null)
-                return false;
-        } else if (!way.equals(other.way))
-            return false;
-        return true;
+        if (this == obj) return true;
+        if (obj == null || getClass() != obj.getClass()) return false;
+        if (!super.equals(obj)) return false;
+        RemoveNodesCommand that = (RemoveNodesCommand) obj;
+        return Objects.equals(way, that.way) &&
+                Objects.equals(rmNodes, that.rmNodes);
     }
 }
Index: trunk/src/org/openstreetmap/josm/command/RotateCommand.java
===================================================================
--- trunk/src/org/openstreetmap/josm/command/RotateCommand.java	(revision 9370)
+++ trunk/src/org/openstreetmap/josm/command/RotateCommand.java	(revision 9371)
@@ -5,4 +5,5 @@
 
 import java.util.Collection;
+import java.util.Objects;
 
 import org.openstreetmap.josm.data.coor.EastNorth;
@@ -93,34 +94,16 @@
     @Override
     public int hashCode() {
-        final int prime = 31;
-        int result = super.hashCode();
-        result = prime * result + ((pivot == null) ? 0 : pivot.hashCode());
-        long temp;
-        temp = Double.doubleToLongBits(rotationAngle);
-        result = prime * result + (int) (temp ^ (temp >>> 32));
-        temp = Double.doubleToLongBits(startAngle);
-        result = prime * result + (int) (temp ^ (temp >>> 32));
-        return result;
+        return Objects.hash(super.hashCode(), pivot, startAngle, rotationAngle);
     }
 
     @Override
     public boolean equals(Object obj) {
-        if (this == obj)
-            return true;
-        if (!super.equals(obj))
-            return false;
-        if (getClass() != obj.getClass())
-            return false;
-        RotateCommand other = (RotateCommand) obj;
-        if (pivot == null) {
-            if (other.pivot != null)
-                return false;
-        } else if (!pivot.equals(other.pivot))
-            return false;
-        if (Double.doubleToLongBits(rotationAngle) != Double.doubleToLongBits(other.rotationAngle))
-            return false;
-        if (Double.doubleToLongBits(startAngle) != Double.doubleToLongBits(other.startAngle))
-            return false;
-        return true;
+        if (this == obj) return true;
+        if (obj == null || getClass() != obj.getClass()) return false;
+        if (!super.equals(obj)) return false;
+        RotateCommand that = (RotateCommand) obj;
+        return Double.compare(that.startAngle, startAngle) == 0 &&
+                Double.compare(that.rotationAngle, rotationAngle) == 0 &&
+                Objects.equals(pivot, that.pivot);
     }
 }
Index: trunk/src/org/openstreetmap/josm/command/ScaleCommand.java
===================================================================
--- trunk/src/org/openstreetmap/josm/command/ScaleCommand.java	(revision 9370)
+++ trunk/src/org/openstreetmap/josm/command/ScaleCommand.java	(revision 9371)
@@ -5,4 +5,5 @@
 
 import java.util.Collection;
+import java.util.Objects;
 
 import org.openstreetmap.josm.data.coor.EastNorth;
@@ -83,36 +84,16 @@
     @Override
     public int hashCode() {
-        final int prime = 31;
-        int result = super.hashCode();
-        result = prime * result + ((pivot == null) ? 0 : pivot.hashCode());
-        long temp;
-        temp = Double.doubleToLongBits(scalingFactor);
-        result = prime * result + (int) (temp ^ (temp >>> 32));
-        result = prime * result + ((startEN == null) ? 0 : startEN.hashCode());
-        return result;
+        return Objects.hash(super.hashCode(), pivot, scalingFactor, startEN);
     }
 
     @Override
     public boolean equals(Object obj) {
-        if (this == obj)
-            return true;
-        if (!super.equals(obj))
-            return false;
-        if (getClass() != obj.getClass())
-            return false;
-        ScaleCommand other = (ScaleCommand) obj;
-        if (pivot == null) {
-            if (other.pivot != null)
-                return false;
-        } else if (!pivot.equals(other.pivot))
-            return false;
-        if (Double.doubleToLongBits(scalingFactor) != Double.doubleToLongBits(other.scalingFactor))
-            return false;
-        if (startEN == null) {
-            if (other.startEN != null)
-                return false;
-        } else if (!startEN.equals(other.startEN))
-            return false;
-        return true;
+        if (this == obj) return true;
+        if (obj == null || getClass() != obj.getClass()) return false;
+        if (!super.equals(obj)) return false;
+        ScaleCommand that = (ScaleCommand) obj;
+        return Double.compare(that.scalingFactor, scalingFactor) == 0 &&
+                Objects.equals(pivot, that.pivot) &&
+                Objects.equals(startEN, that.startEN);
     }
 }
Index: trunk/src/org/openstreetmap/josm/command/SelectCommand.java
===================================================================
--- trunk/src/org/openstreetmap/josm/command/SelectCommand.java	(revision 9370)
+++ trunk/src/org/openstreetmap/josm/command/SelectCommand.java	(revision 9371)
@@ -5,4 +5,5 @@
 
 import java.util.Collection;
+import java.util.Objects;
 
 import org.openstreetmap.josm.Main;
@@ -54,31 +55,15 @@
     @Override
     public int hashCode() {
-        final int prime = 31;
-        int result = super.hashCode();
-        result = prime * result + ((newSelection == null) ? 0 : newSelection.hashCode());
-        result = prime * result + ((oldSelection == null) ? 0 : oldSelection.hashCode());
-        return result;
+        return Objects.hash(super.hashCode(), newSelection, oldSelection);
     }
 
     @Override
     public boolean equals(Object obj) {
-        if (this == obj)
-            return true;
-        if (!super.equals(obj))
-            return false;
-        if (getClass() != obj.getClass())
-            return false;
-        SelectCommand other = (SelectCommand) obj;
-        if (newSelection == null) {
-            if (other.newSelection != null)
-                return false;
-        } else if (!newSelection.equals(other.newSelection))
-            return false;
-        if (oldSelection == null) {
-            if (other.oldSelection != null)
-                return false;
-        } else if (!oldSelection.equals(other.oldSelection))
-            return false;
-        return true;
+        if (this == obj) return true;
+        if (obj == null || getClass() != obj.getClass()) return false;
+        if (!super.equals(obj)) return false;
+        SelectCommand that = (SelectCommand) obj;
+        return Objects.equals(newSelection, that.newSelection) &&
+                Objects.equals(oldSelection, that.oldSelection);
     }
 }
Index: trunk/src/org/openstreetmap/josm/command/SequenceCommand.java
===================================================================
--- trunk/src/org/openstreetmap/josm/command/SequenceCommand.java	(revision 9370)
+++ trunk/src/org/openstreetmap/josm/command/SequenceCommand.java	(revision 9371)
@@ -7,4 +7,5 @@
 import java.util.Collection;
 import java.util.HashSet;
+import java.util.Objects;
 
 import javax.swing.Icon;
@@ -126,34 +127,17 @@
     @Override
     public int hashCode() {
-        final int prime = 31;
-        int result = super.hashCode();
-        result = prime * result + (continueOnError ? 1231 : 1237);
-        result = prime * result + ((name == null) ? 0 : name.hashCode());
-        result = prime * result + Arrays.hashCode(sequence);
-        result = prime * result + (sequenceComplete ? 1231 : 1237);
-        return result;
+        return Objects.hash(super.hashCode(), sequence, sequenceComplete, name, continueOnError);
     }
 
     @Override
     public boolean equals(Object obj) {
-        if (this == obj)
-            return true;
-        if (!super.equals(obj))
-            return false;
-        if (getClass() != obj.getClass())
-            return false;
-        SequenceCommand other = (SequenceCommand) obj;
-        if (continueOnError != other.continueOnError)
-            return false;
-        if (name == null) {
-            if (other.name != null)
-                return false;
-        } else if (!name.equals(other.name))
-            return false;
-        if (!Arrays.equals(sequence, other.sequence))
-            return false;
-        if (sequenceComplete != other.sequenceComplete)
-            return false;
-        return true;
+        if (this == obj) return true;
+        if (obj == null || getClass() != obj.getClass()) return false;
+        if (!super.equals(obj)) return false;
+        SequenceCommand that = (SequenceCommand) obj;
+        return sequenceComplete == that.sequenceComplete &&
+                continueOnError == that.continueOnError &&
+                Arrays.equals(sequence, that.sequence) &&
+                Objects.equals(name, that.name);
     }
 }
Index: trunk/src/org/openstreetmap/josm/command/TransformNodesCommand.java
===================================================================
--- trunk/src/org/openstreetmap/josm/command/TransformNodesCommand.java	(revision 9370)
+++ trunk/src/org/openstreetmap/josm/command/TransformNodesCommand.java	(revision 9371)
@@ -8,4 +8,5 @@
 import java.util.LinkedList;
 import java.util.Map;
+import java.util.Objects;
 
 import javax.swing.Icon;
@@ -145,31 +146,15 @@
     @Override
     public int hashCode() {
-        final int prime = 31;
-        int result = super.hashCode();
-        result = prime * result + ((nodes == null) ? 0 : nodes.hashCode());
-        result = prime * result + ((oldStates == null) ? 0 : oldStates.hashCode());
-        return result;
+        return Objects.hash(super.hashCode(), nodes, oldStates);
     }
 
     @Override
     public boolean equals(Object obj) {
-        if (this == obj)
-            return true;
-        if (!super.equals(obj))
-            return false;
-        if (getClass() != obj.getClass())
-            return false;
-        TransformNodesCommand other = (TransformNodesCommand) obj;
-        if (nodes == null) {
-            if (other.nodes != null)
-                return false;
-        } else if (!nodes.equals(other.nodes))
-            return false;
-        if (oldStates == null) {
-            if (other.oldStates != null)
-                return false;
-        } else if (!oldStates.equals(other.oldStates))
-            return false;
-        return true;
+        if (this == obj) return true;
+        if (obj == null || getClass() != obj.getClass()) return false;
+        if (!super.equals(obj)) return false;
+        TransformNodesCommand that = (TransformNodesCommand) obj;
+        return Objects.equals(nodes, that.nodes) &&
+                Objects.equals(oldStates, that.oldStates);
     }
 }
Index: trunk/src/org/openstreetmap/josm/command/conflict/ConflictAddCommand.java
===================================================================
--- trunk/src/org/openstreetmap/josm/command/conflict/ConflictAddCommand.java	(revision 9370)
+++ trunk/src/org/openstreetmap/josm/command/conflict/ConflictAddCommand.java	(revision 9371)
@@ -5,4 +5,5 @@
 
 import java.util.Collection;
+import java.util.Objects;
 
 import javax.swing.Icon;
@@ -89,25 +90,14 @@
     @Override
     public int hashCode() {
-        final int prime = 31;
-        int result = super.hashCode();
-        result = prime * result + ((conflict == null) ? 0 : conflict.hashCode());
-        return result;
+        return Objects.hash(super.hashCode(), conflict);
     }
 
     @Override
     public boolean equals(Object obj) {
-        if (this == obj)
-            return true;
-        if (!super.equals(obj))
-            return false;
-        if (getClass() != obj.getClass())
-            return false;
-        ConflictAddCommand other = (ConflictAddCommand) obj;
-        if (conflict == null) {
-            if (other.conflict != null)
-                return false;
-        } else if (!conflict.equals(other.conflict))
-            return false;
-        return true;
+        if (this == obj) return true;
+        if (obj == null || getClass() != obj.getClass()) return false;
+        if (!super.equals(obj)) return false;
+        ConflictAddCommand that = (ConflictAddCommand) obj;
+        return Objects.equals(conflict, that.conflict);
     }
 }
Index: trunk/src/org/openstreetmap/josm/command/conflict/ConflictResolveCommand.java
===================================================================
--- trunk/src/org/openstreetmap/josm/command/conflict/ConflictResolveCommand.java	(revision 9370)
+++ trunk/src/org/openstreetmap/josm/command/conflict/ConflictResolveCommand.java	(revision 9371)
@@ -3,4 +3,6 @@
 
 import static org.openstreetmap.josm.tools.I18n.tr;
+
+import java.util.Objects;
 
 import org.openstreetmap.josm.Main;
@@ -84,25 +86,14 @@
     @Override
     public int hashCode() {
-        final int prime = 31;
-        int result = super.hashCode();
-        result = prime * result + ((resolvedConflicts == null) ? 0 : resolvedConflicts.hashCode());
-        return result;
+        return Objects.hash(super.hashCode(), resolvedConflicts);
     }
 
     @Override
     public boolean equals(Object obj) {
-        if (this == obj)
-            return true;
-        if (!super.equals(obj))
-            return false;
-        if (getClass() != obj.getClass())
-            return false;
-        ConflictResolveCommand other = (ConflictResolveCommand) obj;
-        if (resolvedConflicts == null) {
-            if (other.resolvedConflicts != null)
-                return false;
-        } else if (!resolvedConflicts.equals(other.resolvedConflicts))
-            return false;
-        return true;
+        if (this == obj) return true;
+        if (obj == null || getClass() != obj.getClass()) return false;
+        if (!super.equals(obj)) return false;
+        ConflictResolveCommand that = (ConflictResolveCommand) obj;
+        return Objects.equals(resolvedConflicts, that.resolvedConflicts);
     }
 }
Index: trunk/src/org/openstreetmap/josm/command/conflict/CoordinateConflictResolveCommand.java
===================================================================
--- trunk/src/org/openstreetmap/josm/command/conflict/CoordinateConflictResolveCommand.java	(revision 9370)
+++ trunk/src/org/openstreetmap/josm/command/conflict/CoordinateConflictResolveCommand.java	(revision 9371)
@@ -5,4 +5,5 @@
 
 import java.util.Collection;
+import java.util.Objects;
 
 import javax.swing.Icon;
@@ -76,28 +77,15 @@
     @Override
     public int hashCode() {
-        final int prime = 31;
-        int result = super.hashCode();
-        result = prime * result + ((conflict == null) ? 0 : conflict.hashCode());
-        result = prime * result + ((decision == null) ? 0 : decision.hashCode());
-        return result;
+        return Objects.hash(super.hashCode(), conflict, decision);
     }
 
     @Override
     public boolean equals(Object obj) {
-        if (this == obj)
-            return true;
-        if (!super.equals(obj))
-            return false;
-        if (getClass() != obj.getClass())
-            return false;
-        CoordinateConflictResolveCommand other = (CoordinateConflictResolveCommand) obj;
-        if (conflict == null) {
-            if (other.conflict != null)
-                return false;
-        } else if (!conflict.equals(other.conflict))
-            return false;
-        if (decision != other.decision)
-            return false;
-        return true;
+        if (this == obj) return true;
+        if (obj == null || getClass() != obj.getClass()) return false;
+        if (!super.equals(obj)) return false;
+        CoordinateConflictResolveCommand that = (CoordinateConflictResolveCommand) obj;
+        return Objects.equals(conflict, that.conflict) &&
+                decision == that.decision;
     }
 }
Index: trunk/src/org/openstreetmap/josm/command/conflict/DeletedStateConflictResolveCommand.java
===================================================================
--- trunk/src/org/openstreetmap/josm/command/conflict/DeletedStateConflictResolveCommand.java	(revision 9370)
+++ trunk/src/org/openstreetmap/josm/command/conflict/DeletedStateConflictResolveCommand.java	(revision 9371)
@@ -5,4 +5,5 @@
 
 import java.util.Collection;
+import java.util.Objects;
 import java.util.Set;
 
@@ -91,28 +92,15 @@
     @Override
     public int hashCode() {
-        final int prime = 31;
-        int result = super.hashCode();
-        result = prime * result + ((conflict == null) ? 0 : conflict.hashCode());
-        result = prime * result + ((decision == null) ? 0 : decision.hashCode());
-        return result;
+        return Objects.hash(super.hashCode(), conflict, decision);
     }
 
     @Override
     public boolean equals(Object obj) {
-        if (this == obj)
-            return true;
-        if (!super.equals(obj))
-            return false;
-        if (getClass() != obj.getClass())
-            return false;
-        DeletedStateConflictResolveCommand other = (DeletedStateConflictResolveCommand) obj;
-        if (conflict == null) {
-            if (other.conflict != null)
-                return false;
-        } else if (!conflict.equals(other.conflict))
-            return false;
-        if (decision != other.decision)
-            return false;
-        return true;
+        if (this == obj) return true;
+        if (obj == null || getClass() != obj.getClass()) return false;
+        if (!super.equals(obj)) return false;
+        DeletedStateConflictResolveCommand that = (DeletedStateConflictResolveCommand) obj;
+        return Objects.equals(conflict, that.conflict) &&
+                decision == that.decision;
     }
 }
Index: trunk/src/org/openstreetmap/josm/command/conflict/ModifiedConflictResolveCommand.java
===================================================================
--- trunk/src/org/openstreetmap/josm/command/conflict/ModifiedConflictResolveCommand.java	(revision 9370)
+++ trunk/src/org/openstreetmap/josm/command/conflict/ModifiedConflictResolveCommand.java	(revision 9371)
@@ -6,4 +6,5 @@
 
 import java.util.Collection;
+import java.util.Objects;
 
 import javax.swing.Icon;
@@ -67,25 +68,14 @@
     @Override
     public int hashCode() {
-        final int prime = 31;
-        int result = super.hashCode();
-        result = prime * result + ((conflict == null) ? 0 : conflict.hashCode());
-        return result;
+        return Objects.hash(super.hashCode(), conflict);
     }
 
     @Override
     public boolean equals(Object obj) {
-        if (this == obj)
-            return true;
-        if (!super.equals(obj))
-            return false;
-        if (getClass() != obj.getClass())
-            return false;
-        ModifiedConflictResolveCommand other = (ModifiedConflictResolveCommand) obj;
-        if (conflict == null) {
-            if (other.conflict != null)
-                return false;
-        } else if (!conflict.equals(other.conflict))
-            return false;
-        return true;
+        if (this == obj) return true;
+        if (obj == null || getClass() != obj.getClass()) return false;
+        if (!super.equals(obj)) return false;
+        ModifiedConflictResolveCommand that = (ModifiedConflictResolveCommand) obj;
+        return Objects.equals(conflict, that.conflict);
     }
 }
Index: trunk/src/org/openstreetmap/josm/command/conflict/RelationMemberConflictResolverCommand.java
===================================================================
--- trunk/src/org/openstreetmap/josm/command/conflict/RelationMemberConflictResolverCommand.java	(revision 9370)
+++ trunk/src/org/openstreetmap/josm/command/conflict/RelationMemberConflictResolverCommand.java	(revision 9371)
@@ -6,4 +6,5 @@
 import java.util.Collection;
 import java.util.List;
+import java.util.Objects;
 
 import javax.swing.Icon;
@@ -98,37 +99,16 @@
     @Override
     public int hashCode() {
-        final int prime = 31;
-        int result = super.hashCode();
-        result = prime * result + ((mergedMembers == null) ? 0 : mergedMembers.hashCode());
-        result = prime * result + ((my == null) ? 0 : my.hashCode());
-        result = prime * result + ((their == null) ? 0 : their.hashCode());
-        return result;
+        return Objects.hash(super.hashCode(), my, their, mergedMembers);
     }
 
     @Override
     public boolean equals(Object obj) {
-        if (this == obj)
-            return true;
-        if (!super.equals(obj))
-            return false;
-        if (getClass() != obj.getClass())
-            return false;
-        RelationMemberConflictResolverCommand other = (RelationMemberConflictResolverCommand) obj;
-        if (mergedMembers == null) {
-            if (other.mergedMembers != null)
-                return false;
-        } else if (!mergedMembers.equals(other.mergedMembers))
-            return false;
-        if (my == null) {
-            if (other.my != null)
-                return false;
-        } else if (!my.equals(other.my))
-            return false;
-        if (their == null) {
-            if (other.their != null)
-                return false;
-        } else if (!their.equals(other.their))
-            return false;
-        return true;
+        if (this == obj) return true;
+        if (obj == null || getClass() != obj.getClass()) return false;
+        if (!super.equals(obj)) return false;
+        RelationMemberConflictResolverCommand that = (RelationMemberConflictResolverCommand) obj;
+        return Objects.equals(my, that.my) &&
+                Objects.equals(their, that.their) &&
+                Objects.equals(mergedMembers, that.mergedMembers);
     }
 }
Index: trunk/src/org/openstreetmap/josm/command/conflict/TagConflictResolveCommand.java
===================================================================
--- trunk/src/org/openstreetmap/josm/command/conflict/TagConflictResolveCommand.java	(revision 9370)
+++ trunk/src/org/openstreetmap/josm/command/conflict/TagConflictResolveCommand.java	(revision 9371)
@@ -6,4 +6,5 @@
 import java.util.Collection;
 import java.util.List;
+import java.util.Objects;
 
 import javax.swing.Icon;
@@ -103,31 +104,15 @@
     @Override
     public int hashCode() {
-        final int prime = 31;
-        int result = super.hashCode();
-        result = prime * result + ((conflict == null) ? 0 : conflict.hashCode());
-        result = prime * result + ((mergeItems == null) ? 0 : mergeItems.hashCode());
-        return result;
+        return Objects.hash(super.hashCode(), conflict, mergeItems);
     }
 
     @Override
     public boolean equals(Object obj) {
-        if (this == obj)
-            return true;
-        if (!super.equals(obj))
-            return false;
-        if (getClass() != obj.getClass())
-            return false;
-        TagConflictResolveCommand other = (TagConflictResolveCommand) obj;
-        if (conflict == null) {
-            if (other.conflict != null)
-                return false;
-        } else if (!conflict.equals(other.conflict))
-            return false;
-        if (mergeItems == null) {
-            if (other.mergeItems != null)
-                return false;
-        } else if (!mergeItems.equals(other.mergeItems))
-            return false;
-        return true;
+        if (this == obj) return true;
+        if (obj == null || getClass() != obj.getClass()) return false;
+        if (!super.equals(obj)) return false;
+        TagConflictResolveCommand that = (TagConflictResolveCommand) obj;
+        return Objects.equals(conflict, that.conflict) &&
+                Objects.equals(mergeItems, that.mergeItems);
     }
 }
Index: trunk/src/org/openstreetmap/josm/command/conflict/VersionConflictResolveCommand.java
===================================================================
--- trunk/src/org/openstreetmap/josm/command/conflict/VersionConflictResolveCommand.java	(revision 9370)
+++ trunk/src/org/openstreetmap/josm/command/conflict/VersionConflictResolveCommand.java	(revision 9371)
@@ -6,4 +6,5 @@
 
 import java.util.Collection;
+import java.util.Objects;
 
 import javax.swing.Icon;
@@ -76,25 +77,14 @@
     @Override
     public int hashCode() {
-        final int prime = 31;
-        int result = super.hashCode();
-        result = prime * result + ((conflict == null) ? 0 : conflict.hashCode());
-        return result;
+        return Objects.hash(super.hashCode(), conflict);
     }
 
     @Override
     public boolean equals(Object obj) {
-        if (this == obj)
-            return true;
-        if (!super.equals(obj))
-            return false;
-        if (getClass() != obj.getClass())
-            return false;
-        VersionConflictResolveCommand other = (VersionConflictResolveCommand) obj;
-        if (conflict == null) {
-            if (other.conflict != null)
-                return false;
-        } else if (!conflict.equals(other.conflict))
-            return false;
-        return true;
+        if (this == obj) return true;
+        if (obj == null || getClass() != obj.getClass()) return false;
+        if (!super.equals(obj)) return false;
+        VersionConflictResolveCommand that = (VersionConflictResolveCommand) obj;
+        return Objects.equals(conflict, that.conflict);
     }
 }
Index: trunk/src/org/openstreetmap/josm/command/conflict/WayNodesConflictResolverCommand.java
===================================================================
--- trunk/src/org/openstreetmap/josm/command/conflict/WayNodesConflictResolverCommand.java	(revision 9370)
+++ trunk/src/org/openstreetmap/josm/command/conflict/WayNodesConflictResolverCommand.java	(revision 9371)
@@ -6,4 +6,5 @@
 import java.util.Collection;
 import java.util.List;
+import java.util.Objects;
 
 import javax.swing.Icon;
@@ -75,31 +76,15 @@
     @Override
     public int hashCode() {
-        final int prime = 31;
-        int result = super.hashCode();
-        result = prime * result + ((conflict == null) ? 0 : conflict.hashCode());
-        result = prime * result + ((mergedNodeList == null) ? 0 : mergedNodeList.hashCode());
-        return result;
+        return Objects.hash(super.hashCode(), conflict, mergedNodeList);
     }
 
     @Override
     public boolean equals(Object obj) {
-        if (this == obj)
-            return true;
-        if (!super.equals(obj))
-            return false;
-        if (getClass() != obj.getClass())
-            return false;
-        WayNodesConflictResolverCommand other = (WayNodesConflictResolverCommand) obj;
-        if (conflict == null) {
-            if (other.conflict != null)
-                return false;
-        } else if (!conflict.equals(other.conflict))
-            return false;
-        if (mergedNodeList == null) {
-            if (other.mergedNodeList != null)
-                return false;
-        } else if (!mergedNodeList.equals(other.mergedNodeList))
-            return false;
-        return true;
+        if (this == obj) return true;
+        if (obj == null || getClass() != obj.getClass()) return false;
+        if (!super.equals(obj)) return false;
+        WayNodesConflictResolverCommand that = (WayNodesConflictResolverCommand) obj;
+        return Objects.equals(conflict, that.conflict) &&
+                Objects.equals(mergedNodeList, that.mergedNodeList);
     }
 }
Index: trunk/src/org/openstreetmap/josm/data/Bounds.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/Bounds.java	(revision 9370)
+++ trunk/src/org/openstreetmap/josm/data/Bounds.java	(revision 9371)
@@ -7,4 +7,5 @@
 import java.text.DecimalFormat;
 import java.text.MessageFormat;
+import java.util.Objects;
 
 import org.openstreetmap.josm.data.coor.LatLon;
@@ -443,36 +444,16 @@
     @Override
     public int hashCode() {
-        final int prime = 31;
-        int result = 1;
-        long temp;
-        temp = Double.doubleToLongBits(maxLat);
-        result = prime * result + (int) (temp ^ (temp >>> 32));
-        temp = Double.doubleToLongBits(maxLon);
-        result = prime * result + (int) (temp ^ (temp >>> 32));
-        temp = Double.doubleToLongBits(minLat);
-        result = prime * result + (int) (temp ^ (temp >>> 32));
-        temp = Double.doubleToLongBits(minLon);
-        result = prime * result + (int) (temp ^ (temp >>> 32));
-        return result;
+        return Objects.hash(minLat, minLon, maxLat, maxLon);
     }
 
     @Override
     public boolean equals(Object obj) {
-        if (this == obj)
-            return true;
-        if (obj == null)
-            return false;
-        if (getClass() != obj.getClass())
-            return false;
-        Bounds other = (Bounds) obj;
-        if (Double.doubleToLongBits(maxLat) != Double.doubleToLongBits(other.maxLat))
-            return false;
-        if (Double.doubleToLongBits(maxLon) != Double.doubleToLongBits(other.maxLon))
-            return false;
-        if (Double.doubleToLongBits(minLat) != Double.doubleToLongBits(other.minLat))
-            return false;
-        if (Double.doubleToLongBits(minLon) != Double.doubleToLongBits(other.minLon))
-            return false;
-        return true;
+        if (this == obj) return true;
+        if (obj == null || getClass() != obj.getClass()) return false;
+        Bounds bounds = (Bounds) obj;
+        return Double.compare(bounds.minLat, minLat) == 0 &&
+                Double.compare(bounds.minLon, minLon) == 0 &&
+                Double.compare(bounds.maxLat, maxLat) == 0 &&
+                Double.compare(bounds.maxLon, maxLon) == 0;
     }
 }
Index: trunk/src/org/openstreetmap/josm/data/DataSource.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/DataSource.java	(revision 9370)
+++ trunk/src/org/openstreetmap/josm/data/DataSource.java	(revision 9371)
@@ -6,4 +6,5 @@
 import java.util.Collection;
 import java.util.List;
+import java.util.Objects;
 
 import org.openstreetmap.josm.tools.CheckParameterUtil;
@@ -40,31 +41,14 @@
     @Override
     public int hashCode() {
-        final int prime = 31;
-        int result = 1;
-        result = prime * result + ((bounds == null) ? 0 : bounds.hashCode());
-        result = prime * result + ((origin == null) ? 0 : origin.hashCode());
-        return result;
+        return Objects.hash(bounds, origin);
     }
 
     @Override
     public boolean equals(Object obj) {
-        if (this == obj)
-            return true;
-        if (obj == null)
-            return false;
-        if (getClass() != obj.getClass())
-            return false;
-        DataSource other = (DataSource) obj;
-        if (bounds == null) {
-            if (other.bounds != null)
-                return false;
-        } else if (!bounds.equals(other.bounds))
-            return false;
-        if (origin == null) {
-            if (other.origin != null)
-                return false;
-        } else if (!origin.equals(other.origin))
-            return false;
-        return true;
+        if (this == obj) return true;
+        if (obj == null || getClass() != obj.getClass()) return false;
+        DataSource that = (DataSource) obj;
+        return Objects.equals(bounds, that.bounds) &&
+                Objects.equals(origin, that.origin);
     }
 
Index: trunk/src/org/openstreetmap/josm/data/Preferences.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/Preferences.java	(revision 9370)
+++ trunk/src/org/openstreetmap/josm/data/Preferences.java	(revision 9371)
@@ -228,25 +228,13 @@
         @Override
         public int hashCode() {
-            final int prime = 31;
-            int result = 1;
-            result = prime * result + ((value == null) ? 0 : value.hashCode());
-            return result;
+            return Objects.hash(value);
         }
 
         @Override
         public boolean equals(Object obj) {
-            if (this == obj)
-                return true;
-            if (obj == null)
-                return false;
-            if (!(obj instanceof AbstractSetting))
-                return false;
-            AbstractSetting<?> other = (AbstractSetting<?>) obj;
-            if (value == null) {
-                if (other.value != null)
-                    return false;
-            } else if (!value.equals(other.value))
-                return false;
-            return true;
+            if (this == obj) return true;
+            if (obj == null || getClass() != obj.getClass()) return false;
+            AbstractSetting<?> that = (AbstractSetting<?>) obj;
+            return Objects.equals(value, that.value);
         }
     }
Index: trunk/src/org/openstreetmap/josm/data/conflict/Conflict.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/conflict/Conflict.java	(revision 9370)
+++ trunk/src/org/openstreetmap/josm/data/conflict/Conflict.java	(revision 9371)
@@ -3,4 +3,5 @@
 
 import java.util.Map;
+import java.util.Objects;
 
 import org.openstreetmap.josm.data.osm.OsmPrimitive;
@@ -84,26 +85,14 @@
     @Override
     public int hashCode() {
-        final int prime = 31;
-        int result = 1;
-        result = prime * result + ((my == null) ? 0 : my.hashCode());
-        result = prime * result + ((their == null) ? 0 : their.hashCode());
-        return result;
+        return Objects.hash(my, their);
     }
 
-    @SuppressWarnings("unchecked")
     @Override
     public boolean equals(Object obj) {
-        if (this == obj)
-            return true;
-        if (obj == null)
-            return false;
-        if (getClass() != obj.getClass())
-            return false;
-        Conflict<T> other = (Conflict<T>) obj;
-        if (my != other.my)
-            return false;
-        if (their != other.their)
-            return false;
-        return true;
+        if (this == obj) return true;
+        if (obj == null || getClass() != obj.getClass()) return false;
+        Conflict<?> conflict = (Conflict<?>) obj;
+        return Objects.equals(my, conflict.my) &&
+                Objects.equals(their, conflict.their);
     }
 
Index: trunk/src/org/openstreetmap/josm/data/conflict/ConflictCollection.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/conflict/ConflictCollection.java	(revision 9370)
+++ trunk/src/org/openstreetmap/josm/data/conflict/ConflictCollection.java	(revision 9371)
@@ -9,4 +9,5 @@
 import java.util.Iterator;
 import java.util.List;
+import java.util.Objects;
 import java.util.Set;
 import java.util.concurrent.CopyOnWriteArrayList;
@@ -386,31 +387,14 @@
     @Override
     public int hashCode() {
-        final int prime = 31;
-        int result = 1;
-        result = prime * result + ((conflicts == null) ? 0 : conflicts.hashCode());
-        result = prime * result + ((listeners == null) ? 0 : listeners.hashCode());
-        return result;
+        return Objects.hash(conflicts, listeners);
     }
 
     @Override
     public boolean equals(Object obj) {
-        if (this == obj)
-            return true;
-        if (obj == null)
-            return false;
-        if (getClass() != obj.getClass())
-            return false;
-        ConflictCollection other = (ConflictCollection) obj;
-        if (conflicts == null) {
-            if (other.conflicts != null)
-                return false;
-        } else if (!conflicts.equals(other.conflicts))
-            return false;
-        if (listeners == null) {
-            if (other.listeners != null)
-                return false;
-        } else if (!listeners.equals(other.listeners))
-            return false;
-        return true;
+        if (this == obj) return true;
+        if (obj == null || getClass() != obj.getClass()) return false;
+        ConflictCollection conflicts1 = (ConflictCollection) obj;
+        return Objects.equals(conflicts, conflicts1.conflicts) &&
+                Objects.equals(listeners, conflicts1.listeners);
     }
 }
Index: trunk/src/org/openstreetmap/josm/data/coor/Coordinate.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/coor/Coordinate.java	(revision 9370)
+++ trunk/src/org/openstreetmap/josm/data/coor/Coordinate.java	(revision 9371)
@@ -3,4 +3,5 @@
 
 import java.io.Serializable;
+import java.util.Objects;
 
 import org.openstreetmap.josm.data.osm.BBox;
@@ -113,32 +114,3 @@
     }
 
-    protected final int computeHashCode(int init) {
-        final int prime = 31;
-        int result = init;
-        long temp;
-        temp = java.lang.Double.doubleToLongBits(x);
-        result = prime * result + (int) (temp ^ (temp >>> 32));
-        temp = java.lang.Double.doubleToLongBits(y);
-        result = prime * result + (int) (temp ^ (temp >>> 32));
-        return result;
-    }
-
-    @Override
-    public int hashCode() {
-        return computeHashCode(1);
-    }
-
-    @Override
-    public boolean equals(Object obj) {
-        if (this == obj)
-            return true;
-        if (obj == null || getClass() != obj.getClass())
-            return false;
-        Coordinate other = (Coordinate) obj;
-        if (java.lang.Double.doubleToLongBits(x) != java.lang.Double.doubleToLongBits(other.x))
-            return false;
-        if (java.lang.Double.doubleToLongBits(y) != java.lang.Double.doubleToLongBits(other.y))
-            return false;
-        return true;
-    }
 }
Index: trunk/src/org/openstreetmap/josm/data/coor/LatLon.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/coor/LatLon.java	(revision 9370)
+++ trunk/src/org/openstreetmap/josm/data/coor/LatLon.java	(revision 9371)
@@ -16,4 +16,5 @@
 import java.util.Arrays;
 import java.util.Locale;
+import java.util.Objects;
 
 import org.openstreetmap.gui.jmapviewer.interfaces.ICoordinate;
@@ -428,21 +429,12 @@
     @Override
     public int hashCode() {
-        return computeHashCode(super.hashCode());
+        return Objects.hash(super.hashCode());
     }
 
     @Override
     public boolean equals(Object obj) {
-        if (this == obj)
-            return true;
-        if (!super.equals(obj))
-            return false;
-        if (getClass() != obj.getClass())
-            return false;
-        Coordinate other = (Coordinate) obj;
-        if (java.lang.Double.doubleToLongBits(x) != java.lang.Double.doubleToLongBits(other.x))
-            return false;
-        if (java.lang.Double.doubleToLongBits(y) != java.lang.Double.doubleToLongBits(other.y))
-            return false;
-        return true;
+        if (this == obj) return true;
+        if (obj == null || getClass() != obj.getClass()) return false;
+        return super.equals(obj);
     }
 
Index: trunk/src/org/openstreetmap/josm/data/imagery/ImageryInfo.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/imagery/ImageryInfo.java	(revision 9370)
+++ trunk/src/org/openstreetmap/josm/data/imagery/ImageryInfo.java	(revision 9371)
@@ -134,25 +134,14 @@
         @Override
         public int hashCode() {
-            final int prime = 31;
-            int result = super.hashCode();
-            result = prime * result + ((shapes == null) ? 0 : shapes.hashCode());
-            return result;
+            return Objects.hash(super.hashCode(), shapes);
         }
 
         @Override
-        public boolean equals(Object obj) {
-            if (this == obj)
-                return true;
-            if (!super.equals(obj))
-                return false;
-            if (getClass() != obj.getClass())
-                return false;
-            ImageryBounds other = (ImageryBounds) obj;
-            if (shapes == null) {
-                if (other.shapes != null)
-                    return false;
-            } else if (!shapes.equals(other.shapes))
-                return false;
-            return true;
+        public boolean equals(Object o) {
+            if (this == o) return true;
+            if (o == null || getClass() != o.getClass()) return false;
+            if (!super.equals(o)) return false;
+            ImageryBounds that = (ImageryBounds) o;
+            return Objects.equals(shapes, that.shapes);
         }
     }
@@ -457,15 +446,6 @@
 
     @Override
-    public boolean equals(Object o) {
-        if (this == o) return true;
-        if (o == null || getClass() != o.getClass()) return false;
-
-        ImageryInfo that = (ImageryInfo) o;
-
-        if (imageryType != that.imageryType) return false;
-        if (url != null ? !url.equals(that.url) : that.url != null) return false;
-        if (name != null ? !name.equals(that.name) : that.name != null) return false;
-
-        return true;
+    public int hashCode() {
+        return Objects.hash(url, imageryType);
     }
 
@@ -509,8 +489,9 @@
 
     @Override
-    public int hashCode() {
-        int result = url != null ? url.hashCode() : 0;
-        result = 31 * result + (imageryType != null ? imageryType.hashCode() : 0);
-        return result;
+    public boolean equals(Object o) {
+        if (this == o) return true;
+        if (o == null || getClass() != o.getClass()) return false;
+        ImageryInfo that = (ImageryInfo) o;
+        return imageryType == that.imageryType && Objects.equals(url, that.url);
     }
 
Index: trunk/src/org/openstreetmap/josm/data/imagery/Shape.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/imagery/Shape.java	(revision 9370)
+++ trunk/src/org/openstreetmap/josm/data/imagery/Shape.java	(revision 9371)
@@ -93,22 +93,13 @@
     @Override
     public int hashCode() {
-        int hash = 5;
-        hash = 47 * hash + Objects.hashCode(this.coords);
-        return hash;
+        return Objects.hash(coords);
     }
 
     @Override
     public boolean equals(Object obj) {
-        if (obj == null) {
-            return false;
-        }
-        if (getClass() != obj.getClass()) {
-            return false;
-        }
-        final Shape other = (Shape) obj;
-        if (!Objects.equals(this.coords, other.coords)) {
-            return false;
-        }
-        return true;
+        if (this == obj) return true;
+        if (obj == null || getClass() != obj.getClass()) return false;
+        Shape shape = (Shape) obj;
+        return Objects.equals(coords, shape.coords);
     }
 }
Index: trunk/src/org/openstreetmap/josm/data/notes/Note.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/notes/Note.java	(revision 9370)
+++ trunk/src/org/openstreetmap/josm/data/notes/Note.java	(revision 9371)
@@ -5,4 +5,5 @@
 import java.util.Date;
 import java.util.List;
+import java.util.Objects;
 
 import org.openstreetmap.josm.data.coor.LatLon;
@@ -104,23 +105,13 @@
     @Override
     public int hashCode() {
-        final int prime = 31;
-        int result = 1;
-        result = prime * result + (int) (id ^ (id >>> 32));
-        return result;
+        return Objects.hash(id);
     }
 
-    /** Compares notes by OSM ID */
     @Override
     public boolean equals(Object obj) {
-        if (this == obj)
-            return true;
-        if (obj == null)
-            return false;
-        if (getClass() != obj.getClass())
-            return false;
-        Note other = (Note) obj;
-        if (id != other.id)
-            return false;
-        return true;
+        if (this == obj) return true;
+        if (obj == null || getClass() != obj.getClass()) return false;
+        Note note = (Note) obj;
+        return id == note.id;
     }
 }
Index: trunk/src/org/openstreetmap/josm/data/oauth/OAuthToken.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/oauth/OAuthToken.java	(revision 9370)
+++ trunk/src/org/openstreetmap/josm/data/oauth/OAuthToken.java	(revision 9371)
@@ -1,4 +1,6 @@
 // License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.data.oauth;
+
+import java.util.Objects;
 
 import org.openstreetmap.josm.tools.CheckParameterUtil;
@@ -64,31 +66,14 @@
     @Override
     public int hashCode() {
-        final int prime = 31;
-        int result = 1;
-        result = prime * result + ((key == null) ? 0 : key.hashCode());
-        result = prime * result + ((secret == null) ? 0 : secret.hashCode());
-        return result;
+        return Objects.hash(key, secret);
     }
 
     @Override
     public boolean equals(Object obj) {
-        if (this == obj)
-            return true;
-        if (obj == null)
-            return false;
-        if (getClass() != obj.getClass())
-            return false;
-        OAuthToken other = (OAuthToken) obj;
-        if (key == null) {
-            if (other.key != null)
-                return false;
-        } else if (!key.equals(other.key))
-            return false;
-        if (secret == null) {
-            if (other.secret != null)
-                return false;
-        } else if (!secret.equals(other.secret))
-            return false;
-        return true;
+        if (this == obj) return true;
+        if (obj == null || getClass() != obj.getClass()) return false;
+        OAuthToken that = (OAuthToken) obj;
+        return Objects.equals(key, that.key) &&
+                Objects.equals(secret, that.secret);
     }
 }
Index: trunk/src/org/openstreetmap/josm/data/osm/BBox.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/osm/BBox.java	(revision 9370)
+++ trunk/src/org/openstreetmap/josm/data/osm/BBox.java	(revision 9371)
@@ -4,4 +4,5 @@
 import java.awt.geom.Rectangle2D;
 import java.util.Arrays;
+import java.util.Objects;
 
 import org.openstreetmap.josm.data.coor.LatLon;
Index: trunk/src/org/openstreetmap/josm/data/osm/Changeset.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/osm/Changeset.java	(revision 9370)
+++ trunk/src/org/openstreetmap/josm/data/osm/Changeset.java	(revision 9371)
@@ -9,4 +9,5 @@
 import java.util.List;
 import java.util.Map;
+import java.util.Objects;
 
 import org.openstreetmap.josm.data.Bounds;
@@ -278,22 +279,13 @@
     @Override
     public int hashCode() {
-        if (id > 0)
-            return id;
-        else
-            return super.hashCode();
+        return Objects.hash(id);
     }
 
     @Override
     public boolean equals(Object obj) {
-        if (this == obj)
-            return true;
-        if (obj == null)
-            return false;
-        if (getClass() != obj.getClass())
-            return false;
-        Changeset other = (Changeset) obj;
-        if (this.id > 0 && other.id == this.id)
-            return true;
-        return this == obj;
+        if (this == obj) return true;
+        if (obj == null || getClass() != obj.getClass()) return false;
+        Changeset changeset = (Changeset) obj;
+        return id == changeset.id;
     }
 
Index: trunk/src/org/openstreetmap/josm/data/osm/OsmPrimitive.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/osm/OsmPrimitive.java	(revision 9370)
+++ trunk/src/org/openstreetmap/josm/data/osm/OsmPrimitive.java	(revision 9371)
@@ -17,4 +17,5 @@
 import java.util.Locale;
 import java.util.Map;
+import java.util.Objects;
 import java.util.Set;
 
@@ -1320,7 +1321,8 @@
     @Override
     public boolean equals(Object obj) {
-        if (obj instanceof OsmPrimitive)
-            return ((OsmPrimitive) obj).id == id && obj.getClass() == getClass();
-        return false;
+        if (this == obj) return true;
+        if (obj == null || getClass() != obj.getClass()) return false;
+        OsmPrimitive that = (OsmPrimitive) obj;
+        return Objects.equals(id, that.id);
     }
 
@@ -1331,6 +1333,6 @@
      */
     @Override
-    public final int hashCode() {
-        return (int) id;
+    public int hashCode() {
+        return Objects.hash(id);
     }
 
Index: trunk/src/org/openstreetmap/josm/data/osm/RelationMember.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/osm/RelationMember.java	(revision 9370)
+++ trunk/src/org/openstreetmap/josm/data/osm/RelationMember.java	(revision 9371)
@@ -3,4 +3,5 @@
 
 import java.util.Arrays;
+import java.util.Objects;
 
 import org.openstreetmap.josm.tools.CheckParameterUtil;
@@ -165,18 +166,14 @@
     @Override
     public int hashCode() {
-        final int prime = 31;
-        int result = 1;
-        result = prime * result + member.hashCode();
-        result = prime * result + role.hashCode();
-        return result;
+        return Objects.hash(role, member);
     }
 
     @Override
     public boolean equals(Object obj) {
-        if (obj instanceof RelationMember) {
-            RelationMember other = (RelationMember) obj;
-            return member.equals(other.getMember()) && role.equals(other.getRole());
-        } else
-            return false;
+        if (this == obj) return true;
+        if (obj == null || getClass() != obj.getClass()) return false;
+        RelationMember that = (RelationMember) obj;
+        return Objects.equals(role, that.role) &&
+                Objects.equals(member, that.member);
     }
 
Index: trunk/src/org/openstreetmap/josm/data/osm/RelationMemberData.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/osm/RelationMemberData.java	(revision 9370)
+++ trunk/src/org/openstreetmap/josm/data/osm/RelationMemberData.java	(revision 9371)
@@ -1,4 +1,6 @@
 // License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.data.osm;
+
+import java.util.Objects;
 
 public class RelationMemberData implements PrimitiveId {
@@ -62,32 +64,15 @@
     @Override
     public int hashCode() {
-        final int prime = 31;
-        int result = 1;
-        result = prime * result + (int) (memberId ^ (memberId >>> 32));
-        result = prime * result
-                + ((memberType == null) ? 0 : memberType.hashCode());
-        result = prime * result + ((role == null) ? 0 : role.hashCode());
-        return result;
+        return Objects.hash(role, memberId, memberType);
     }
 
     @Override
     public boolean equals(Object obj) {
-        if (this == obj)
-            return true;
-        if (obj == null)
-            return false;
-        if (getClass() != obj.getClass())
-            return false;
-        RelationMemberData other = (RelationMemberData) obj;
-        if (memberId != other.memberId)
-            return false;
-        if (memberType != other.memberType)
-            return false;
-        if (role == null) {
-            if (other.role != null)
-                return false;
-        } else if (!role.equals(other.role))
-            return false;
-        return true;
+        if (this == obj) return true;
+        if (obj == null || getClass() != obj.getClass()) return false;
+        RelationMemberData that = (RelationMemberData) obj;
+        return memberId == that.memberId &&
+                Objects.equals(role, that.role) &&
+                memberType == that.memberType;
     }
 }
Index: trunk/src/org/openstreetmap/josm/data/osm/RelationToChildReference.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/osm/RelationToChildReference.java	(revision 9370)
+++ trunk/src/org/openstreetmap/josm/data/osm/RelationToChildReference.java	(revision 9371)
@@ -4,4 +4,5 @@
 import java.util.Collection;
 import java.util.HashSet;
+import java.util.Objects;
 import java.util.Set;
 
@@ -78,41 +79,17 @@
 
     @Override
-    public int hashCode() {
-        final int prime = 31;
-        int result = 1;
-        result = prime * result + ((child == null) ? 0 : child.hashCode());
-        result = prime * result + ((parent == null) ? 0 : parent.hashCode());
-        result = prime * result + position;
-        result = prime * result + ((role == null) ? 0 : role.hashCode());
-        return result;
+    public boolean equals(Object obj) {
+        if (this == obj) return true;
+        if (obj == null || getClass() != obj.getClass()) return false;
+        RelationToChildReference that = (RelationToChildReference) obj;
+        return position == that.position &&
+                Objects.equals(parent, that.parent) &&
+                Objects.equals(role, that.role) &&
+                Objects.equals(child, that.child);
     }
 
     @Override
-    public boolean equals(Object obj) {
-        if (this == obj)
-            return true;
-        if (obj == null)
-            return false;
-        if (getClass() != obj.getClass())
-            return false;
-        RelationToChildReference other = (RelationToChildReference) obj;
-        if (child == null) {
-            if (other.child != null)
-                return false;
-        } else if (!child.equals(other.child))
-            return false;
-        if (parent == null) {
-            if (other.parent != null)
-                return false;
-        } else if (!parent.equals(other.parent))
-            return false;
-        if (position != other.position)
-            return false;
-        if (role == null) {
-            if (other.role != null)
-                return false;
-        } else if (!role.equals(other.role))
-            return false;
-        return true;
+    public int hashCode() {
+        return Objects.hash(parent, position, role, child);
     }
 }
Index: trunk/src/org/openstreetmap/josm/data/osm/SimplePrimitiveId.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/osm/SimplePrimitiveId.java	(revision 9370)
+++ trunk/src/org/openstreetmap/josm/data/osm/SimplePrimitiveId.java	(revision 9371)
@@ -5,4 +5,5 @@
 import java.util.ArrayList;
 import java.util.List;
+import java.util.Objects;
 import java.util.regex.MatchResult;
 import java.util.regex.Matcher;
@@ -42,28 +43,14 @@
     @Override
     public int hashCode() {
-        final int prime = 31;
-        int result = 1;
-        result = prime * result + (int) (id ^ (id >>> 32));
-        result = prime * result + ((type == null) ? 0 : type.hashCode());
-        return result;
+        return Objects.hash(id, type);
     }
 
     @Override
     public boolean equals(Object obj) {
-        if (this == obj)
-            return true;
-        if (obj == null)
-            return false;
-        if (getClass() != obj.getClass())
-            return false;
-        SimplePrimitiveId other = (SimplePrimitiveId) obj;
-        if (id != other.id)
-            return false;
-        if (type == null) {
-            if (other.type != null)
-                return false;
-        } else if (!type.equals(other.type))
-            return false;
-        return true;
+        if (this == obj) return true;
+        if (obj == null || getClass() != obj.getClass()) return false;
+        SimplePrimitiveId that = (SimplePrimitiveId) obj;
+        return id == that.id &&
+                type == that.type;
     }
 
Index: trunk/src/org/openstreetmap/josm/data/osm/Tag.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/osm/Tag.java	(revision 9370)
+++ trunk/src/org/openstreetmap/josm/data/osm/Tag.java	(revision 9371)
@@ -1,4 +1,6 @@
 // License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.data.osm;
+
+import java.util.Objects;
 
 import org.openstreetmap.josm.tools.CheckParameterUtil;
@@ -84,18 +86,14 @@
     @Override
     public int hashCode() {
-        final int prime = 31;
-        int result = 1;
-        result = prime * result + key.hashCode();
-        result = prime * result + value.hashCode();
-        return result;
+        return Objects.hash(key, value);
     }
 
     @Override
     public boolean equals(Object obj) {
-        if (obj instanceof Tag) {
-            Tag other = (Tag) obj;
-            return key.equals(other.getKey()) && value.equals(other.getValue());
-        } else
-            return false;
+        if (this == obj) return true;
+        if (obj == null || getClass() != obj.getClass()) return false;
+        Tag tag = (Tag) obj;
+        return Objects.equals(key, tag.key) &&
+                Objects.equals(value, tag.value);
     }
 
Index: trunk/src/org/openstreetmap/josm/data/osm/User.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/osm/User.java	(revision 9370)
+++ trunk/src/org/openstreetmap/josm/data/osm/User.java	(revision 9371)
@@ -9,4 +9,5 @@
 import java.util.List;
 import java.util.Map;
+import java.util.Objects;
 import java.util.Set;
 
@@ -219,19 +220,13 @@
     @Override
     public int hashCode() {
-        final int prime = 31;
-        int result = 1;
-        result = prime * result + getName().hashCode();
-        result = prime * result + (int) (uid ^ (uid >>> 32));
-        return result;
+        return Objects.hash(uid);
     }
 
     @Override
     public boolean equals(Object obj) {
-        if (!(obj instanceof User))
-            return false;
-        User other = (User) obj;
-        if (uid != other.uid)
-            return false;
-        return true;
+        if (this == obj) return true;
+        if (obj == null || getClass() != obj.getClass()) return false;
+        User user = (User) obj;
+        return uid == user.uid;
     }
 
Index: trunk/src/org/openstreetmap/josm/data/osm/WaySegment.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/osm/WaySegment.java	(revision 9370)
+++ trunk/src/org/openstreetmap/josm/data/osm/WaySegment.java	(revision 9371)
@@ -3,4 +3,5 @@
 
 import java.awt.geom.Line2D;
+import java.util.Objects;
 
 /**
@@ -79,12 +80,14 @@
     @Override
     public boolean equals(Object o) {
-        return o instanceof WaySegment
-            && ((WaySegment) o).way == way
-            && ((WaySegment) o).lowerIndex == lowerIndex;
+        if (this == o) return true;
+        if (o == null || getClass() != o.getClass()) return false;
+        WaySegment that = (WaySegment) o;
+        return lowerIndex == that.lowerIndex &&
+                Objects.equals(way, that.way);
     }
 
     @Override
     public int hashCode() {
-        return way.hashCode() ^ lowerIndex;
+        return Objects.hash(way, lowerIndex);
     }
 
Index: trunk/src/org/openstreetmap/josm/data/osm/event/DatasetEventManager.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/osm/event/DatasetEventManager.java	(revision 9370)
+++ trunk/src/org/openstreetmap/josm/data/osm/event/DatasetEventManager.java	(revision 9371)
@@ -5,4 +5,5 @@
 import java.util.Arrays;
 import java.util.List;
+import java.util.Objects;
 import java.util.Queue;
 import java.util.concurrent.CopyOnWriteArrayList;
@@ -115,10 +116,13 @@
         @Override
         public int hashCode() {
-            return listener.hashCode();
+            return Objects.hash(listener);
         }
 
         @Override
         public boolean equals(Object o) {
-            return o instanceof ListenerInfo && ((ListenerInfo) o).listener == listener;
+            if (this == o) return true;
+            if (o == null || getClass() != o.getClass()) return false;
+            ListenerInfo that = (ListenerInfo) o;
+            return Objects.equals(listener, that.listener);
         }
     }
Index: trunk/src/org/openstreetmap/josm/data/osm/event/SelectionEventManager.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/osm/event/SelectionEventManager.java	(revision 9370)
+++ trunk/src/org/openstreetmap/josm/data/osm/event/SelectionEventManager.java	(revision 9371)
@@ -4,4 +4,5 @@
 import java.util.Collection;
 import java.util.List;
+import java.util.Objects;
 import java.util.concurrent.CopyOnWriteArrayList;
 
@@ -35,10 +36,13 @@
         @Override
         public int hashCode() {
-            return listener.hashCode();
+            return Objects.hash(listener);
         }
 
         @Override
         public boolean equals(Object o) {
-            return o instanceof ListenerInfo && ((ListenerInfo) o).listener == listener;
+            if (this == o) return true;
+            if (o == null || getClass() != o.getClass()) return false;
+            ListenerInfo that = (ListenerInfo) o;
+            return Objects.equals(listener, that.listener);
         }
     }
Index: trunk/src/org/openstreetmap/josm/data/osm/history/HistoryOsmPrimitive.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/osm/history/HistoryOsmPrimitive.java	(revision 9370)
+++ trunk/src/org/openstreetmap/josm/data/osm/history/HistoryOsmPrimitive.java	(revision 9371)
@@ -10,4 +10,5 @@
 import java.util.Locale;
 import java.util.Map;
+import java.util.Objects;
 
 import org.openstreetmap.josm.data.osm.Changeset;
@@ -249,25 +250,14 @@
     @Override
     public int hashCode() {
-        final int prime = 31;
-        int result = 1;
-        result = prime * result + (int) (id ^ (id >>> 32));
-        result = prime * result + (int) (version ^ (version >>> 32));
-        return result;
+        return Objects.hash(id, version);
     }
 
     @Override
     public boolean equals(Object obj) {
-        if (this == obj)
-            return true;
-        if (!(obj instanceof HistoryOsmPrimitive))
-            return false;
-        // equal semantics is valid for subclasses like {@link HistoryOsmNode} etc. too.
-        // So, don't enforce equality of class.
-        HistoryOsmPrimitive other = (HistoryOsmPrimitive) obj;
-        if (id != other.id)
-            return false;
-        if (version != other.version)
-            return false;
-        return true;
+        if (this == obj) return true;
+        if (obj == null || getClass() != obj.getClass()) return false;
+        HistoryOsmPrimitive that = (HistoryOsmPrimitive) obj;
+        return id == that.id &&
+                version == that.version;
     }
 
Index: trunk/src/org/openstreetmap/josm/data/validation/PaintVisitor.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/validation/PaintVisitor.java	(revision 9370)
+++ trunk/src/org/openstreetmap/josm/data/validation/PaintVisitor.java	(revision 9371)
@@ -7,4 +7,5 @@
 import java.util.HashSet;
 import java.util.List;
+import java.util.Objects;
 import java.util.Set;
 
@@ -58,25 +59,14 @@
         @Override
         public int hashCode() {
-            final int prime = 31;
-            int result = 1;
-            result = prime * result + p1.hashCode();
-            result = prime * result + color.hashCode();
-            return result;
+            return Objects.hash(p1, color);
         }
 
         @Override
         public boolean equals(Object obj) {
-            if (this == obj)
-                return true;
-            if (obj == null)
-                return false;
-            if (getClass() != obj.getClass())
-                return false;
-            PaintedPoint other = (PaintedPoint) obj;
-            if (!p1.equals(other.p1))
-                return false;
-            if (!color.equals(other.color))
-                return false;
-            return true;
+            if (this == obj) return true;
+            if (obj == null || getClass() != obj.getClass()) return false;
+            PaintedPoint that = (PaintedPoint) obj;
+            return Objects.equals(p1, that.p1) &&
+                    Objects.equals(color, that.color);
         }
     }
@@ -92,19 +82,14 @@
         @Override
         public int hashCode() {
-            final int prime = 31;
-            int result = super.hashCode();
-            result = prime * result + p2.hashCode();
-            return result;
+            return Objects.hash(super.hashCode(), p2);
         }
 
         @Override
         public boolean equals(Object obj) {
-            if (!super.equals(obj)) {
-                return false;
-            }
-            PaintedSegment other = (PaintedSegment) obj;
-            if (!p2.equals(other.p2))
-                return false;
-            return true;
+            if (this == obj) return true;
+            if (obj == null || getClass() != obj.getClass()) return false;
+            if (!super.equals(obj)) return false;
+            PaintedSegment that = (PaintedSegment) obj;
+            return Objects.equals(p2, that.p2);
         }
     }
Index: trunk/src/org/openstreetmap/josm/data/validation/Test.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/validation/Test.java	(revision 9370)
+++ trunk/src/org/openstreetmap/josm/data/validation/Test.java	(revision 9371)
@@ -8,4 +8,5 @@
 import java.util.Collection;
 import java.util.List;
+import java.util.Objects;
 
 import javax.swing.JCheckBox;
@@ -340,31 +341,14 @@
     @Override
     public int hashCode() {
-        final int prime = 31;
-        int result = 1;
-        result = prime * result + ((description == null) ? 0 : description.hashCode());
-        result = prime * result + ((name == null) ? 0 : name.hashCode());
-        return result;
+        return Objects.hash(name, description);
     }
 
     @Override
     public boolean equals(Object obj) {
-        if (this == obj)
-            return true;
-        if (obj == null)
-            return false;
-        if (!(obj instanceof Test))
-            return false;
-        Test other = (Test) obj;
-        if (description == null) {
-            if (other.description != null)
-                return false;
-        } else if (!description.equals(other.description))
-            return false;
-        if (name == null) {
-            if (other.name != null)
-                return false;
-        } else if (!name.equals(other.name))
-            return false;
-        return true;
+        if (this == obj) return true;
+        if (obj == null || getClass() != obj.getClass()) return false;
+        Test test = (Test) obj;
+        return Objects.equals(name, test.name) &&
+                Objects.equals(description, test.description);
     }
 }
Index: trunk/src/org/openstreetmap/josm/data/validation/tests/DuplicateRelation.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/validation/tests/DuplicateRelation.java	(revision 9370)
+++ trunk/src/org/openstreetmap/josm/data/validation/tests/DuplicateRelation.java	(revision 9371)
@@ -10,4 +10,5 @@
 import java.util.List;
 import java.util.Map;
+import java.util.Objects;
 import java.util.Set;
 
@@ -55,12 +56,17 @@
         @Override
         public int hashCode() {
-            return role.hashCode()+(int) relId+tags.hashCode()+type.hashCode()+coor.hashCode();
+            return Objects.hash(role, type, tags, coor, relId);
         }
 
         @Override
         public boolean equals(Object obj) {
-            if (!(obj instanceof RelMember)) return false;
-            RelMember rm = (RelMember) obj;
-            return rm.role.equals(role) && rm.type.equals(type) && rm.relId == relId && rm.tags.equals(tags) && rm.coor.equals(coor);
+            if (this == obj) return true;
+            if (obj == null || getClass() != obj.getClass()) return false;
+            RelMember relMember = (RelMember) obj;
+            return relId == relMember.relId &&
+                    Objects.equals(role, relMember.role) &&
+                    type == relMember.type &&
+                    Objects.equals(tags, relMember.tags) &&
+                    Objects.equals(coor, relMember.coor);
         }
 
@@ -117,12 +123,13 @@
         @Override
         public int hashCode() {
-            return members.hashCode();
+            return Objects.hash(members);
         }
 
         @Override
         public boolean equals(Object obj) {
-            if (!(obj instanceof RelationMembers)) return false;
-            RelationMembers rm = (RelationMembers) obj;
-            return rm.members.equals(members);
+            if (this == obj) return true;
+            if (obj == null || getClass() != obj.getClass()) return false;
+            RelationMembers that = (RelationMembers) obj;
+            return Objects.equals(members, that.members);
         }
     }
@@ -148,12 +155,14 @@
         @Override
         public int hashCode() {
-            return members.hashCode()+keys.hashCode();
+            return Objects.hash(members, keys);
         }
 
         @Override
         public boolean equals(Object obj) {
-            if (!(obj instanceof RelationPair)) return false;
-            RelationPair rp = (RelationPair) obj;
-            return rp.members.equals(members) && rp.keys.equals(keys);
+            if (this == obj) return true;
+            if (obj == null || getClass() != obj.getClass()) return false;
+            RelationPair that = (RelationPair) obj;
+            return Objects.equals(members, that.members) &&
+                    Objects.equals(keys, that.keys);
         }
     }
Index: trunk/src/org/openstreetmap/josm/data/validation/tests/DuplicateWay.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/validation/tests/DuplicateWay.java	(revision 9370)
+++ trunk/src/org/openstreetmap/josm/data/validation/tests/DuplicateWay.java	(revision 9371)
@@ -11,4 +11,5 @@
 import java.util.List;
 import java.util.Map;
+import java.util.Objects;
 import java.util.Set;
 
@@ -49,13 +50,14 @@
         @Override
         public int hashCode() {
-            return coor.hashCode() + keys.hashCode();
+            return Objects.hash(coor, keys);
         }
 
         @Override
         public boolean equals(Object obj) {
-            if (!(obj instanceof WayPair))
-                return false;
-            WayPair wp = (WayPair) obj;
-            return wp.coor.equals(coor) && wp.keys.equals(keys);
+            if (this == obj) return true;
+            if (obj == null || getClass() != obj.getClass()) return false;
+            WayPair wayPair = (WayPair) obj;
+            return Objects.equals(coor, wayPair.coor) &&
+                    Objects.equals(keys, wayPair.keys);
         }
     }
@@ -74,12 +76,13 @@
         @Override
         public int hashCode() {
-            return coor.hashCode();
+            return Objects.hash(coor);
         }
 
         @Override
         public boolean equals(Object obj) {
-            if (!(obj instanceof WayPairNoTags)) return false;
-            WayPairNoTags wp = (WayPairNoTags) obj;
-            return wp.coor.equals(coor);
+            if (this == obj) return true;
+            if (obj == null || getClass() != obj.getClass()) return false;
+            WayPairNoTags that = (WayPairNoTags) obj;
+            return Objects.equals(coor, that.coor);
         }
     }
Index: trunk/src/org/openstreetmap/josm/data/validation/tests/MapCSSTagChecker.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/validation/tests/MapCSSTagChecker.java	(revision 9370)
+++ trunk/src/org/openstreetmap/josm/data/validation/tests/MapCSSTagChecker.java	(revision 9371)
@@ -23,4 +23,5 @@
 import java.util.Locale;
 import java.util.Map;
+import java.util.Objects;
 import java.util.Set;
 import java.util.regex.Matcher;
@@ -95,31 +96,14 @@
         @Override
         public int hashCode() {
-            final int prime = 31;
-            int result = 1;
-            result = prime * result + ((declaration == null) ? 0 : declaration.hashCode());
-            result = prime * result + ((selectors == null) ? 0 : selectors.hashCode());
-            return result;
+            return Objects.hash(selectors, declaration);
         }
 
         @Override
         public boolean equals(Object obj) {
-            if (this == obj)
-                return true;
-            if (obj == null)
-                return false;
-            if (!(obj instanceof GroupedMapCSSRule))
-                return false;
-            GroupedMapCSSRule other = (GroupedMapCSSRule) obj;
-            if (declaration == null) {
-                if (other.declaration != null)
-                    return false;
-            } else if (!declaration.equals(other.declaration))
-                return false;
-            if (selectors == null) {
-                if (other.selectors != null)
-                    return false;
-            } else if (!selectors.equals(other.selectors))
-                return false;
-            return true;
+            if (this == obj) return true;
+            if (obj == null || getClass() != obj.getClass()) return false;
+            GroupedMapCSSRule that = (GroupedMapCSSRule) obj;
+            return Objects.equals(selectors, that.selectors) &&
+                    Objects.equals(declaration, that.declaration);
         }
 
@@ -660,8 +644,5 @@
         @Override
         public int hashCode() {
-            final int prime = 31;
-            int result = super.hashCode();
-            result = prime * result + ((rule == null) ? 0 : rule.hashCode());
-            return result;
+            return Objects.hash(super.hashCode(), rule);
         }
 
@@ -825,25 +806,14 @@
     @Override
     public synchronized int hashCode() {
-        final int prime = 31;
-        int result = super.hashCode();
-        result = prime * result + ((checks == null) ? 0 : checks.hashCode());
-        return result;
+        return Objects.hash(super.hashCode(), checks);
     }
 
     @Override
     public synchronized boolean equals(Object obj) {
-        if (this == obj)
-            return true;
-        if (!super.equals(obj))
-            return false;
-        if (!(obj instanceof MapCSSTagChecker))
-            return false;
-        MapCSSTagChecker other = (MapCSSTagChecker) obj;
-        if (checks == null) {
-            if (other.checks != null)
-                return false;
-        } else if (!checks.equals(other.checks))
-            return false;
-        return true;
+        if (this == obj) return true;
+        if (obj == null || getClass() != obj.getClass()) return false;
+        if (!super.equals(obj)) return false;
+        MapCSSTagChecker that = (MapCSSTagChecker) obj;
+        return Objects.equals(checks, that.checks);
     }
 }
Index: trunk/src/org/openstreetmap/josm/gui/conflict/tags/RelationMemberConflictDecision.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/conflict/tags/RelationMemberConflictDecision.java	(revision 9370)
+++ trunk/src/org/openstreetmap/josm/gui/conflict/tags/RelationMemberConflictDecision.java	(revision 9371)
@@ -4,4 +4,6 @@
 import static org.openstreetmap.josm.gui.conflict.tags.RelationMemberConflictDecisionType.UNDECIDED;
 import static org.openstreetmap.josm.tools.I18n.tr;
+
+import java.util.Objects;
 
 import org.openstreetmap.josm.data.osm.OsmPrimitive;
@@ -72,46 +74,17 @@
     @Override
     public int hashCode() {
-        final int prime = 31;
-        int result = 1;
-        result = prime * result + ((decision == null) ? 0 : decision.hashCode());
-        result = prime * result + ((originalPrimitive == null) ? 0 : originalPrimitive.hashCode());
-        result = prime * result + pos;
-        result = prime * result + ((relation == null) ? 0 : relation.hashCode());
-        result = prime * result + ((role == null) ? 0 : role.hashCode());
-        return result;
+        return Objects.hash(relation, pos, originalPrimitive, role, decision);
     }
 
     @Override
     public boolean equals(Object obj) {
-        if (this == obj)
-            return true;
-        if (obj == null)
-            return false;
-        if (getClass() != obj.getClass())
-            return false;
-        RelationMemberConflictDecision other = (RelationMemberConflictDecision) obj;
-        if (decision == null) {
-            if (other.decision != null)
-                return false;
-        } else if (!decision.equals(other.decision))
-            return false;
-        if (originalPrimitive == null) {
-            if (other.originalPrimitive != null)
-                return false;
-        } else if (!originalPrimitive.equals(other.originalPrimitive))
-            return false;
-        if (pos != other.pos)
-            return false;
-        if (relation == null) {
-            if (other.relation != null)
-                return false;
-        } else if (!relation.equals(other.relation))
-            return false;
-        if (role == null) {
-            if (other.role != null)
-                return false;
-        } else if (!role.equals(other.role))
-            return false;
-        return true;
+        if (this == obj) return true;
+        if (obj == null || getClass() != obj.getClass()) return false;
+        RelationMemberConflictDecision that = (RelationMemberConflictDecision) obj;
+        return pos == that.pos &&
+                Objects.equals(relation, that.relation) &&
+                Objects.equals(originalPrimitive, that.originalPrimitive) &&
+                Objects.equals(role, that.role) &&
+                decision == that.decision;
     }
 
Index: trunk/src/org/openstreetmap/josm/gui/dialogs/relation/RelationDialogManager.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/dialogs/relation/RelationDialogManager.java	(revision 9370)
+++ trunk/src/org/openstreetmap/josm/gui/dialogs/relation/RelationDialogManager.java	(revision 9371)
@@ -54,31 +54,14 @@
         @Override
         public int hashCode() {
-            final int prime = 31;
-            int result = 1;
-            result = prime * result + ((layer == null) ? 0 : layer.hashCode());
-            result = prime * result + ((relation == null) ? 0 : relation.hashCode());
-            return result;
+            return Objects.hash(relation, layer);
         }
 
         @Override
         public boolean equals(Object obj) {
-            if (this == obj)
-                return true;
-            if (obj == null)
-                return false;
-            if (getClass() != obj.getClass())
-                return false;
-            DialogContext other = (DialogContext) obj;
-            if (layer == null) {
-                if (other.layer != null)
-                    return false;
-            } else if (!layer.equals(other.layer))
-                return false;
-            if (relation == null) {
-                if (other.relation != null)
-                    return false;
-            } else if (!relation.equals(other.relation))
-                return false;
-            return true;
+            if (this == obj) return true;
+            if (obj == null || getClass() != obj.getClass()) return false;
+            DialogContext that = (DialogContext) obj;
+            return Objects.equals(relation, that.relation) &&
+                    Objects.equals(layer, that.layer);
         }
 
Index: trunk/src/org/openstreetmap/josm/gui/download/BookmarkList.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/download/BookmarkList.java	(revision 9370)
+++ trunk/src/org/openstreetmap/josm/gui/download/BookmarkList.java	(revision 9371)
@@ -12,4 +12,5 @@
 import java.util.List;
 import java.util.Locale;
+import java.util.Objects;
 
 import javax.swing.DefaultListModel;
@@ -79,31 +80,14 @@
         @Override
         public int hashCode() {
-            final int prime = 31;
-            int result = 1;
-            result = prime * result + ((area == null) ? 0 : area.hashCode());
-            result = prime * result + ((name == null) ? 0 : name.hashCode());
-            return result;
+            return Objects.hash(name, area);
         }
 
         @Override
         public boolean equals(Object obj) {
-            if (this == obj)
-                return true;
-            if (obj == null)
-                return false;
-            if (getClass() != obj.getClass())
-                return false;
-            Bookmark other = (Bookmark) obj;
-            if (area == null) {
-                if (other.area != null)
-                    return false;
-            } else if (!area.equals(other.area))
-                return false;
-            if (name == null) {
-                if (other.name != null)
-                    return false;
-            } else if (!name.equals(other.name))
-                return false;
-            return true;
+            if (this == obj) return true;
+            if (obj == null || getClass() != obj.getClass()) return false;
+            Bookmark bookmark = (Bookmark) obj;
+            return Objects.equals(name, bookmark.name) &&
+                    Objects.equals(area, bookmark.area);
         }
 
Index: trunk/src/org/openstreetmap/josm/gui/io/UploadStrategySpecification.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/io/UploadStrategySpecification.java	(revision 9370)
+++ trunk/src/org/openstreetmap/josm/gui/io/UploadStrategySpecification.java	(revision 9371)
@@ -1,4 +1,6 @@
 // License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.gui.io;
+
+import java.util.Objects;
 
 /**
@@ -107,37 +109,16 @@
     @Override
     public int hashCode() {
-        final int prime = 31;
-        int result = 1;
-        result = prime * result + chunkSize;
-        result = prime * result + (closeChangesetAfterUpload ? 1231 : 1237);
-        result = prime * result + ((policy == null) ? 0 : policy.hashCode());
-        result = prime * result + ((strategy == null) ? 0 : strategy.hashCode());
-        return result;
+        return Objects.hash(strategy, chunkSize, policy, closeChangesetAfterUpload);
     }
 
     @Override
     public boolean equals(Object obj) {
-        if (this == obj)
-            return true;
-        if (obj == null)
-            return false;
-        if (getClass() != obj.getClass())
-            return false;
-        UploadStrategySpecification other = (UploadStrategySpecification) obj;
-        if (chunkSize != other.chunkSize)
-            return false;
-        if (closeChangesetAfterUpload != other.closeChangesetAfterUpload)
-            return false;
-        if (policy == null) {
-            if (other.policy != null)
-                return false;
-        } else if (!policy.equals(other.policy))
-            return false;
-        if (strategy == null) {
-            if (other.strategy != null)
-                return false;
-        } else if (!strategy.equals(other.strategy))
-            return false;
-        return true;
+        if (this == obj) return true;
+        if (obj == null || getClass() != obj.getClass()) return false;
+        UploadStrategySpecification that = (UploadStrategySpecification) obj;
+        return chunkSize == that.chunkSize &&
+                closeChangesetAfterUpload == that.closeChangesetAfterUpload &&
+                strategy == that.strategy &&
+                policy == that.policy;
     }
 }
Index: trunk/src/org/openstreetmap/josm/gui/mappaint/DividedScale.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/mappaint/DividedScale.java	(revision 9370)
+++ trunk/src/org/openstreetmap/josm/gui/mappaint/DividedScale.java	(revision 9371)
@@ -4,4 +4,5 @@
 import java.util.ArrayList;
 import java.util.List;
+import java.util.Objects;
 
 import org.openstreetmap.josm.gui.mappaint.styleelement.StyleElement;
@@ -176,16 +177,14 @@
     @Override
     public boolean equals(Object obj) {
-        if (obj == null || getClass() != obj.getClass())
-            return false;
-        final DividedScale other = (DividedScale) obj;
-        return bd.equals(other.bd) && data.equals(other.data);
+        if (this == obj) return true;
+        if (obj == null || getClass() != obj.getClass()) return false;
+        DividedScale<?> that = (DividedScale<?>) obj;
+        return Objects.equals(bd, that.bd) &&
+                Objects.equals(data, that.data);
     }
 
     @Override
     public int hashCode() {
-        int hash = 7;
-        hash = 23 * hash + bd.hashCode();
-        hash = 23 * hash + data.hashCode();
-        return hash;
+        return Objects.hash(bd, data);
     }
 
Index: trunk/src/org/openstreetmap/josm/gui/mappaint/Keyword.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/mappaint/Keyword.java	(revision 9370)
+++ trunk/src/org/openstreetmap/josm/gui/mappaint/Keyword.java	(revision 9371)
@@ -19,12 +19,13 @@
     @Override
     public boolean equals(Object obj) {
-        if (obj == null || getClass() != obj.getClass())
-            return false;
-        return Objects.equals(val, ((Keyword) obj).val);
+        if (this == obj) return true;
+        if (obj == null || getClass() != obj.getClass()) return false;
+        Keyword keyword = (Keyword) obj;
+        return Objects.equals(val, keyword.val);
     }
 
     @Override
     public int hashCode() {
-        return val.hashCode();
+        return Objects.hash(val);
     }
 
Index: trunk/src/org/openstreetmap/josm/gui/mappaint/Range.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/mappaint/Range.java	(revision 9370)
+++ trunk/src/org/openstreetmap/josm/gui/mappaint/Range.java	(revision 9371)
@@ -1,4 +1,6 @@
 // License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.gui.mappaint;
+
+import java.util.Objects;
 
 /**
@@ -91,22 +93,12 @@
         if (this == o) return true;
         if (o == null || getClass() != o.getClass()) return false;
-
         Range range = (Range) o;
-
-        if (Double.compare(range.lower, lower) != 0) return false;
-        if (Double.compare(range.upper, upper) != 0) return false;
-
-        return true;
+        return Double.compare(range.lower, lower) == 0 &&
+                Double.compare(range.upper, upper) == 0;
     }
 
     @Override
     public int hashCode() {
-        int result;
-        long temp;
-        temp = Double.doubleToLongBits(lower);
-        result = (int) (temp ^ (temp >>> 32));
-        temp = Double.doubleToLongBits(upper);
-        result = 31 * result + (int) (temp ^ (temp >>> 32));
-        return result;
+        return Objects.hash(lower, upper);
     }
 }
Index: trunk/src/org/openstreetmap/josm/gui/mappaint/StyleElementList.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/mappaint/StyleElementList.java	(revision 9370)
+++ trunk/src/org/openstreetmap/josm/gui/mappaint/StyleElementList.java	(revision 9371)
@@ -57,15 +57,13 @@
     @Override
     public boolean equals(Object obj) {
-        if (obj == null || getClass() != obj.getClass()) {
-            return false;
-        }
-        final StyleElementList other = (StyleElementList) obj;
-        return Objects.equals(lst, other.lst);
+        if (this == obj) return true;
+        if (obj == null || getClass() != obj.getClass()) return false;
+        StyleElementList that = (StyleElementList) obj;
+        return Objects.equals(lst, that.lst);
     }
 
     @Override
     public int hashCode() {
-        return lst.hashCode();
+        return Objects.hash(lst);
     }
-
 }
Index: trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSRule.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSRule.java	(revision 9370)
+++ trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSRule.java	(revision 9371)
@@ -3,4 +3,5 @@
 
 import java.util.List;
+import java.util.Objects;
 
 import org.openstreetmap.josm.gui.mappaint.Environment;
@@ -42,28 +43,14 @@
         @Override
         public int hashCode() {
-            final int prime = 31;
-            int result = 1;
-            result = prime * result + idx;
-            result = prime * result + ((instructions == null) ? 0 : instructions.hashCode());
-            return result;
+            return Objects.hash(instructions, idx);
         }
 
         @Override
         public boolean equals(Object obj) {
-            if (this == obj)
-                return true;
-            if (obj == null)
-                return false;
-            if (!(obj instanceof Declaration))
-                return false;
-            Declaration other = (Declaration) obj;
-            if (idx != other.idx)
-                return false;
-            if (instructions == null) {
-                if (other.instructions != null)
-                    return false;
-            } else if (!instructions.equals(other.instructions))
-                return false;
-            return true;
+            if (this == obj) return true;
+            if (obj == null || getClass() != obj.getClass()) return false;
+            Declaration that = (Declaration) obj;
+            return idx == that.idx &&
+                    Objects.equals(instructions, that.instructions);
         }
 
Index: trunk/src/org/openstreetmap/josm/gui/mappaint/styleelement/AreaElement.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/mappaint/styleelement/AreaElement.java	(revision 9370)
+++ trunk/src/org/openstreetmap/josm/gui/mappaint/styleelement/AreaElement.java	(revision 9371)
@@ -117,32 +117,18 @@
     @Override
     public boolean equals(Object obj) {
-        if (obj == null || getClass() != obj.getClass())
-            return false;
-        if (!super.equals(obj))
-            return false;
-        AreaElement other = (AreaElement) obj;
-        // we should get the same image object due to caching
-        if (!Objects.equals(fillImage, other.fillImage))
-            return false;
-        if (!Objects.equals(color, other.color))
-            return false;
-        if (!Objects.equals(extent, other.extent))
-            return false;
-        if (!Objects.equals(extentThreshold, other.extentThreshold))
-            return false;
-        if (!Objects.equals(text, other.text))
-            return false;
-        return true;
+        if (this == obj) return true;
+        if (obj == null || getClass() != obj.getClass()) return false;
+        if (!super.equals(obj)) return false;
+        AreaElement that = (AreaElement) obj;
+        return Objects.equals(color, that.color) &&
+                Objects.equals(fillImage, that.fillImage) &&
+                Objects.equals(text, that.text) &&
+                Objects.equals(extent, that.extent) &&
+                Objects.equals(extentThreshold, that.extentThreshold);
     }
 
     @Override
     public int hashCode() {
-        int hash = super.hashCode();
-        hash = 61 * hash + color.hashCode();
-        hash = 61 * hash + (extent != null ? Float.floatToIntBits(extent) : 0);
-        hash = 61 * hash + (extentThreshold != null ? Float.floatToIntBits(extentThreshold) : 0);
-        hash = 61 * hash + (fillImage != null ? fillImage.hashCode() : 0);
-        hash = 61 * hash + (text != null ? text.hashCode() : 0);
-        return hash;
+        return Objects.hash(super.hashCode(), color, fillImage, text, extent, extentThreshold);
     }
 
Index: trunk/src/org/openstreetmap/josm/gui/mappaint/styleelement/BoxTextElement.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/mappaint/styleelement/BoxTextElement.java	(revision 9370)
+++ trunk/src/org/openstreetmap/josm/gui/mappaint/styleelement/BoxTextElement.java	(revision 9371)
@@ -4,4 +4,5 @@
 import java.awt.Color;
 import java.awt.Rectangle;
+import java.util.Objects;
 
 import org.openstreetmap.josm.data.osm.Node;
@@ -73,15 +74,13 @@
         @Override
         public int hashCode() {
-            return box.hashCode();
+            return Objects.hash(box);
         }
 
         @Override
         public boolean equals(Object obj) {
-            if (!(obj instanceof BoxProvider))
-                return false;
-            final BoxProvider other = (BoxProvider) obj;
-            BoxProviderResult resultOther = other.get();
-            if (resultOther.isTemporary()) return false;
-            return box.equals(resultOther.getBox());
+            if (this == obj) return true;
+            if (obj == null || getClass() != obj.getClass()) return false;
+            SimpleBoxProvider that = (SimpleBoxProvider) obj;
+            return Objects.equals(box, that.box);
         }
     }
@@ -207,34 +206,18 @@
     @Override
     public boolean equals(Object obj) {
-        if (!super.equals(obj))
-            return false;
-        if (obj == null || getClass() != obj.getClass())
-            return false;
-        final BoxTextElement other = (BoxTextElement) obj;
-        if (!text.equals(other.text)) return false;
-        if (boxProvider != null) {
-            if (!boxProvider.equals(other.boxProvider)) return false;
-        } else if (other.boxProvider != null)
-            return false;
-        else {
-            if (!box.equals(other.box)) return false;
-        }
-        if (hAlign != other.hAlign) return false;
-        if (vAlign != other.vAlign) return false;
-        return true;
+        if (this == obj) return true;
+        if (obj == null || getClass() != obj.getClass()) return false;
+        if (!super.equals(obj)) return false;
+        BoxTextElement that = (BoxTextElement) obj;
+        return Objects.equals(text, that.text) &&
+                Objects.equals(boxProvider, that.boxProvider) &&
+                Objects.equals(box, that.box) &&
+                hAlign == that.hAlign &&
+                vAlign == that.vAlign;
     }
 
     @Override
     public int hashCode() {
-        int hash = super.hashCode();
-        hash = 97 * hash + text.hashCode();
-        if (boxProvider != null) {
-            hash = 97 * hash + boxProvider.hashCode();
-        } else {
-            hash = 97 * hash + box.hashCode();
-        }
-        hash = 97 * hash + hAlign.hashCode();
-        hash = 97 * hash + vAlign.hashCode();
-        return hash;
+        return Objects.hash(super.hashCode(), text, boxProvider, box, hAlign, vAlign);
     }
 
Index: trunk/src/org/openstreetmap/josm/gui/mappaint/styleelement/LabelCompositionStrategy.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/mappaint/styleelement/LabelCompositionStrategy.java	(revision 9370)
+++ trunk/src/org/openstreetmap/josm/gui/mappaint/styleelement/LabelCompositionStrategy.java	(revision 9371)
@@ -6,4 +6,5 @@
 import java.util.Collections;
 import java.util.List;
+import java.util.Objects;
 
 import org.openstreetmap.josm.Main;
@@ -70,25 +71,13 @@
         @Override
         public int hashCode() {
-            final int prime = 31;
-            int result = 1;
-            result = prime * result + ((defaultLabel == null) ? 0 : defaultLabel.hashCode());
-            return result;
+            return Objects.hash(defaultLabel);
         }
 
         @Override
         public boolean equals(Object obj) {
-            if (this == obj)
-                return true;
-            if (obj == null)
-                return false;
-            if (getClass() != obj.getClass())
-                return false;
-            StaticLabelCompositionStrategy other = (StaticLabelCompositionStrategy) obj;
-            if (defaultLabel == null) {
-                if (other.defaultLabel != null)
-                    return false;
-            } else if (!defaultLabel.equals(other.defaultLabel))
-                return false;
-            return true;
+            if (this == obj) return true;
+            if (obj == null || getClass() != obj.getClass()) return false;
+            StaticLabelCompositionStrategy that = (StaticLabelCompositionStrategy) obj;
+            return Objects.equals(defaultLabel, that.defaultLabel);
         }
     }
@@ -126,25 +115,13 @@
         @Override
         public int hashCode() {
-            final int prime = 31;
-            int result = 1;
-            result = prime * result + ((defaultLabelTag == null) ? 0 : defaultLabelTag.hashCode());
-            return result;
+            return Objects.hash(defaultLabelTag);
         }
 
         @Override
         public boolean equals(Object obj) {
-            if (this == obj)
-                return true;
-            if (obj == null)
-                return false;
-            if (getClass() != obj.getClass())
-                return false;
-            TagLookupCompositionStrategy other = (TagLookupCompositionStrategy) obj;
-            if (defaultLabelTag == null) {
-                if (other.defaultLabelTag != null)
-                    return false;
-            } else if (!defaultLabelTag.equals(other.defaultLabelTag))
-                return false;
-            return true;
+            if (this == obj) return true;
+            if (obj == null || getClass() != obj.getClass()) return false;
+            TagLookupCompositionStrategy that = (TagLookupCompositionStrategy) obj;
+            return Objects.equals(defaultLabelTag, that.defaultLabelTag);
         }
     }
Index: trunk/src/org/openstreetmap/josm/gui/mappaint/styleelement/LineElement.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/mappaint/styleelement/LineElement.java	(revision 9370)
+++ trunk/src/org/openstreetmap/josm/gui/mappaint/styleelement/LineElement.java	(revision 9371)
@@ -359,13 +359,5 @@
     @Override
     public int hashCode() {
-        int hash = super.hashCode();
-        hash = 29 * hash + line.hashCode();
-        hash = 29 * hash + color.hashCode();
-        hash = 29 * hash + (dashesLine != null ? dashesLine.hashCode() : 0);
-        hash = 29 * hash + (dashesBackground != null ? dashesBackground.hashCode() : 0);
-        hash = 29 * hash + Float.floatToIntBits(offset);
-        hash = 29 * hash + Float.floatToIntBits(realWidth);
-        hash = 29 * hash + (this.wayDirectionArrows ? 1 : 0);
-        return hash;
+        return Objects.hash(super.hashCode(), line, color, dashesBackground, offset, realWidth, wayDirectionArrows, dashesLine);
     }
 
Index: trunk/src/org/openstreetmap/josm/gui/mappaint/styleelement/LineTextElement.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/mappaint/styleelement/LineTextElement.java	(revision 9370)
+++ trunk/src/org/openstreetmap/josm/gui/mappaint/styleelement/LineTextElement.java	(revision 9371)
@@ -44,17 +44,14 @@
     @Override
     public boolean equals(Object obj) {
-        if (obj == null || getClass() != obj.getClass())
-            return false;
-        if (!super.equals(obj))
-            return false;
-        final LineTextElement other = (LineTextElement) obj;
-        return Objects.equals(text, other.text);
+        if (this == obj) return true;
+        if (obj == null || getClass() != obj.getClass()) return false;
+        if (!super.equals(obj)) return false;
+        LineTextElement that = (LineTextElement) obj;
+        return Objects.equals(text, that.text);
     }
 
     @Override
     public int hashCode() {
-        int hash = super.hashCode();
-        hash = 43 * hash + text.hashCode();
-        return hash;
+        return Objects.hash(super.hashCode(), text);
     }
 
Index: trunk/src/org/openstreetmap/josm/gui/mappaint/styleelement/MapImage.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/mappaint/styleelement/MapImage.java	(revision 9370)
+++ trunk/src/org/openstreetmap/josm/gui/mappaint/styleelement/MapImage.java	(revision 9371)
@@ -217,26 +217,18 @@
     @Override
     public boolean equals(Object obj) {
-        if (obj == null || getClass() != obj.getClass())
-            return false;
-        final MapImage other = (MapImage) obj;
-        // img changes when image is fully loaded and can't be used for equality check.
-        return  alpha == other.alpha &&
-                Objects.equals(name, other.name) &&
-                Objects.equals(source, other.source) &&
-                autoRescale == other.autoRescale &&
-                width == other.width &&
-                height == other.height;
+        if (this == obj) return true;
+        if (obj == null || getClass() != obj.getClass()) return false;
+        MapImage mapImage = (MapImage) obj;
+        return alpha == mapImage.alpha &&
+                autoRescale == mapImage.autoRescale &&
+                width == mapImage.width &&
+                height == mapImage.height &&
+                Objects.equals(name, mapImage.name) &&
+                Objects.equals(source, mapImage.source);
     }
 
     @Override
     public int hashCode() {
-        int hash = 7;
-        hash = 67 * hash + alpha;
-        hash = 67 * hash + name.hashCode();
-        hash = 67 * hash + source.hashCode();
-        hash = 67 * hash + (autoRescale ? 1 : 0);
-        hash = 67 * hash + width;
-        hash = 67 * hash + height;
-        return hash;
+        return Objects.hash(alpha, name, source, autoRescale, width, height);
     }
 
Index: trunk/src/org/openstreetmap/josm/gui/mappaint/styleelement/NodeElement.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/mappaint/styleelement/NodeElement.java	(revision 9370)
+++ trunk/src/org/openstreetmap/josm/gui/mappaint/styleelement/NodeElement.java	(revision 9371)
@@ -68,11 +68,5 @@
         @Override
         public int hashCode() {
-            int hash = 7;
-            hash = 67 * hash + symbol.hashCode();
-            hash = 67 * hash + size;
-            hash = 67 * hash + (stroke != null ? stroke.hashCode() : 0);
-            hash = 67 * hash + (strokeColor != null ? strokeColor.hashCode() : 0);
-            hash = 67 * hash + (fillColor != null ? fillColor.hashCode() : 0);
-            return hash;
+            return Objects.hash(symbol, size, stroke, strokeColor, fillColor);
         }
 
@@ -364,30 +358,20 @@
     @Override
     public int hashCode() {
-        int hash = super.hashCode();
-        hash = 17 * hash + (mapImage != null ? mapImage.hashCode() : 0);
-        hash = 17 * hash + (symbol != null ? symbol.hashCode() : 0);
-        hash = 17 * hash + (mapImageAngle != null ? mapImageAngle.hashCode() : 0);
-        return hash;
+        return Objects.hash(super.hashCode(), mapImage, mapImageAngle, symbol);
     }
 
     @Override
     public boolean equals(Object obj) {
-        if (obj == null || getClass() != obj.getClass())
-            return false;
-        if (!super.equals(obj))
-            return false;
-
-        final NodeElement other = (NodeElement) obj;
-        // we should get the same image object due to caching
-        if (!Objects.equals(mapImage, other.mapImage))
-            return false;
-        if (!Objects.equals(symbol, other.symbol))
-            return false;
-        if (!Objects.equals(mapImageAngle, other.mapImageAngle))
-            return false;
-        return true;
+        if (this == obj) return true;
+        if (obj == null || getClass() != obj.getClass()) return false;
+        if (!super.equals(obj)) return false;
+        NodeElement that = (NodeElement) obj;
+        return Objects.equals(mapImage, that.mapImage) &&
+                Objects.equals(mapImageAngle, that.mapImageAngle) &&
+                Objects.equals(symbol, that.symbol);
     }
 
     @Override
+
     public String toString() {
         StringBuilder s = new StringBuilder("NodeElemStyle{");
Index: trunk/src/org/openstreetmap/josm/gui/mappaint/styleelement/RepeatImageElement.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/mappaint/styleelement/RepeatImageElement.java	(revision 9370)
+++ trunk/src/org/openstreetmap/josm/gui/mappaint/styleelement/RepeatImageElement.java	(revision 9371)
@@ -1,4 +1,6 @@
 // License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.gui.mappaint.styleelement;
+
+import java.util.Objects;
 
 import org.openstreetmap.josm.data.osm.OsmPrimitive;
@@ -66,26 +68,18 @@
     @Override
     public boolean equals(Object obj) {
-        if (obj == null || getClass() != obj.getClass())
-            return false;
-        if (!super.equals(obj))
-            return false;
-        final RepeatImageElement other = (RepeatImageElement) obj;
-        if (!this.pattern.equals(other.pattern)) return false;
-        if (this.offset != other.offset) return false;
-        if (this.spacing != other.spacing) return false;
-        if (this.phase != other.phase) return false;
-        if (this.align != other.align) return false;
-        return true;
+        if (this == obj) return true;
+        if (obj == null || getClass() != obj.getClass()) return false;
+        if (!super.equals(obj)) return false;
+        RepeatImageElement that = (RepeatImageElement) obj;
+        return Float.compare(that.offset, offset) == 0 &&
+                Float.compare(that.spacing, spacing) == 0 &&
+                Float.compare(that.phase, phase) == 0 &&
+                Objects.equals(pattern, that.pattern) &&
+                align == that.align;
     }
 
     @Override
     public int hashCode() {
-        int hash = super.hashCode();
-        hash = 83 * hash + this.pattern.hashCode();
-        hash = 83 * hash + Float.floatToIntBits(this.offset);
-        hash = 83 * hash + Float.floatToIntBits(this.spacing);
-        hash = 83 * hash + Float.floatToIntBits(this.phase);
-        hash = 83 * hash + this.align.hashCode();
-        return hash;
+        return Objects.hash(super.hashCode(), pattern, offset, spacing, phase, align);
     }
 
Index: trunk/src/org/openstreetmap/josm/gui/mappaint/styleelement/StyleElement.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/mappaint/styleelement/StyleElement.java	(revision 9370)
+++ trunk/src/org/openstreetmap/josm/gui/mappaint/styleelement/StyleElement.java	(revision 9371)
@@ -5,4 +5,5 @@
 import java.util.HashMap;
 import java.util.Map;
+import java.util.Objects;
 
 import org.openstreetmap.josm.Main;
@@ -147,31 +148,15 @@
         @Override
         public int hashCode() {
-            final int prime = 31;
-            int result = 1;
-            result = prime * result + ((name == null) ? 0 : name.hashCode());
-            result = prime * result + size;
-            result = prime * result + style;
-            return result;
+            return Objects.hash(name, style, size);
         }
 
         @Override
         public boolean equals(Object obj) {
-            if (this == obj)
-                return true;
-            if (obj == null)
-                return false;
-            if (getClass() != obj.getClass())
-                return false;
-            FontDescriptor other = (FontDescriptor) obj;
-            if (name == null) {
-                if (other.name != null)
-                    return false;
-            } else if (!name.equals(other.name))
-                return false;
-            if (size != other.size)
-                return false;
-            if (style != other.style)
-                return false;
-            return true;
+            if (this == obj) return true;
+            if (obj == null || getClass() != obj.getClass()) return false;
+            FontDescriptor that = (FontDescriptor) obj;
+            return style == that.style &&
+                    size == that.size &&
+                    Objects.equals(name, that.name);
         }
     }
@@ -214,21 +199,16 @@
     @Override
     public boolean equals(Object o) {
-        if (!(o instanceof StyleElement))
-            return false;
-        StyleElement s = (StyleElement) o;
-        return isModifier == s.isModifier &&
-                majorZIndex == s.majorZIndex &&
-                zIndex == s.zIndex &&
-                objectZIndex == s.objectZIndex;
+        if (this == o) return true;
+        if (o == null || getClass() != o.getClass()) return false;
+        StyleElement that = (StyleElement) o;
+        return Float.compare(that.majorZIndex, majorZIndex) == 0 &&
+                Float.compare(that.zIndex, zIndex) == 0 &&
+                Float.compare(that.objectZIndex, objectZIndex) == 0 &&
+                isModifier == that.isModifier;
     }
 
     @Override
     public int hashCode() {
-        int hash = 5;
-        hash = 41 * hash + Float.floatToIntBits(this.majorZIndex);
-        hash = 41 * hash + Float.floatToIntBits(this.zIndex);
-        hash = 41 * hash + Float.floatToIntBits(this.objectZIndex);
-        hash = 41 * hash + (isModifier ? 1 : 0);
-        return hash;
+        return Objects.hash(majorZIndex, zIndex, objectZIndex, isModifier);
     }
 
Index: trunk/src/org/openstreetmap/josm/gui/mappaint/styleelement/TextLabel.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/mappaint/styleelement/TextLabel.java	(revision 9370)
+++ trunk/src/org/openstreetmap/josm/gui/mappaint/styleelement/TextLabel.java	(revision 9371)
@@ -201,27 +201,19 @@
     @Override
     public int hashCode() {
-        int hash = 3;
-        hash = 79 * hash + (labelCompositionStrategy != null ? labelCompositionStrategy.hashCode() : 0);
-        hash = 79 * hash + font.hashCode();
-        hash = 79 * hash + xOffset;
-        hash = 79 * hash + yOffset;
-        hash = 79 * hash + color.hashCode();
-        hash = 79 * hash + (haloRadius != null ? Float.floatToIntBits(haloRadius) : 0);
-        hash = 79 * hash + (haloColor != null ? haloColor.hashCode() : 0);
-        return hash;
+        return Objects.hash(labelCompositionStrategy, font, xOffset, yOffset, color, haloRadius, haloColor);
     }
 
     @Override
     public boolean equals(Object obj) {
-        if (obj == null || getClass() != obj.getClass())
-            return false;
-        final TextLabel other = (TextLabel) obj;
-        return Objects.equals(labelCompositionStrategy, other.labelCompositionStrategy) &&
-        Objects.equals(font, other.font) &&
-        xOffset == other.xOffset &&
-        yOffset == other.yOffset &&
-        Objects.equals(color, other.color) &&
-        Objects.equals(haloRadius, other.haloRadius) &&
-        Objects.equals(haloColor, other.haloColor);
+        if (this == obj) return true;
+        if (obj == null || getClass() != obj.getClass()) return false;
+        TextLabel textLabel = (TextLabel) obj;
+        return xOffset == textLabel.xOffset &&
+                yOffset == textLabel.yOffset &&
+                Objects.equals(labelCompositionStrategy, textLabel.labelCompositionStrategy) &&
+                Objects.equals(font, textLabel.font) &&
+                Objects.equals(color, textLabel.color) &&
+                Objects.equals(haloRadius, textLabel.haloRadius) &&
+                Objects.equals(haloColor, textLabel.haloColor);
     }
 }
Index: trunk/src/org/openstreetmap/josm/gui/preferences/SourceEntry.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/preferences/SourceEntry.java	(revision 9370)
+++ trunk/src/org/openstreetmap/josm/gui/preferences/SourceEntry.java	(revision 9371)
@@ -109,25 +109,18 @@
     @Override
     public boolean equals(Object obj) {
-        if (obj == null || getClass() != obj.getClass())
-            return false;
-        final SourceEntry other = (SourceEntry) obj;
-        return Objects.equals(other.url, url) &&
-                other.isZip == isZip &&
-                Objects.equals(other.zipEntryPath, zipEntryPath) &&
-                Objects.equals(other.name, name) &&
-                Objects.equals(other.title, title) &&
-                other.active == active;
+        if (this == obj) return true;
+        if (obj == null || getClass() != obj.getClass()) return false;
+        SourceEntry that = (SourceEntry) obj;
+        return isZip == that.isZip &&
+                active == that.active &&
+                Objects.equals(url, that.url) &&
+                Objects.equals(zipEntryPath, that.zipEntryPath) &&
+                Objects.equals(name, that.name) &&
+                Objects.equals(title, that.title);
     }
 
     @Override
     public int hashCode() {
-        int hash = 5;
-        hash = 89 * hash + (this.url != null ? this.url.hashCode() : 0);
-        hash = 89 * hash + (this.isZip ? 1 : 0);
-        hash = 89 * hash + (this.zipEntryPath != null ? this.zipEntryPath.hashCode() : 0);
-        hash = 89 * hash + (this.name != null ? this.name.hashCode() : 0);
-        hash = 89 * hash + (this.title != null ? this.title.hashCode() : 0);
-        hash = 89 * hash + (this.active ? 1 : 0);
-        return hash;
+        return Objects.hash(url, isZip, zipEntryPath, name, title, active);
     }
 
Index: trunk/src/org/openstreetmap/josm/gui/progress/ProgressTaskId.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/progress/ProgressTaskId.java	(revision 9370)
+++ trunk/src/org/openstreetmap/josm/gui/progress/ProgressTaskId.java	(revision 9371)
@@ -1,4 +1,6 @@
 // License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.gui.progress;
+
+import java.util.Objects;
 
 public class ProgressTaskId {
@@ -16,17 +18,13 @@
     @Override
     public int hashCode() {
-        return id.hashCode();
+        return Objects.hash(id);
     }
 
     @Override
     public boolean equals(Object obj) {
-        if (this == obj)
-            return true;
-        if (obj == null)
-            return false;
-        if (getClass() != obj.getClass())
-            return false;
-        ProgressTaskId other = (ProgressTaskId) obj;
-        return other.id.equals(id);
+        if (this == obj) return true;
+        if (obj == null || getClass() != obj.getClass()) return false;
+        ProgressTaskId that = (ProgressTaskId) obj;
+        return Objects.equals(id, that.id);
     }
 }
Index: trunk/src/org/openstreetmap/josm/gui/tagging/ac/AutoCompletionManager.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/tagging/ac/AutoCompletionManager.java	(revision 9370)
+++ trunk/src/org/openstreetmap/josm/gui/tagging/ac/AutoCompletionManager.java	(revision 9371)
@@ -84,9 +84,5 @@
         @Override
         public int hashCode() {
-            int hash = 7;
-            hash = 59 * hash + Objects.hashCode(this.key);
-            hash = 59 * hash + Objects.hashCode(this.value);
-            hash = 59 * hash + (this.defaultKey ? 1 : 0);
-            return hash;
+            return Objects.hash(key, value, defaultKey);
         }
 
Index: trunk/src/org/openstreetmap/josm/tools/MultiMap.java
===================================================================
--- trunk/src/org/openstreetmap/josm/tools/MultiMap.java	(revision 9370)
+++ trunk/src/org/openstreetmap/josm/tools/MultiMap.java	(revision 9371)
@@ -9,4 +9,5 @@
 import java.util.Map;
 import java.util.Map.Entry;
+import java.util.Objects;
 import java.util.Set;
 
@@ -214,19 +215,17 @@
     @Override
     public int hashCode() {
-        return map.hashCode();
+        return Objects.hash(map);
     }
 
     @Override
     public boolean equals(Object obj) {
-        if (this == obj)
-            return true;
-        if (obj == null)
-            return false;
-        if (!(obj instanceof MultiMap))
-            return false;
-        return map.equals(((MultiMap<?, ?>) obj).map);
+        if (this == obj) return true;
+        if (obj == null || getClass() != obj.getClass()) return false;
+        MultiMap<?, ?> multiMap = (MultiMap<?, ?>) obj;
+        return Objects.equals(map, multiMap.map);
     }
 
     @Override
+
     public String toString() {
         List<String> entries = new ArrayList<>(map.size());
Index: trunk/src/org/openstreetmap/josm/tools/Pair.java
===================================================================
--- trunk/src/org/openstreetmap/josm/tools/Pair.java	(revision 9370)
+++ trunk/src/org/openstreetmap/josm/tools/Pair.java	(revision 9371)
@@ -3,4 +3,5 @@
 import java.util.ArrayList;
 import java.util.List;
+import java.util.Objects;
 
 /**
@@ -34,14 +35,14 @@
     @Override
     public int hashCode() {
-        return a.hashCode() + b.hashCode();
+        return Objects.hash(a, b);
     }
 
     @Override
     public boolean equals(Object other) {
-        if (other instanceof Pair<?, ?>) {
-            Pair<?, ?> o = (Pair<?, ?>) other;
-            return a.equals(o.a) && b.equals(o.b);
-        } else
-            return false;
+        if (this == other) return true;
+        if (other == null || getClass() != other.getClass()) return false;
+        Pair<?, ?> pair = (Pair<?, ?>) other;
+        return Objects.equals(a, pair.a) &&
+                Objects.equals(b, pair.b);
     }
 
