Changeset 8626 in josm for trunk/src/org/openstreetmap


Ignore:
Timestamp:
2015-07-28T00:33:09+02:00 (9 years ago)
Author:
wiktorn
Message:

checkstyle and sonar issues fixes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/imagery/TemplatedWMSTileSource.java

    r8624 r8626  
    88import java.text.DecimalFormatSymbols;
    99import java.text.NumberFormat;
    10 import java.util.List;
    1110import java.util.Locale;
    1211import java.util.Map;
     12import java.util.Set;
     13import java.util.TreeSet;
    1314import java.util.concurrent.ConcurrentHashMap;
    1415import java.util.regex.Matcher;
     
    3738public class TemplatedWMSTileSource extends TMSTileSource implements TemplatedTileSource {
    3839    private Map<String, String> headers = new ConcurrentHashMap<>();
    39     private final List<String> serverProjections;
     40    private final Set<String> serverProjections;
    4041    private EastNorth topLeftCorner;
    4142    private Bounds worldBounds;
     
    6364    public TemplatedWMSTileSource(ImageryInfo info) {
    6465        super(info);
    65         this.serverProjections = info.getServerProjections();
     66        this.serverProjections = new TreeSet<>(info.getServerProjections());
    6667        handleTemplate();
    6768        initProjection();
     
    143144        // CHECKSTYLE.ON: LineLength
    144145        boolean switchLatLon = false;
    145         if (baseUrl.toLowerCase().contains("crs=epsg:4326")) {
     146        if (baseUrl.toLowerCase(Locale.US).contains("crs=epsg:4326")) {
    146147            switchLatLon = true;
    147         } else if (baseUrl.toLowerCase().contains("crs=")) {
     148        } else if (baseUrl.toLowerCase(Locale.US).contains("crs=")) {
    148149            // assume WMS 1.3.0
    149150            switchLatLon = Main.getProjection().switchXY();
     
    354355        EastNorth max = proj.latlon2eastNorth(worldBounds.getMax());
    355356
    356         int tilesPerZoom = (int) Math.pow(2, zoom - 1);
     357        int tilesPerZoom = (int) Math.pow(2d, zoom - 1);
    357358        return Math.max(
    358359                Math.abs(max.getY() - min.getY()) / tilesPerZoom,
     
    366367     * pole, the same way they are capped in Mercator projection, so conversions should work properly
    367368     */
    368     private final static Bounds getWorldBounds() {
     369    private static Bounds getWorldBounds() {
    369370        Projection proj = Main.getProjection();
    370371        Bounds bounds = proj.getWorldBoundsLatLon();
Note: See TracChangeset for help on using the changeset viewer.