Changeset 13741 in josm for trunk/src/org


Ignore:
Timestamp:
2018-05-13T09:15:15+02:00 (6 years ago)
Author:
wiktorn
Message:

PMD fixes

Location:
trunk/src/org/openstreetmap/josm
Files:
5 edited

Legend:

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

    r13733 r13741  
    186186
    187187            Collection<String> wmsFormats = wms.getFormats();
    188             final JComboBox<String> formats = new JComboBox<>(wmsFormats.toArray(new String[wmsFormats.size()]));
     188            final JComboBox<String> formats = new JComboBox<>(wmsFormats.toArray(new String[0]));
    189189            formats.setSelectedItem(wms.getPreferredFormat());
    190190            formats.setToolTipText(tr("Select image format for WMS layer"));
  • trunk/src/org/openstreetmap/josm/gui/preferences/imagery/AddWMSLayerPanel.java

    r13734 r13741  
    8686                tree.updateTree(wms);
    8787                Collection<String> wmsFormats = wms.getFormats();
    88                 formats.setModel(new DefaultComboBoxModel<>(wmsFormats.toArray(new String[wmsFormats.size()])));
     88                formats.setModel(new DefaultComboBoxModel<>(wmsFormats.toArray(new String[0])));
    8989                formats.setSelectedItem(wms.getPreferredFormat());
    9090            } catch (MalformedURLException ex1) {
  • trunk/src/org/openstreetmap/josm/gui/preferences/imagery/AddWMTSLayerPanel.java

    r13734 r13741  
    3636public class AddWMTSLayerPanel extends AddImageryPanel {
    3737    private final transient JPanel layerPanel = new JPanel(new GridBagLayout());
    38     private transient JTable layerTable = null;
     38    private transient JTable layerTable;
    3939    private final JCheckBox setDefaultLayer = new JCheckBox(tr("Set default layer?"));
    4040    private List<Entry<String, List<Layer>>> layers;
     
    9292            if (layerTable == null) {
    9393                // did not call get capabilities
    94                 throw new RuntimeException("TODO");
     94                throw new IllegalArgumentException(tr("You need to get fetch layers"));
    9595            }
    9696            int index = layerTable.getSelectedRow();
    9797            if (index < 0) {
    98                 throw new RuntimeException("TODO");
     98                throw new IllegalArgumentException(tr("Invalid layer selected. Index: {1}", index));
    9999            }
    100100            Layer selectedLayer = layers.get(layerTable.convertRowIndexToModel(index)).getValue().get(0);
  • trunk/src/org/openstreetmap/josm/io/CachedFile.java

    r13731 r13741  
    551551
    552552    private static String truncatePath(String directory, String fileName) {
    553         String ret = fileName;
    554553        if (directory.length() + fileName.length() > 255) {
    555554            // Windows doesn't support paths longer than 260, leave 5 chars as safe buffer, 4 will be used by ".tmp"
  • trunk/src/org/openstreetmap/josm/io/imagery/WMSImagery.java

    r13733 r13741  
    183183                try {
    184184                    capabilitiesUrl = new File(workingAddress).toURI().toURL();
    185                 } catch (MalformedURLException e1) {
     185                } catch (MalformedURLException e1) { // NOPMD
    186186                    // do nothing, raise original exception
    187187                }
Note: See TracChangeset for help on using the changeset viewer.