Ignore:
Timestamp:
2015-08-02T17:09:43+02:00 (9 years ago)
Author:
donvip
Message:

[jmapviewer] fix a bunch of Sonar issues

File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/tilesources/BingAerialTileSource.java

    r31432 r31434  
    3939public class BingAerialTileSource extends AbstractTMSTileSource {
    4040
    41     private static String API_KEY = "Arzdiw4nlOJzRwOz__qailc8NiR31Tt51dN2D7cm57NrnceZnCpgOkmJhNpGoppU";
     41    private static final String API_KEY = "Arzdiw4nlOJzRwOz__qailc8NiR31Tt51dN2D7cm57NrnceZnCpgOkmJhNpGoppU";
    4242    private static volatile Future<List<Attribution>> attributions; // volatile is required for getAttribution(), see below.
    4343    private static String imageUrlTemplate;
     
    5757    }
    5858
     59    /**
     60     * Constructs a new {@code BingAerialTileSource}.
     61     */
    5962    public BingAerialTileSource(TileSourceInfo info) {
    6063        super(info);
     
    6265
    6366    protected static class Attribution {
    64         String attribution;
    65         int minZoom;
    66         int maxZoom;
    67         Coordinate min;
    68         Coordinate max;
     67        private String attribution;
     68        private int minZoom;
     69        private int maxZoom;
     70        private Coordinate min;
     71        private Coordinate max;
    6972    }
    7073
     
    100103            imageUrlTemplate = xpath.compile("//ImageryMetadata/ImageUrl/text()").evaluate(document);
    101104            imageUrlTemplate = culturePattern.matcher(imageUrlTemplate).replaceAll(Locale.getDefault().toString());
    102             imageryZoomMax = Integer.parseInt(xpath.compile("//ImageryMetadata/ZoomMax/text()").evaluate(document));
     105            imageryZoomMax = Integer.valueOf(xpath.compile("//ImageryMetadata/ZoomMax/text()").evaluate(document));
    103106
    104107            NodeList subdomainTxt = (NodeList) xpath.compile("//ImageryMetadata/ImageUrlSubdomains/string/text()")
     
    137140                    attr.minZoom = Integer.parseInt(zoomMinXpath.evaluate(areaNode));
    138141
    139                     Double southLat = Double.parseDouble(southLatXpath.evaluate(areaNode));
    140                     Double northLat = Double.parseDouble(northLatXpath.evaluate(areaNode));
    141                     Double westLon = Double.parseDouble(westLonXpath.evaluate(areaNode));
    142                     Double eastLon = Double.parseDouble(eastLonXpath.evaluate(areaNode));
     142                    Double southLat = Double.valueOf(southLatXpath.evaluate(areaNode));
     143                    Double northLat = Double.valueOf(northLatXpath.evaluate(areaNode));
     144                    Double westLon = Double.valueOf(westLonXpath.evaluate(areaNode));
     145                    Double eastLon = Double.valueOf(eastLonXpath.evaluate(areaNode));
    143146                    attr.min = new Coordinate(southLat, westLon);
    144147                    attr.max = new Coordinate(northLat, eastLon);
     
    281284                            && topLeft.getLat() > attr.min.getLat() && botRight.getLat() < attr.max.getLat()) {
    282285                        a.append(attr.attribution);
    283                         a.append(" ");
     286                        a.append(' ');
    284287                    }
    285288                }
     
    292295    }
    293296
    294     static String computeQuadTree(int zoom, int tilex, int tiley) {
     297    private static String computeQuadTree(int zoom, int tilex, int tiley) {
    295298        StringBuilder k = new StringBuilder();
    296299        for (int i = zoom; i > 0; i--) {
Note: See TracChangeset for help on using the changeset viewer.