Changeset 9992 in josm


Ignore:
Timestamp:
2016-03-14T09:56:22+01:00 (8 years ago)
Author:
Don-vip
Message:

sonar - fix more issues

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

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/projection/proj/AbstractProj.java

    r9628 r9992  
    3939     * {@link #en2}, {@link #en3}, {@link #en4}.
    4040     */
    41     private static final double C00 = 1.0,
    42                                 C02 = 0.25,
    43                                 C04 = 0.046875,
    44                                 C06 = 0.01953125,
    45                                 C08 = 0.01068115234375,
    46                                 C22 = 0.75,
    47                                 C44 = 0.46875,
    48                                 C46 = 0.01302083333333333333,
    49                                 C48 = 0.00712076822916666666,
    50                                 C66 = 0.36458333333333333333,
    51                                 C68 = 0.00569661458333333333,
    52                                 C88 = 0.3076171875;
     41    private static final double C00 = 1.0;
     42    private static final double C02 = 0.25;
     43    private static final double C04 = 0.046875;
     44    private static final double C06 = 0.01953125;
     45    private static final double C08 = 0.01068115234375;
     46    private static final double C22 = 0.75;
     47    private static final double C44 = 0.46875;
     48    private static final double C46 = 0.01302083333333333333;
     49    private static final double C48 = 0.00712076822916666666;
     50    private static final double C66 = 0.36458333333333333333;
     51    private static final double C68 = 0.00569661458333333333;
     52    private static final double C88 = 0.3076171875;
    5353
    5454    /**
  • trunk/src/org/openstreetmap/josm/gui/FileDrop.java

    r9988 r9992  
    3434import org.openstreetmap.josm.Main;
    3535import org.openstreetmap.josm.actions.OpenFileAction;
    36 import org.openstreetmap.josm.gui.FileDrop.TransferableObject;
    3736
    3837// CHECKSTYLE.OFF: HideUtilityClassConstructor
     
    8483    private DropTargetListener dropListener;
    8584
    86     /** Discover if the running JVM is modern enough to have drag and drop. */
    87     private static Boolean supportsDnD;
    88 
    8985    // Default border color
    9086    private static Color defaultBorderColor = new Color(0f, 0f, 1f, 0.25f);
  • trunk/src/org/openstreetmap/josm/gui/dialogs/FilterDialog.java

    r9975 r9992  
    9898            KeyEvent.VK_H, Shortcut.ALT_CTRL);
    9999
    100     protected static final String[] COLUMN_TOOLTIPS = {
     100    private static final String[] COLUMN_TOOLTIPS = {
    101101            Main.platform.makeTooltip(tr("Enable filter"), ENABLE_FILTER_SHORTCUT),
    102102            Main.platform.makeTooltip(tr("Hiding filter"), HIDING_FILTER_SHORTCUT),
     
    180180            public void actionPerformed(ActionEvent e) {
    181181                int index = userTable.getSelectionModel().getMinSelectionIndex();
    182                 if (index < 0) return;
    183                 filterModel.removeFilter(index);
     182                if (index >= 0) {
     183                    filterModel.removeFilter(index);
     184                }
    184185            }
    185186        });
     
    194195            public void actionPerformed(ActionEvent e) {
    195196                int index = userTable.getSelectionModel().getMinSelectionIndex();
    196                 if (index < 0) return;
    197                 filterModel.moveUpFilter(index);
    198                 userTable.getSelectionModel().setSelectionInterval(index-1, index-1);
    199             }
    200 
     197                if (index >= 0) {
     198                    filterModel.moveUpFilter(index);
     199                    userTable.getSelectionModel().setSelectionInterval(index-1, index-1);
     200                }
     201            }
    201202        });
    202203        SideButton downButton = new SideButton(new AbstractAction() {
     
    210211            public void actionPerformed(ActionEvent e) {
    211212                int index = userTable.getSelectionModel().getMinSelectionIndex();
    212                 if (index < 0) return;
    213                 filterModel.moveDownFilter(index);
    214                 userTable.getSelectionModel().setSelectionInterval(index+1, index+1);
     213                if (index >= 0) {
     214                    filterModel.moveDownFilter(index);
     215                    userTable.getSelectionModel().setSelectionInterval(index+1, index+1);
     216                }
    215217            }
    216218        });
     
    221223            public void actionPerformed(ActionEvent e) {
    222224                int index = userTable.getSelectedRow();
    223                 if (index < 0) return;
    224                 Filter filter = filterModel.getFilter(index);
    225                 filterModel.setValueAt(!filter.enable, index, FilterTableModel.COL_ENABLED);
     225                if (index >= 0) {
     226                    Filter filter = filterModel.getFilter(index);
     227                    filterModel.setValueAt(!filter.enable, index, FilterTableModel.COL_ENABLED);
     228                }
    226229            }
    227230        });
     
    232235            public void actionPerformed(ActionEvent e) {
    233236                int index = userTable.getSelectedRow();
    234                 if (index < 0) return;
    235                 Filter filter = filterModel.getFilter(index);
    236                 filterModel.setValueAt(!filter.hiding, index, FilterTableModel.COL_HIDING);
     237                if (index >= 0) {
     238                    Filter filter = filterModel.getFilter(index);
     239                    filterModel.setValueAt(!filter.hiding, index, FilterTableModel.COL_HIDING);
     240                }
    237241            }
    238242        });
  • trunk/src/org/openstreetmap/josm/gui/layer/WMTSLayer.java

    r9946 r9992  
    3030     * default setting of autozoom per layer
    3131     */
    32     public static final BooleanProperty PROP_DEFAULT_AUTOZOOM = new BooleanProperty("imagery.wmts.default_autozoom", true);
     32    public static final BooleanProperty PROP_DEFAULT_AUTOZOOM_WMTS = new BooleanProperty("imagery.wmts.default_autozoom", true);
    3333    private static final String CACHE_REGION_NAME = "WMTS";
    3434
     
    3939    public WMTSLayer(ImageryInfo info) {
    4040        super(info);
    41         autoZoom = PROP_DEFAULT_AUTOZOOM.get();
     41        autoZoom = PROP_DEFAULT_AUTOZOOM_WMTS.get();
    4242    }
    4343
     
    6363            return 0;
    6464        ScaleList scaleList = getNativeScales();
    65         Scale snap = null;
    6665        if (scaleList == null) {
    6766            return getMaxZoomLvl();
    6867        }
    69         snap = scaleList.getSnapScale(Main.map.mapView.getScale(), false);
     68        Scale snap = scaleList.getSnapScale(Main.map.mapView.getScale(), false);
    7069        return Math.max(
    7170                getMinZoomLvl(),
  • trunk/src/org/openstreetmap/josm/gui/preferences/projection/LambertCC9ZonesProjectionChoice.java

    r8836 r9992  
    3636    }
    3737
    38     private class LambertCC9CBPanel extends CBPanel {
     38    private static class LambertCC9CBPanel extends CBPanel {
    3939        LambertCC9CBPanel(String[] entries, int initialIndex, String label, ActionListener listener) {
    4040            super(entries, initialIndex, label, listener);
  • trunk/src/org/openstreetmap/josm/gui/preferences/projection/LambertProjectionChoice.java

    r8836 r9992  
    3131    }
    3232
    33     private class LambertCBPanel extends CBPanel {
     33    private static class LambertCBPanel extends CBPanel {
    3434        LambertCBPanel(String[] entries, int initialIndex, String label, ActionListener listener) {
    3535            super(entries, initialIndex, label, listener);
  • trunk/src/org/openstreetmap/josm/tools/template_engine/ContextSwitchTemplate.java

    r9990 r9992  
    4646    }
    4747
    48     private class ParentSet extends ContextProvider {
     48    private static class ParentSet extends ContextProvider {
    4949        private final Match childCondition;
    5050
     
    8181    }
    8282
    83     private class ChildSet extends ContextProvider {
     83    private static class ChildSet extends ContextProvider {
    8484        private final Match parentCondition;
    8585
     
    124124    }
    125125
    126     private class OrSet extends ContextProvider {
     126    private static class OrSet extends ContextProvider {
    127127        private final ContextProvider lhs;
    128128        private final ContextProvider rhs;
     
    155155    }
    156156
    157     private class AndSet extends ContextProvider {
     157    private static class AndSet extends ContextProvider {
    158158        private final ContextProvider lhs;
    159159        private final ContextProvider rhs;
Note: See TracChangeset for help on using the changeset viewer.