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

[jmapviewer] fix a bunch of Sonar issues

Location:
applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer
Files:
7 edited

Legend:

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

    r31434 r31435  
    3939    private static final long serialVersionUID = 1L;
    4040
    41     private JMapViewerTree treeMap = null;
    42 
    43     private JLabel zoomLabel = null;
    44     private JLabel zoomValue = null;
    45 
    46     private JLabel mperpLabelName = null;
    47     private JLabel mperpLabelValue = null;
     41    private final JMapViewerTree treeMap;
     42
     43    private final JLabel zoomLabel;
     44    private final JLabel zoomValue;
     45
     46    private final JLabel mperpLabelName;
     47    private final JLabel mperpLabelValue;
    4848
    4949    /**
  • applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/JobDispatcher.java

    r31434 r31435  
    2323    private static int workerThreadMaxCount = 8;
    2424
    25     private BlockingDeque<TileJob> jobQueue = new LinkedBlockingDeque<>();
     25    private final BlockingDeque<TileJob> jobQueue = new LinkedBlockingDeque<>();
    2626
    2727    private JobDispatcher() {
     
    113113    }
    114114
    115     protected JobThread addWorkerThread() {
     115    private JobThread addWorkerThread() {
    116116        JobThread jobThread = new JobThread(++workerThreadId);
    117117        synchronized (this) {
  • applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/LayerGroup.java

    r31429 r31435  
    5353    public void calculateVisibleTexts() {
    5454        Boolean calculate = null;
    55         if (layers != null && layers.size() > 0) {
     55        if (layers != null && !layers.isEmpty()) {
    5656            calculate = layers.get(0).isVisibleTexts();
    5757            for (int i = 1; i < layers.size(); i++) {
  • applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/TileXY.java

    r31429 r31435  
    1010     * x index of the tile (horizontal)
    1111     */
    12     private double x;
     12    private final double x;
     13
    1314    /**
    1415     * y number of the tile (vertical)
    1516     */
    16     private double y;
     17    private final double y;
    1718
    1819    /**
  • applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/tilesources/AbstractTMSTileSource.java

    r31434 r31435  
    2626    protected String baseUrl;
    2727    protected String id;
    28     private Map<String, String> noTileHeaders;
    29     private Map<String, String> metadataHeaders;
     28    private final Map<String, String> noTileHeaders;
     29    private final Map<String, String> metadataHeaders;
    3030    protected int tileSize;
    3131    protected OsmMercator osmMercator;
     
    4646        this.metadataHeaders = info.getMetadataHeaders();
    4747        this.tileSize = info.getTileSize();
    48         osmMercator = new OsmMercator(this.tileSize);
     48        this.osmMercator = new OsmMercator(this.tileSize);
    4949    }
    5050
  • applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/tilesources/ScanexTileSource.java

    r31434 r31435  
    4343    }
    4444
    45     /* IRS by default */
     45    /** IRS by default */
    4646    private ScanexLayer layer = ScanexLayer.IRS;
    4747
     
    5050        String url = info.getUrl();
    5151
    52         for (ScanexLayer layer : ScanexLayer.values()) {
    53             if (url.equalsIgnoreCase(layer.getName())) {
    54                 this.layer = layer;
    55                 /*
    56                  * Override baseUrl and maxZoom in base class.
    57                  */
     52        for (ScanexLayer slayer : ScanexLayer.values()) {
     53            if (url.equalsIgnoreCase(slayer.getName())) {
     54                this.layer = slayer;
     55                // Override baseUrl and maxZoom in base class.
    5856                this.baseUrl = DEFAULT_URL;
    5957                if (maxZoom == 0)
  • applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/tilesources/TemplatedTMSTileSource.java

    r31433 r31435  
    3434    private Random rand = null;
    3535    private String[] randomParts = null;
    36     private Map<String, String> headers = new HashMap<>();
     36    private final Map<String, String> headers = new HashMap<>();
    3737
    3838    private static final String COOKIE_HEADER   = "Cookie";
Note: See TracChangeset for help on using the changeset viewer.