Changeset 6169 in josm


Ignore:
Timestamp:
2013-08-21T10:14:51+02:00 (11 years ago)
Author:
Don-vip
Message:

fix #8987 - Fix NPE and Findbugs/Sonar violations

Location:
trunk/src/org/openstreetmap/josm/data/coor
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/coor/Coordinate.java

    r6167 r6169  
    1616 * @since 6162
    1717 */
    18 abstract class Coordinate implements Cloneable, Serializable {
     18abstract class Coordinate implements Serializable {
    1919
    2020    protected final double x;
     
    105105        if (this == obj)
    106106            return true;
    107         if (getClass() != obj.getClass())
     107        if (obj == null || getClass() != obj.getClass())
    108108            return false;
    109109        Coordinate other = (Coordinate) obj;
  • trunk/src/org/openstreetmap/josm/data/coor/EastNorth.java

    r6167 r6169  
    99 * @author Imi
    1010 */
    11 public class EastNorth extends Coordinate {
     11public class EastNorth extends Coordinate implements Cloneable {
    1212
    1313    public EastNorth(double east, double north) {
     
    132132
    133133    @Override
    134     public EastNorth clone() {
    135         return new EastNorth(x, y);
     134    public EastNorth clone() throws CloneNotSupportedException {
     135        return (EastNorth) super.clone();
    136136    }
    137137}
  • trunk/src/org/openstreetmap/josm/data/coor/LatLon.java

    r6168 r6169  
    2626 * @author Imi
    2727 */
    28 public class LatLon extends Coordinate {
     28public class LatLon extends Coordinate implements Cloneable {
    2929
    3030    /**
     
    397397
    398398    @Override
    399     public LatLon clone() {
    400         return new LatLon(x, y);
     399    public LatLon clone() throws CloneNotSupportedException {
     400        return (LatLon) super.clone();
    401401    }
    402402}
Note: See TracChangeset for help on using the changeset viewer.