Changeset 8456 in josm


Ignore:
Timestamp:
2015-06-03T04:36:57+02:00 (9 years ago)
Author:
Don-vip
Message:

see #11508 - override hashCode() and equals() in other commands as well

Location:
trunk/src/org/openstreetmap/josm
Files:
26 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/command/AddCommand.java

    r7587 r8456  
    9696        return Collections.singleton(osm);
    9797    }
     98
     99    @Override
     100    public int hashCode() {
     101        final int prime = 31;
     102        int result = super.hashCode();
     103        result = prime * result + ((osm == null) ? 0 : osm.hashCode());
     104        return result;
     105    }
     106
     107    @Override
     108    public boolean equals(Object obj) {
     109        if (this == obj)
     110            return true;
     111        if (!super.equals(obj))
     112            return false;
     113        if (getClass() != obj.getClass())
     114            return false;
     115        AddCommand other = (AddCommand) obj;
     116        if (osm == null) {
     117            if (other.osm != null)
     118                return false;
     119        } else if (!osm.equals(other.osm))
     120            return false;
     121        return true;
     122    }
    98123}
  • trunk/src/org/openstreetmap/josm/command/AddPrimitivesCommand.java

    r7005 r8456  
    88import java.util.HashSet;
    99import java.util.List;
     10
    1011import javax.swing.Icon;
    1112
     
    171172        return prims;
    172173    }
     174
     175    @Override
     176    public int hashCode() {
     177        final int prime = 31;
     178        int result = super.hashCode();
     179        result = prime * result + ((createdPrimitives == null) ? 0 : createdPrimitives.hashCode());
     180        result = prime * result + ((createdPrimitivesToSelect == null) ? 0 : createdPrimitivesToSelect.hashCode());
     181        result = prime * result + ((data == null) ? 0 : data.hashCode());
     182        result = prime * result + ((toSelect == null) ? 0 : toSelect.hashCode());
     183        return result;
     184    }
     185
     186    @Override
     187    public boolean equals(Object obj) {
     188        if (this == obj)
     189            return true;
     190        if (!super.equals(obj))
     191            return false;
     192        if (getClass() != obj.getClass())
     193            return false;
     194        AddPrimitivesCommand other = (AddPrimitivesCommand) obj;
     195        if (createdPrimitives == null) {
     196            if (other.createdPrimitives != null)
     197                return false;
     198        } else if (!createdPrimitives.equals(other.createdPrimitives))
     199            return false;
     200        if (createdPrimitivesToSelect == null) {
     201            if (other.createdPrimitivesToSelect != null)
     202                return false;
     203        } else if (!createdPrimitivesToSelect.equals(other.createdPrimitivesToSelect))
     204            return false;
     205        if (data == null) {
     206            if (other.data != null)
     207                return false;
     208        } else if (!data.equals(other.data))
     209            return false;
     210        if (toSelect == null) {
     211            if (other.toSelect != null)
     212                return false;
     213        } else if (!toSelect.equals(other.toSelect))
     214            return false;
     215        return true;
     216    }
    173217}
  • trunk/src/org/openstreetmap/josm/command/ChangeCommand.java

    r6881 r8456  
    8888        return ImageProvider.get(osm.getDisplayType());
    8989    }
     90
     91    @Override
     92    public int hashCode() {
     93        final int prime = 31;
     94        int result = super.hashCode();
     95        result = prime * result + ((newOsm == null) ? 0 : newOsm.hashCode());
     96        result = prime * result + ((osm == null) ? 0 : osm.hashCode());
     97        return result;
     98    }
     99
     100    @Override
     101    public boolean equals(Object obj) {
     102        if (this == obj)
     103            return true;
     104        if (!super.equals(obj))
     105            return false;
     106        if (getClass() != obj.getClass())
     107            return false;
     108        ChangeCommand other = (ChangeCommand) obj;
     109        if (newOsm == null) {
     110            if (other.newOsm != null)
     111                return false;
     112        } else if (!newOsm.equals(other.newOsm))
     113            return false;
     114        if (osm == null) {
     115            if (other.osm != null)
     116                return false;
     117        } else if (!osm.equals(other.osm))
     118            return false;
     119        return true;
     120    }
    90121}
  • trunk/src/org/openstreetmap/josm/command/ChangeNodesCommand.java

    r8378 r8456  
    6161        return ImageProvider.get(OsmPrimitiveType.WAY);
    6262    }
     63
     64    @Override
     65    public int hashCode() {
     66        final int prime = 31;
     67        int result = super.hashCode();
     68        result = prime * result + ((newNodes == null) ? 0 : newNodes.hashCode());
     69        result = prime * result + ((way == null) ? 0 : way.hashCode());
     70        return result;
     71    }
     72
     73    @Override
     74    public boolean equals(Object obj) {
     75        if (this == obj)
     76            return true;
     77        if (!super.equals(obj))
     78            return false;
     79        if (getClass() != obj.getClass())
     80            return false;
     81        ChangeNodesCommand other = (ChangeNodesCommand) obj;
     82        if (newNodes == null) {
     83            if (other.newNodes != null)
     84                return false;
     85        } else if (!newNodes.equals(other.newNodes))
     86            return false;
     87        if (way == null) {
     88            if (other.way != null)
     89                return false;
     90        } else if (!way.equals(other.way))
     91            return false;
     92        return true;
     93    }
    6394}
  • trunk/src/org/openstreetmap/josm/command/ChangePropertyCommand.java

    r8342 r8456  
    223223        return Collections.unmodifiableMap(tags);
    224224    }
     225
     226    @Override
     227    public int hashCode() {
     228        final int prime = 31;
     229        int result = super.hashCode();
     230        result = prime * result + ((objects == null) ? 0 : objects.hashCode());
     231        result = prime * result + ((tags == null) ? 0 : tags.hashCode());
     232        return result;
     233    }
     234
     235    @Override
     236    public boolean equals(Object obj) {
     237        if (this == obj)
     238            return true;
     239        if (!super.equals(obj))
     240            return false;
     241        if (getClass() != obj.getClass())
     242            return false;
     243        ChangePropertyCommand other = (ChangePropertyCommand) obj;
     244        if (objects == null) {
     245            if (other.objects != null)
     246                return false;
     247        } else if (!objects.equals(other.objects))
     248            return false;
     249        if (tags == null) {
     250            if (other.tags != null)
     251                return false;
     252        } else if (!tags.equals(other.tags))
     253            return false;
     254        return true;
     255    }
    225256}
  • trunk/src/org/openstreetmap/josm/command/ChangePropertyKeyCommand.java

    r8443 r8456  
    124124        return children;
    125125    }
     126
     127    @Override
     128    public int hashCode() {
     129        final int prime = 31;
     130        int result = super.hashCode();
     131        result = prime * result + ((key == null) ? 0 : key.hashCode());
     132        result = prime * result + ((newKey == null) ? 0 : newKey.hashCode());
     133        result = prime * result + ((objects == null) ? 0 : objects.hashCode());
     134        return result;
     135    }
     136
     137    @Override
     138    public boolean equals(Object obj) {
     139        if (this == obj)
     140            return true;
     141        if (!super.equals(obj))
     142            return false;
     143        if (getClass() != obj.getClass())
     144            return false;
     145        ChangePropertyKeyCommand other = (ChangePropertyKeyCommand) obj;
     146        if (key == null) {
     147            if (other.key != null)
     148                return false;
     149        } else if (!key.equals(other.key))
     150            return false;
     151        if (newKey == null) {
     152            if (other.newKey != null)
     153                return false;
     154        } else if (!newKey.equals(other.newKey))
     155            return false;
     156        if (objects == null) {
     157            if (other.objects != null)
     158                return false;
     159        } else if (!objects.equals(other.objects))
     160            return false;
     161        return true;
     162    }
    126163}
  • trunk/src/org/openstreetmap/josm/command/ChangeRelationMemberRoleCommand.java

    r6881 r8456  
    8181        return ImageProvider.get(relation.getDisplayType());
    8282    }
     83
     84    @Override
     85    public int hashCode() {
     86        final int prime = 31;
     87        int result = super.hashCode();
     88        result = prime * result + ((newRole == null) ? 0 : newRole.hashCode());
     89        result = prime * result + ((oldModified == null) ? 0 : oldModified.hashCode());
     90        result = prime * result + ((oldRole == null) ? 0 : oldRole.hashCode());
     91        result = prime * result + position;
     92        result = prime * result + ((relation == null) ? 0 : relation.hashCode());
     93        return result;
     94    }
     95
     96    @Override
     97    public boolean equals(Object obj) {
     98        if (this == obj)
     99            return true;
     100        if (!super.equals(obj))
     101            return false;
     102        if (getClass() != obj.getClass())
     103            return false;
     104        ChangeRelationMemberRoleCommand other = (ChangeRelationMemberRoleCommand) obj;
     105        if (newRole == null) {
     106            if (other.newRole != null)
     107                return false;
     108        } else if (!newRole.equals(other.newRole))
     109            return false;
     110        if (oldModified == null) {
     111            if (other.oldModified != null)
     112                return false;
     113        } else if (!oldModified.equals(other.oldModified))
     114            return false;
     115        if (oldRole == null) {
     116            if (other.oldRole != null)
     117                return false;
     118        } else if (!oldRole.equals(other.oldRole))
     119            return false;
     120        if (position != other.position)
     121            return false;
     122        if (relation == null) {
     123            if (other.relation != null)
     124                return false;
     125        } else if (!relation.equals(other.relation))
     126            return false;
     127        return true;
     128    }
    83129}
  • trunk/src/org/openstreetmap/josm/command/DeleteCommand.java

    r8388 r8456  
    516516                JOptionPane.YES_OPTION);
    517517    }
     518
     519    @Override
     520    public int hashCode() {
     521        final int prime = 31;
     522        int result = super.hashCode();
     523        result = prime * result + ((clonedPrimitives == null) ? 0 : clonedPrimitives.hashCode());
     524        result = prime * result + ((toDelete == null) ? 0 : toDelete.hashCode());
     525        return result;
     526    }
     527
     528    @Override
     529    public boolean equals(Object obj) {
     530        if (this == obj)
     531            return true;
     532        if (!super.equals(obj))
     533            return false;
     534        if (getClass() != obj.getClass())
     535            return false;
     536        DeleteCommand other = (DeleteCommand) obj;
     537        if (clonedPrimitives == null) {
     538            if (other.clonedPrimitives != null)
     539                return false;
     540        } else if (!clonedPrimitives.equals(other.clonedPrimitives))
     541            return false;
     542        if (toDelete == null) {
     543            if (other.toDelete != null)
     544                return false;
     545        } else if (!toDelete.equals(other.toDelete))
     546            return false;
     547        return true;
     548    }
    518549}
  • trunk/src/org/openstreetmap/josm/command/PurgeCommand.java

    r8346 r8456  
    270270    public void fillModifiedData(Collection<OsmPrimitive> modified, Collection<OsmPrimitive> deleted, Collection<OsmPrimitive> added) {
    271271    }
     272
     273    @Override
     274    public int hashCode() {
     275        final int prime = 31;
     276        int result = super.hashCode();
     277        result = prime * result + ((ds == null) ? 0 : ds.hashCode());
     278        result = prime * result + ((makeIncompleteData == null) ? 0 : makeIncompleteData.hashCode());
     279        result = prime * result + ((makeIncompleteDataByPrimId == null) ? 0 : makeIncompleteDataByPrimId.hashCode());
     280        result = prime * result + ((purgedConflicts == null) ? 0 : purgedConflicts.hashCode());
     281        result = prime * result + ((toPurge == null) ? 0 : toPurge.hashCode());
     282        return result;
     283    }
     284
     285    @Override
     286    public boolean equals(Object obj) {
     287        if (this == obj)
     288            return true;
     289        if (!super.equals(obj))
     290            return false;
     291        if (getClass() != obj.getClass())
     292            return false;
     293        PurgeCommand other = (PurgeCommand) obj;
     294        if (ds == null) {
     295            if (other.ds != null)
     296                return false;
     297        } else if (!ds.equals(other.ds))
     298            return false;
     299        if (makeIncompleteData == null) {
     300            if (other.makeIncompleteData != null)
     301                return false;
     302        } else if (!makeIncompleteData.equals(other.makeIncompleteData))
     303            return false;
     304        if (makeIncompleteDataByPrimId == null) {
     305            if (other.makeIncompleteDataByPrimId != null)
     306                return false;
     307        } else if (!makeIncompleteDataByPrimId.equals(other.makeIncompleteDataByPrimId))
     308            return false;
     309        if (purgedConflicts == null) {
     310            if (other.purgedConflicts != null)
     311                return false;
     312        } else if (!purgedConflicts.equals(other.purgedConflicts))
     313            return false;
     314        if (toPurge == null) {
     315            if (other.toPurge != null)
     316                return false;
     317        } else if (!toPurge.equals(other.toPurge))
     318            return false;
     319        return true;
     320    }
    272321}
  • trunk/src/org/openstreetmap/josm/command/RemoveNodesCommand.java

    r8378 r8456  
    6262        return ImageProvider.get(OsmPrimitiveType.WAY);
    6363    }
     64
     65    @Override
     66    public int hashCode() {
     67        final int prime = 31;
     68        int result = super.hashCode();
     69        result = prime * result + ((rmNodes == null) ? 0 : rmNodes.hashCode());
     70        result = prime * result + ((way == null) ? 0 : way.hashCode());
     71        return result;
     72    }
     73
     74    @Override
     75    public boolean equals(Object obj) {
     76        if (this == obj)
     77            return true;
     78        if (!super.equals(obj))
     79            return false;
     80        if (getClass() != obj.getClass())
     81            return false;
     82        RemoveNodesCommand other = (RemoveNodesCommand) obj;
     83        if (rmNodes == null) {
     84            if (other.rmNodes != null)
     85                return false;
     86        } else if (!rmNodes.equals(other.rmNodes))
     87            return false;
     88        if (way == null) {
     89            if (other.way != null)
     90                return false;
     91        } else if (!way.equals(other.way))
     92            return false;
     93        return true;
     94    }
    6495}
  • trunk/src/org/openstreetmap/josm/command/RotateCommand.java

    r8443 r8456  
    8686        return trn("Rotate {0} node", "Rotate {0} nodes", nodes.size(), nodes.size());
    8787    }
     88
     89    @Override
     90    public int hashCode() {
     91        final int prime = 31;
     92        int result = super.hashCode();
     93        result = prime * result + ((pivot == null) ? 0 : pivot.hashCode());
     94        long temp;
     95        temp = Double.doubleToLongBits(rotationAngle);
     96        result = prime * result + (int) (temp ^ (temp >>> 32));
     97        temp = Double.doubleToLongBits(startAngle);
     98        result = prime * result + (int) (temp ^ (temp >>> 32));
     99        return result;
     100    }
     101
     102    @Override
     103    public boolean equals(Object obj) {
     104        if (this == obj)
     105            return true;
     106        if (!super.equals(obj))
     107            return false;
     108        if (getClass() != obj.getClass())
     109            return false;
     110        RotateCommand other = (RotateCommand) obj;
     111        if (pivot == null) {
     112            if (other.pivot != null)
     113                return false;
     114        } else if (!pivot.equals(other.pivot))
     115            return false;
     116        if (Double.doubleToLongBits(rotationAngle) != Double.doubleToLongBits(other.rotationAngle))
     117            return false;
     118        if (Double.doubleToLongBits(startAngle) != Double.doubleToLongBits(other.startAngle))
     119            return false;
     120        return true;
     121    }
    88122}
  • trunk/src/org/openstreetmap/josm/command/ScaleCommand.java

    r8392 r8456  
    7878        return trn("Scale {0} node", "Scale {0} nodes", nodes.size(), nodes.size());
    7979    }
     80
     81    @Override
     82    public int hashCode() {
     83        final int prime = 31;
     84        int result = super.hashCode();
     85        result = prime * result + ((pivot == null) ? 0 : pivot.hashCode());
     86        long temp;
     87        temp = Double.doubleToLongBits(scalingFactor);
     88        result = prime * result + (int) (temp ^ (temp >>> 32));
     89        result = prime * result + ((startEN == null) ? 0 : startEN.hashCode());
     90        return result;
     91    }
     92
     93    @Override
     94    public boolean equals(Object obj) {
     95        if (this == obj)
     96            return true;
     97        if (!super.equals(obj))
     98            return false;
     99        if (getClass() != obj.getClass())
     100            return false;
     101        ScaleCommand other = (ScaleCommand) obj;
     102        if (pivot == null) {
     103            if (other.pivot != null)
     104                return false;
     105        } else if (!pivot.equals(other.pivot))
     106            return false;
     107        if (Double.doubleToLongBits(scalingFactor) != Double.doubleToLongBits(other.scalingFactor))
     108            return false;
     109        if (startEN == null) {
     110            if (other.startEN != null)
     111                return false;
     112        } else if (!startEN.equals(other.startEN))
     113            return false;
     114        return true;
     115    }
    80116}
  • trunk/src/org/openstreetmap/josm/command/SelectCommand.java

    r7937 r8456  
    5151        return trn("Selected {0} object", "Selected {0} objects", size, size);
    5252    }
     53
     54    @Override
     55    public int hashCode() {
     56        final int prime = 31;
     57        int result = super.hashCode();
     58        result = prime * result + ((newSelection == null) ? 0 : newSelection.hashCode());
     59        result = prime * result + ((oldSelection == null) ? 0 : oldSelection.hashCode());
     60        return result;
     61    }
     62
     63    @Override
     64    public boolean equals(Object obj) {
     65        if (this == obj)
     66            return true;
     67        if (!super.equals(obj))
     68            return false;
     69        if (getClass() != obj.getClass())
     70            return false;
     71        SelectCommand other = (SelectCommand) obj;
     72        if (newSelection == null) {
     73            if (other.newSelection != null)
     74                return false;
     75        } else if (!newSelection.equals(other.newSelection))
     76            return false;
     77        if (oldSelection == null) {
     78            if (other.oldSelection != null)
     79                return false;
     80        } else if (!oldSelection.equals(other.oldSelection))
     81            return false;
     82        return true;
     83    }
    5384}
  • trunk/src/org/openstreetmap/josm/command/SequenceCommand.java

    r7436 r8456  
    123123        this.sequenceComplete = sequenceComplete;
    124124    }
     125
     126    @Override
     127    public int hashCode() {
     128        final int prime = 31;
     129        int result = super.hashCode();
     130        result = prime * result + (continueOnError ? 1231 : 1237);
     131        result = prime * result + ((name == null) ? 0 : name.hashCode());
     132        result = prime * result + Arrays.hashCode(sequence);
     133        result = prime * result + (sequenceComplete ? 1231 : 1237);
     134        return result;
     135    }
     136
     137    @Override
     138    public boolean equals(Object obj) {
     139        if (this == obj)
     140            return true;
     141        if (!super.equals(obj))
     142            return false;
     143        if (getClass() != obj.getClass())
     144            return false;
     145        SequenceCommand other = (SequenceCommand) obj;
     146        if (continueOnError != other.continueOnError)
     147            return false;
     148        if (name == null) {
     149            if (other.name != null)
     150                return false;
     151        } else if (!name.equals(other.name))
     152            return false;
     153        if (!Arrays.equals(sequence, other.sequence))
     154            return false;
     155        if (sequenceComplete != other.sequenceComplete)
     156            return false;
     157        return true;
     158    }
    125159}
  • trunk/src/org/openstreetmap/josm/command/TransformNodesCommand.java

    r8443 r8456  
    2828     */
    2929    protected Collection<Node> nodes = new LinkedList<>();
    30 
    3130
    3231    /**
     
    140139
    141140    }
     141
     142    @Override
     143    public int hashCode() {
     144        final int prime = 31;
     145        int result = super.hashCode();
     146        result = prime * result + ((nodes == null) ? 0 : nodes.hashCode());
     147        result = prime * result + ((oldStates == null) ? 0 : oldStates.hashCode());
     148        return result;
     149    }
     150
     151    @Override
     152    public boolean equals(Object obj) {
     153        if (this == obj)
     154            return true;
     155        if (!super.equals(obj))
     156            return false;
     157        if (getClass() != obj.getClass())
     158            return false;
     159        TransformNodesCommand other = (TransformNodesCommand) obj;
     160        if (nodes == null) {
     161            if (other.nodes != null)
     162                return false;
     163        } else if (!nodes.equals(other.nodes))
     164            return false;
     165        if (oldStates == null) {
     166            if (other.oldStates != null)
     167                return false;
     168        } else if (!oldStates.equals(other.oldStates))
     169            return false;
     170        return true;
     171    }
    142172}
  • trunk/src/org/openstreetmap/josm/command/conflict/ConflictAddCommand.java

    r8444 r8456  
    8686        return ImageProvider.get(conflict.getMy().getDisplayType());
    8787    }
     88
     89    @Override
     90    public int hashCode() {
     91        final int prime = 31;
     92        int result = super.hashCode();
     93        result = prime * result + ((conflict == null) ? 0 : conflict.hashCode());
     94        return result;
     95    }
     96
     97    @Override
     98    public boolean equals(Object obj) {
     99        if (this == obj)
     100            return true;
     101        if (!super.equals(obj))
     102            return false;
     103        if (getClass() != obj.getClass())
     104            return false;
     105        ConflictAddCommand other = (ConflictAddCommand) obj;
     106        if (conflict == null) {
     107            if (other.conflict != null)
     108                return false;
     109        } else if (!conflict.equals(other.conflict))
     110            return false;
     111        return true;
     112    }
    88113}
  • trunk/src/org/openstreetmap/josm/command/conflict/ConflictResolveCommand.java

    r8444 r8456  
    7979        reconstituteConflicts();
    8080    }
     81
     82    @Override
     83    public int hashCode() {
     84        final int prime = 31;
     85        int result = super.hashCode();
     86        result = prime * result + ((resolvedConflicts == null) ? 0 : resolvedConflicts.hashCode());
     87        return result;
     88    }
     89
     90    @Override
     91    public boolean equals(Object obj) {
     92        if (this == obj)
     93            return true;
     94        if (!super.equals(obj))
     95            return false;
     96        if (getClass() != obj.getClass())
     97            return false;
     98        ConflictResolveCommand other = (ConflictResolveCommand) obj;
     99        if (resolvedConflicts == null) {
     100            if (other.resolvedConflicts != null)
     101                return false;
     102        } else if (!resolvedConflicts.equals(other.resolvedConflicts))
     103            return false;
     104        return true;
     105    }
    81106}
  • trunk/src/org/openstreetmap/josm/command/conflict/CoordinateConflictResolveCommand.java

    r6887 r8456  
    7676        modified.add(conflict.getMy());
    7777    }
     78
     79    @Override
     80    public int hashCode() {
     81        final int prime = 31;
     82        int result = super.hashCode();
     83        result = prime * result + ((conflict == null) ? 0 : conflict.hashCode());
     84        result = prime * result + ((decision == null) ? 0 : decision.hashCode());
     85        return result;
     86    }
     87
     88    @Override
     89    public boolean equals(Object obj) {
     90        if (this == obj)
     91            return true;
     92        if (!super.equals(obj))
     93            return false;
     94        if (getClass() != obj.getClass())
     95            return false;
     96        CoordinateConflictResolveCommand other = (CoordinateConflictResolveCommand) obj;
     97        if (conflict == null) {
     98            if (other.conflict != null)
     99                return false;
     100        } else if (!conflict.equals(other.conflict))
     101            return false;
     102        if (decision != other.decision)
     103            return false;
     104        return true;
     105    }
    78106}
  • trunk/src/org/openstreetmap/josm/command/conflict/DeletedStateConflictResolveCommand.java

    r7509 r8456  
    8888        modified.addAll(conflict.getMy().getReferrers());
    8989    }
     90
     91    @Override
     92    public int hashCode() {
     93        final int prime = 31;
     94        int result = super.hashCode();
     95        result = prime * result + ((conflict == null) ? 0 : conflict.hashCode());
     96        result = prime * result + ((decision == null) ? 0 : decision.hashCode());
     97        return result;
     98    }
     99
     100    @Override
     101    public boolean equals(Object obj) {
     102        if (this == obj)
     103            return true;
     104        if (!super.equals(obj))
     105            return false;
     106        if (getClass() != obj.getClass())
     107            return false;
     108        DeletedStateConflictResolveCommand other = (DeletedStateConflictResolveCommand) obj;
     109        if (conflict == null) {
     110            if (other.conflict != null)
     111                return false;
     112        } else if (!conflict.equals(other.conflict))
     113            return false;
     114        if (decision != other.decision)
     115            return false;
     116        return true;
     117    }
    90118}
  • trunk/src/org/openstreetmap/josm/command/conflict/ModifiedConflictResolveCommand.java

    r6887 r8456  
    6464        modified.add(conflict.getMy());
    6565    }
     66
     67    @Override
     68    public int hashCode() {
     69        final int prime = 31;
     70        int result = super.hashCode();
     71        result = prime * result + ((conflict == null) ? 0 : conflict.hashCode());
     72        return result;
     73    }
     74
     75    @Override
     76    public boolean equals(Object obj) {
     77        if (this == obj)
     78            return true;
     79        if (!super.equals(obj))
     80            return false;
     81        if (getClass() != obj.getClass())
     82            return false;
     83        ModifiedConflictResolveCommand other = (ModifiedConflictResolveCommand) obj;
     84        if (conflict == null) {
     85            if (other.conflict != null)
     86                return false;
     87        } else if (!conflict.equals(other.conflict))
     88            return false;
     89        return true;
     90    }
    6691}
  • trunk/src/org/openstreetmap/josm/command/conflict/RelationMemberConflictResolverCommand.java

    r8444 r8456  
    9595        }
    9696    }
     97
     98    @Override
     99    public int hashCode() {
     100        final int prime = 31;
     101        int result = super.hashCode();
     102        result = prime * result + ((mergedMembers == null) ? 0 : mergedMembers.hashCode());
     103        result = prime * result + ((my == null) ? 0 : my.hashCode());
     104        result = prime * result + ((their == null) ? 0 : their.hashCode());
     105        return result;
     106    }
     107
     108    @Override
     109    public boolean equals(Object obj) {
     110        if (this == obj)
     111            return true;
     112        if (!super.equals(obj))
     113            return false;
     114        if (getClass() != obj.getClass())
     115            return false;
     116        RelationMemberConflictResolverCommand other = (RelationMemberConflictResolverCommand) obj;
     117        if (mergedMembers == null) {
     118            if (other.mergedMembers != null)
     119                return false;
     120        } else if (!mergedMembers.equals(other.mergedMembers))
     121            return false;
     122        if (my == null) {
     123            if (other.my != null)
     124                return false;
     125        } else if (!my.equals(other.my))
     126            return false;
     127        if (their == null) {
     128            if (other.their != null)
     129                return false;
     130        } else if (!their.equals(other.their))
     131            return false;
     132        return true;
     133    }
    97134}
  • trunk/src/org/openstreetmap/josm/command/conflict/TagConflictResolveCommand.java

    r8444 r8456  
    9797        modified.add(conflict.getMy());
    9898    }
     99
     100    @Override
     101    public int hashCode() {
     102        final int prime = 31;
     103        int result = super.hashCode();
     104        result = prime * result + ((conflict == null) ? 0 : conflict.hashCode());
     105        result = prime * result + ((mergeItems == null) ? 0 : mergeItems.hashCode());
     106        return result;
     107    }
     108
     109    @Override
     110    public boolean equals(Object obj) {
     111        if (this == obj)
     112            return true;
     113        if (!super.equals(obj))
     114            return false;
     115        if (getClass() != obj.getClass())
     116            return false;
     117        TagConflictResolveCommand other = (TagConflictResolveCommand) obj;
     118        if (conflict == null) {
     119            if (other.conflict != null)
     120                return false;
     121        } else if (!conflict.equals(other.conflict))
     122            return false;
     123        if (mergeItems == null) {
     124            if (other.mergeItems != null)
     125                return false;
     126        } else if (!mergeItems.equals(other.mergeItems))
     127            return false;
     128        return true;
     129    }
    99130}
  • trunk/src/org/openstreetmap/josm/command/conflict/VersionConflictResolveCommand.java

    r6887 r8456  
    7373        modified.add(conflict.getMy());
    7474    }
     75
     76    @Override
     77    public int hashCode() {
     78        final int prime = 31;
     79        int result = super.hashCode();
     80        result = prime * result + ((conflict == null) ? 0 : conflict.hashCode());
     81        return result;
     82    }
     83
     84    @Override
     85    public boolean equals(Object obj) {
     86        if (this == obj)
     87            return true;
     88        if (!super.equals(obj))
     89            return false;
     90        if (getClass() != obj.getClass())
     91            return false;
     92        VersionConflictResolveCommand other = (VersionConflictResolveCommand) obj;
     93        if (conflict == null) {
     94            if (other.conflict != null)
     95                return false;
     96        } else if (!conflict.equals(other.conflict))
     97            return false;
     98        return true;
     99    }
    75100}
  • trunk/src/org/openstreetmap/josm/command/conflict/WayNodesConflictResolverCommand.java

    r8444 r8456  
    7272        modified.add(conflict.getMy());
    7373    }
     74
     75    @Override
     76    public int hashCode() {
     77        final int prime = 31;
     78        int result = super.hashCode();
     79        result = prime * result + ((conflict == null) ? 0 : conflict.hashCode());
     80        result = prime * result + ((mergedNodeList == null) ? 0 : mergedNodeList.hashCode());
     81        return result;
     82    }
     83
     84    @Override
     85    public boolean equals(Object obj) {
     86        if (this == obj)
     87            return true;
     88        if (!super.equals(obj))
     89            return false;
     90        if (getClass() != obj.getClass())
     91            return false;
     92        WayNodesConflictResolverCommand other = (WayNodesConflictResolverCommand) obj;
     93        if (conflict == null) {
     94            if (other.conflict != null)
     95                return false;
     96        } else if (!conflict.equals(other.conflict))
     97            return false;
     98        if (mergedNodeList == null) {
     99            if (other.mergedNodeList != null)
     100                return false;
     101        } else if (!mergedNodeList.equals(other.mergedNodeList))
     102            return false;
     103        return true;
     104    }
    74105}
  • trunk/src/org/openstreetmap/josm/data/conflict/ConflictCollection.java

    r8338 r8456  
    382382        return Utils.filter(conflicts, RELATION_FILTER_PREDICATE);
    383383    }
     384
     385    @Override
     386    public int hashCode() {
     387        final int prime = 31;
     388        int result = 1;
     389        result = prime * result + ((conflicts == null) ? 0 : conflicts.hashCode());
     390        result = prime * result + ((listeners == null) ? 0 : listeners.hashCode());
     391        return result;
     392    }
     393
     394    @Override
     395    public boolean equals(Object obj) {
     396        if (this == obj)
     397            return true;
     398        if (obj == null)
     399            return false;
     400        if (getClass() != obj.getClass())
     401            return false;
     402        ConflictCollection other = (ConflictCollection) obj;
     403        if (conflicts == null) {
     404            if (other.conflicts != null)
     405                return false;
     406        } else if (!conflicts.equals(other.conflicts))
     407            return false;
     408        if (listeners == null) {
     409            if (other.listeners != null)
     410                return false;
     411        } else if (!listeners.equals(other.listeners))
     412            return false;
     413        return true;
     414    }
    384415}
  • trunk/src/org/openstreetmap/josm/data/imagery/ImageryInfo.java

    r8420 r8456  
    10231023
    10241024    /**
    1025      * Sets the Map of <header name, header value> that if any of this header
     1025     * Sets the Map of &lt;header name, header value&gt; that if any of this header
    10261026     * will be returned, then this tile will be treated as "no tile at this zoom level"
    10271027     *
     
    10391039
    10401040    /**
    1041      * Returns the map <header name, metadata key> indicating, which HTTP headers should
     1041     * Returns the map &lt;header name, metadata key&gt; indicating, which HTTP headers should
    10421042     * be moved to metadata
    10431043     *
Note: See TracChangeset for help on using the changeset viewer.