Ignore:
Timestamp:
2016-01-09T23:20:37+01:00 (9 years ago)
Author:
simon04
Message:

Java 7: use Objects.equals and Objects.hash

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/progress/ProgressTaskId.java

    r8846 r9371  
    11// License: GPL. For details, see LICENSE file.
    22package org.openstreetmap.josm.gui.progress;
     3
     4import java.util.Objects;
    35
    46public class ProgressTaskId {
     
    1618    @Override
    1719    public int hashCode() {
    18         return id.hashCode();
     20        return Objects.hash(id);
    1921    }
    2022
    2123    @Override
    2224    public boolean equals(Object obj) {
    23         if (this == obj)
    24             return true;
    25         if (obj == null)
    26             return false;
    27         if (getClass() != obj.getClass())
    28             return false;
    29         ProgressTaskId other = (ProgressTaskId) obj;
    30         return other.id.equals(id);
     25        if (this == obj) return true;
     26        if (obj == null || getClass() != obj.getClass()) return false;
     27        ProgressTaskId that = (ProgressTaskId) obj;
     28        return Objects.equals(id, that.id);
    3129    }
    3230}
Note: See TracChangeset for help on using the changeset viewer.