Ignore:
Timestamp:
2009-12-13T11:48:12+01:00 (14 years ago)
Author:
jttt
Message:

Fixed some of the warnings found by FindBugs

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/tools/OsmUrlToBounds.java

    r2540 r2626  
    3131                String bbox[] = map.get("bbox").split(",");
    3232                b = new Bounds(
    33                     new LatLon(Double.parseDouble(bbox[1]), Double.parseDouble(bbox[0])),
    34                     new LatLon(Double.parseDouble(bbox[3]), Double.parseDouble(bbox[2])));
     33                        new LatLon(Double.parseDouble(bbox[1]), Double.parseDouble(bbox[0])),
     34                        new LatLon(Double.parseDouble(bbox[3]), Double.parseDouble(bbox[2])));
    3535            } else if (map.containsKey("minlat")) {
    3636                String s = map.get("minlat");
     
    4545            } else {
    4646                b = positionToBounds(parseDouble(map, "lat"),
    47                                      parseDouble(map, "lon"),
    48                                      Integer.parseInt(map.get("zoom")));
     47                        parseDouble(map, "lon"),
     48                        Integer.parseInt(map.get("zoom")));
    4949            }
    5050        } catch (NumberFormatException x) {
     
    8181     */
    8282    private static Bounds parseShortLink(final String url) {
    83         if (!url.startsWith(SHORTLINK_PREFIX)) {
     83        if (!url.startsWith(SHORTLINK_PREFIX))
    8484            return null;
    85         }
    8685        final String shortLink = url.substring(SHORTLINK_PREFIX.length());
    8786
     
    125124        // 2**32 == 4294967296
    126125        return positionToBounds(y * 180.0 / 4294967296.0 - 90.0,
    127                                 x * 360.0 / 4294967296.0 - 180.0,
    128                                 // TODO: -2 was not in ruby code
    129                                 zoom - 8 - (zoomOffset % 3) - 2);
     126                x * 360.0 / 4294967296.0 - 180.0,
     127                // TODO: -2 was not in ruby code
     128                zoom - 8 - (zoomOffset % 3) - 2);
    130129    }
    131130
     
    133132        final double size = 180.0 / Math.pow(2, zoom);
    134133        return new Bounds(
    135                           new LatLon(lat - size/2, lon - size),
    136                           new LatLon(lat + size/2, lon + size));
     134                new LatLon(lat - size/2, lon - size),
     135                new LatLon(lat + size/2, lon + size));
    137136    }
    138137
     
    144143        int zoom = 0;
    145144        while (zoom <= 20) {
    146             if (size >= 180)
     145            if (size >= 180) {
    147146                break;
     147            }
    148148            size *= 2;
    149149            zoom++;
     
    163163        double lon = (Math.round(pos.lon() * decimals));
    164164        lon /= decimals;
    165         return new String("http://www.openstreetmap.org/?lat="+lat+"&lon="+lon+"&zoom="+zoom);
     165        return "http://www.openstreetmap.org/?lat="+lat+"&lon="+lon+"&zoom="+zoom;
    166166    }
    167167}
Note: See TracChangeset for help on using the changeset viewer.