Changeset 14209 in josm


Ignore:
Timestamp:
2018-08-31T21:59:54+02:00 (6 years ago)
Author:
Don-vip
Message:

see #16681 - spotbugs / pmd

Location:
trunk
Files:
1 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/gpx/GpxImageCorrelation.java

    r14205 r14209  
    6262                segs.sort(new Comparator<List<WayPoint>>() {
    6363                    @Override
    64                     public int compare(List<WayPoint> arg0, List<WayPoint> arg1) {
    65                         if (arg0.isEmpty() || arg1.isEmpty() || arg0.get(0).time == arg1.get(0).time)
     64                    public int compare(List<WayPoint> o1, List<WayPoint> o2) {
     65                        if (o1.isEmpty() || o2.isEmpty())
    6666                            return 0;
    67                         return arg0.get(0).time < arg1.get(0).time ? -1 : 1;
     67                        return Double.compare(o1.get(0).time, o2.get(0).time);
    6868                    }
    6969                });
     
    7474        trks.sort(new Comparator<List<List<WayPoint>>>() {
    7575            @Override
    76             public int compare(List<List<WayPoint>> arg0, List<List<WayPoint>> arg1) {
    77                 if (arg0.isEmpty() || arg0.get(0).isEmpty()
    78                         || arg1.isEmpty() || arg1.get(0).isEmpty()
    79                         || arg0.get(0).get(0).time == arg1.get(0).get(0).time)
     76            public int compare(List<List<WayPoint>> o1, List<List<WayPoint>> o2) {
     77                if (o1.isEmpty() || o1.get(0).isEmpty()
     78                 || o2.isEmpty() || o2.get(0).isEmpty())
    8079                    return 0;
    81                 return arg0.get(0).get(0).time < arg1.get(0).get(0).time ? -1 : 1;
     80                return Double.compare(o1.get(0).get(0).time, o2.get(0).get(0).time);
    8281            }
    8382        });
  • trunk/src/org/openstreetmap/josm/data/gpx/GpxImageEntry.java

    r14205 r14209  
    55import java.io.IOException;
    66import java.util.Date;
     7import java.util.Objects;
    78
    89import org.openstreetmap.josm.data.coor.CachedLatLon;
     
    332333    }
    333334
     335    @Override
     336    public int hashCode() {
     337        return Objects.hash(height, width, isNewGpsData,
     338            elevation, exifCoor, exifGpsTime, exifImgDir, exifOrientation, exifTime,
     339            file, gpsTime, pos, speed, tmp);
     340    }
     341
     342    @Override
     343    public boolean equals(Object obj) {
     344        if (this == obj)
     345            return true;
     346        if (obj == null || getClass() != obj.getClass())
     347            return false;
     348        GpxImageEntry other = (GpxImageEntry) obj;
     349        return height == other.height
     350            && width == other.width
     351            && isNewGpsData == other.isNewGpsData
     352            && Objects.equals(elevation, other.elevation)
     353            && Objects.equals(exifCoor, other.exifCoor)
     354            && Objects.equals(exifGpsTime, other.exifGpsTime)
     355            && Objects.equals(exifImgDir, other.exifImgDir)
     356            && Objects.equals(exifOrientation, other.exifOrientation)
     357            && Objects.equals(exifTime, other.exifTime)
     358            && Objects.equals(file, other.file)
     359            && Objects.equals(gpsTime, other.gpsTime)
     360            && Objects.equals(pos, other.pos)
     361            && Objects.equals(speed, other.speed)
     362            && Objects.equals(tmp, other.tmp);
     363    }
     364
    334365    /**
    335366     * Make a fresh copy and save it in the temporary variable. Use
  • trunk/src/org/openstreetmap/josm/gui/layer/geoimage/CorrelateGpxWithImages.java

    r14205 r14209  
    111111public class CorrelateGpxWithImages extends AbstractAction {
    112112
    113     private static List<GpxData> loadedGpxData = new ArrayList<>();
     113    private static final List<GpxData> loadedGpxData = new ArrayList<>();
    114114
    115115    private final transient GeoImageLayer yLayer;
    116116    private transient GpxTimezone timezone;
    117117    private transient GpxTimeOffset delta;
    118     private static boolean forceTags = false;
     118    private static boolean forceTags;
    119119
    120120    /**
  • trunk/tools/pmd/josm-ruleset.xml

    r13719 r14209  
    156156    <exclude name="AvoidLiteralsInIfCondition"/>
    157157    <exclude name="BeanMembersShouldSerialize"/>
     158    <exclude name="CloneThrowsCloneNotSupportedException"/>
    158159    <exclude name="CompareObjectsWithEquals"/>
    159160    <exclude name="ConstructorCallsOverridableMethod"/>
Note: See TracChangeset for help on using the changeset viewer.