Ignore:
Timestamp:
2015-06-20T23:42:21+02:00 (10 years ago)
Author:
Don-vip
Message:

checkstyle: enable relevant whitespace checks and fix them

Location:
trunk/src/org/openstreetmap/josm/data/gpx
Files:
8 edited

Legend:

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

    r7937 r8510  
    102102     * Possible fix values.
    103103     */
    104     public static Collection<String> FIX_VALUES = Arrays.asList("none","2d","3d","dgps","pps");
     104    public static Collection<String> FIX_VALUES = Arrays.asList("none", "2d", "3d", "dgps", "pps");
    105105}
  • trunk/src/org/openstreetmap/josm/data/gpx/GpxData.java

    r8506 r8510  
    200200            }
    201201        }
    202         if (earliest==null || latest==null) return null;
     202        if (earliest == null || latest == null) return null;
    203203        return new Date[]{earliest.getTime(), latest.getTime()};
    204204    }
     
    212212    */
    213213    public Date[] getMinMaxTimeForAllTracks() {
    214         double min=1e100;
    215         double max=-1e100;
     214        double min = 1e100;
     215        double max = -1e100;
    216216        double now = System.currentTimeMillis()/1000.0;
    217217        for (GpxTrack trk: tracks) {
     
    219219                for (WayPoint pnt : seg.getWayPoints()) {
    220220                    double t = pnt.time;
    221                     if (t>0 && t<=now) {
    222                         if (t>max) max=t;
    223                         if (t<min) min=t;
    224                     }
    225                 }
    226             }
    227         }
    228         if (Utils.equalsEpsilon(min,1e100) || Utils.equalsEpsilon(max,-1e100)) return new Date[0];
     221                    if (t > 0 && t <= now) {
     222                        if (t > max) max = t;
     223                        if (t < min) min = t;
     224                    }
     225                }
     226            }
     227        }
     228        if (Utils.equalsEpsilon(min, 1e100) || Utils.equalsEpsilon(max, -1e100)) return new Date[0];
    229229        return new Date[]{new Date((long) (min * 1000)), new Date((long) (max * 1000))};
    230230    }
     
    363363    public void resetEastNorthCache() {
    364364        if (waypoints != null) {
    365             for (WayPoint wp : waypoints){
     365            for (WayPoint wp : waypoints) {
    366366                wp.invalidateEastNorthCache();
    367367            }
    368368        }
    369         if (tracks != null){
     369        if (tracks != null) {
    370370            for (GpxTrack track: tracks) {
    371371                for (GpxTrackSegment segment: track.getSegments()) {
  • trunk/src/org/openstreetmap/josm/data/gpx/GpxTrack.java

    r7509 r8510  
    1414
    1515    Collection<GpxTrackSegment> getSegments();
     16
    1617    Map<String, Object> getAttributes();
     18
    1719    Bounds getBounds();
     20
    1821    double length();
    1922
  • trunk/src/org/openstreetmap/josm/data/gpx/GpxTrackSegment.java

    r5170 r8510  
    1313
    1414    Bounds getBounds();
     15
    1516    Collection<WayPoint> getWayPoints();
     17
    1618    double length();
     19
    1720    /**
    1821     *
  • trunk/src/org/openstreetmap/josm/data/gpx/ImmutableGpxTrack.java

    r7005 r8510  
    3030    }
    3131
    32     private double calculateLength(){
     32    private double calculateLength() {
    3333        double result = 0.0; // in meters
    3434
  • trunk/src/org/openstreetmap/josm/data/gpx/ImmutableGpxTrackSegment.java

    r7005 r8510  
    3636        WayPoint last = null;
    3737        for (WayPoint tpt : wayPoints) {
    38             if(last != null){
     38            if (last != null) {
    3939                Double d = last.getCoor().greatCircleDistance(tpt.getCoor());
    40                 if(!d.isNaN() && !d.isInfinite()) {
     40                if (!d.isNaN() && !d.isInfinite()) {
    4141                    result += d;
    4242                }
  • trunk/src/org/openstreetmap/josm/data/gpx/WayPoint.java

    r8376 r8510  
    6767
    6868    public final LatLon getCoor() {
    69         return new LatLon(lat,lon);
     69        return new LatLon(lat, lon);
    7070    }
    7171
     
    9595    @Override
    9696    public String toString() {
    97         return "WayPoint (" + (attr.containsKey(GPX_NAME) ? get(GPX_NAME) + ", " :"") + getCoor() + ", " + attr + ")";
     97        return "WayPoint (" + (attr.containsKey(GPX_NAME) ? get(GPX_NAME) + ", " : "") + getCoor() + ", " + attr + ")";
    9898    }
    9999
     
    105105            try {
    106106                time = dateParser.get().parse(get(PT_TIME).toString()).getTime() / 1000.; /* ms => seconds */
    107             } catch(Exception e) {
     107            } catch (Exception e) {
    108108                time = 0;
    109109            }
  • trunk/src/org/openstreetmap/josm/data/gpx/WithAttributes.java

    r7518 r8510  
    4444    public String getString(String key) {
    4545        Object value = attr.get(key);
    46         return (value instanceof String) ? (String)value : null;
     46        return (value instanceof String) ? (String) value : null;
    4747    }
    4848
     
    6060    public <T> Collection<T> getCollection(String key) {
    6161        Object value = attr.get(key);
    62         return (value instanceof Collection) ? (Collection<T>)value : null;
     62        return (value instanceof Collection) ? (Collection<T>) value : null;
    6363    }
    6464
Note: See TracChangeset for help on using the changeset viewer.