Changeset 13897 in josm


Ignore:
Timestamp:
2018-06-07T02:05:53+02:00 (17 months ago)
Author:
Don-vip
Message:

SonarQube fixes

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/actions/AddImageryLayerAction.java

    r13879 r13897  
    2727import org.openstreetmap.josm.data.imagery.LayerDetails;
    2828import org.openstreetmap.josm.data.imagery.WMTSTileSource;
     29import org.openstreetmap.josm.data.imagery.WMTSTileSource.Layer;
    2930import org.openstreetmap.josm.data.imagery.WMTSTileSource.WMTSGetCapabilitiesException;
    3031import org.openstreetmap.josm.gui.ExtendedDialog;
     
    111112                        String layerName = tileSource.getLayers().stream()
    112113                                .filter(x -> x.getIdentifier().equals(layerId.getLayerName()))
    113                                 .map(x -> x.getUserTitle())
     114                                .map(Layer::getUserTitle)
    114115                                .findFirst()
    115116                                .orElse("");
  • trunk/src/org/openstreetmap/josm/gui/layer/AbstractTileSourceLayer.java

    r13889 r13897  
    387387    }
    388388
     389    /**
     390     * Returns best zoom level.
     391     * @return best zoom level
     392     */
    389393    public int getBestZoom() {
    390394        double factor = getScaleFactor(1); // check the ratio between area of tilesize at zoom 1 to current view
     
    424428        protected final Tile tile;
    425429
    426         private AbstractTileAction(String name, AbstractTileSourceLayer<?> layer, Tile tile) {
     430        AbstractTileAction(String name, AbstractTileSourceLayer<?> layer, Tile tile) {
    427431            super(name);
    428432            this.layer = layer;
    429433            this.tile = tile;
    430434        }
    431 
    432         @Override
    433         public abstract void actionPerformed(ActionEvent arg0);
    434435    }
    435436
     
    441442        }
    442443
    443         private String getSizeString(int size) {
     444        private static String getSizeString(int size) {
    444445            return new StringBuilder().append(size).append('x').append(size).toString();
    445446        }
     
    525526    }
    526527
    527     private void sendOsmTileRequest(Tile tile, String request) {
     528    private static void sendOsmTileRequest(Tile tile, String request) {
    528529        if (tile != null) {
    529530            try {
     
    544545        @Override
    545546        public void actionPerformed(ActionEvent e) {
    546             layer.sendOsmTileRequest(tile, "status");
     547            sendOsmTileRequest(tile, "status");
    547548        }
    548549    }
     
    556557        @Override
    557558        public void actionPerformed(ActionEvent e) {
    558             layer.sendOsmTileRequest(tile, "dirty");
     559            sendOsmTileRequest(tile, "dirty");
    559560        }
    560561    }
  • trunk/test/unit/org/openstreetmap/josm/data/imagery/WMSEndpointTileSourceTest.java

    r13872 r13897  
    33
    44import static org.junit.Assert.assertEquals;
     5import static org.junit.Assert.assertTrue;
    56
    67import java.nio.file.Files;
     
    126127        assertEquals("b8e36d51-119a-423b-b156-d744d54123d5", wmsImageryInfo.getCustomHttpHeaders().get("X-WAAPI-TOKEN"));
    127128        assertEquals("b8e36d51-119a-423b-b156-d744d54123d5", tileSource.getHeaders().get("X-WAAPI-TOKEN"));
    128         assertEquals(true, wmsImageryInfo.isGeoreferenceValid());
     129        assertTrue(wmsImageryInfo.isGeoreferenceValid());
    129130        tileServer.verify(
    130131                WireMock.getRequestedFor(WireMock.urlEqualTo("/capabilities?SERVICE=WMS&REQUEST=GetCapabilities"))
     
    143144                + "BBOX=20037506.6204108,-60112521.5836107,60112521.5836107,-20037506.6204108",
    144145                tileSource.getTileUrl(1, 1, 1));
    145 
    146146    }
    147147}
Note: See TracChangeset for help on using the changeset viewer.