Changeset 11085 in josm


Ignore:
Timestamp:
2016-10-06T23:22:21+02:00 (8 years ago)
Author:
Don-vip
Message:

sonar - squid:S2162 - "equals" methods should be symmetric and work for subclasses

Location:
trunk
Files:
3 added
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/correction/TagCorrection.java

    r11061 r11085  
    5353    public boolean equals(Object o) {
    5454        if (this == o) return true;
    55         if (!(o instanceof TagCorrection)) return false;
     55        if (o == null || getClass() != o.getClass())
     56            return false;
    5657        TagCorrection that = (TagCorrection) o;
    5758        return Objects.equals(oldKey, that.oldKey) &&
    58                 Objects.equals(newKey, that.newKey) &&
    59                 Objects.equals(oldValue, that.oldValue) &&
    60                 Objects.equals(newValue, that.newValue);
     59               Objects.equals(newKey, that.newKey) &&
     60               Objects.equals(oldValue, that.oldValue) &&
     61               Objects.equals(newValue, that.newValue);
    6162    }
    6263
  • trunk/src/org/openstreetmap/josm/gui/MapStatus.java

    r10824 r11085  
    221221    private final transient List<StatusTextHistory> statusText = new ArrayList<>();
    222222
    223     private static class StatusTextHistory {
     223    protected static final class StatusTextHistory {
    224224        private final Object id;
    225225        private final String text;
Note: See TracChangeset for help on using the changeset viewer.