Ignore:
Timestamp:
2017-07-30T00:22:46+02:00 (4 years ago)
Author:
Don-vip
Message:

PMD - VariableNamingConventions

Location:
trunk/src/org/openstreetmap/josm/gui
Files:
16 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/DefaultNameFormatter.java

    r11900 r12537  
    5353    private static DefaultNameFormatter instance;
    5454
    55     private static final List<NameFormatterHook> formatHooks = new LinkedList<>();
     55    private static final List<NameFormatterHook> FORMAT_HOOKS = new LinkedList<>();
    5656
    5757    /**
     
    7575    public static void registerFormatHook(NameFormatterHook hook) {
    7676        if (hook == null) return;
    77         if (!formatHooks.contains(hook)) {
    78             formatHooks.add(0, hook);
     77        if (!FORMAT_HOOKS.contains(hook)) {
     78            FORMAT_HOOKS.add(0, hook);
    7979        }
    8080    }
     
    8787    public static void unregisterFormatHook(NameFormatterHook hook) {
    8888        if (hook == null) return;
    89         if (formatHooks.contains(hook)) {
    90             formatHooks.remove(hook);
     89        if (FORMAT_HOOKS.contains(hook)) {
     90            FORMAT_HOOKS.remove(hook);
    9191        }
    9292    }
     
    203203
    204204        String result = name.toString();
    205         for (NameFormatterHook hook: formatHooks) {
     205        for (NameFormatterHook hook: FORMAT_HOOKS) {
    206206            String hookResult = hook.checkFormat(node, result);
    207207            if (hookResult != null)
     
    295295
    296296        String result = name.toString();
    297         for (NameFormatterHook hook: formatHooks) {
     297        for (NameFormatterHook hook: FORMAT_HOOKS) {
    298298            String hookResult = hook.checkFormat(way, result);
    299299            if (hookResult != null)
     
    333333
    334334        String result = name.toString();
    335         for (NameFormatterHook hook: formatHooks) {
     335        for (NameFormatterHook hook: FORMAT_HOOKS) {
    336336            String hookResult = hook.checkFormat(relation, result);
    337337            if (hookResult != null)
     
    430430        }
    431431
    432         for (NameFormatterHook hook: formatHooks) {
     432        for (NameFormatterHook hook: FORMAT_HOOKS) {
    433433            String hookResult = hook.checkRelationTypeName(relation, name);
    434434            if (hookResult != null)
  • trunk/src/org/openstreetmap/josm/gui/MapSlider.java

    r12391 r12537  
    2020class MapSlider extends JSlider implements PropertyChangeListener, ChangeListener, Helpful {
    2121
    22     private static final double zoomStep = 1.1;
     22    private static final double ZOOM_STEP = 1.1;
    2323    private final MapView mv;
    2424    private boolean preventChange;
     
    4040    public void propertyChange(PropertyChangeEvent evt) {
    4141        double maxScale = this.mv.getMaxScale();
    42         int zoom = (int) Math.round(Math.log(maxScale/mv.getScale())/Math.log(zoomStep));
     42        int zoom = (int) Math.round(Math.log(maxScale/mv.getScale())/Math.log(ZOOM_STEP));
    4343        preventChange = true;
    4444        setValue(zoom);
     
    5959        } else {
    6060            double maxScale = this.mv.getMaxScale();
    61             double scale = maxScale/Math.pow(zoomStep, getValue());
     61            double scale = maxScale/Math.pow(ZOOM_STEP, getValue());
    6262            double snapped = mv.scaleFloor(scale);
    6363            mv.zoomTo(this.mv.getCenter(), snapped);
  • trunk/src/org/openstreetmap/josm/gui/bbox/SlippyMapControler.java

    r11452 r12537  
    3131
    3232    /** A Timer for smoothly moving the map area */
    33     private static final Timer timer = new Timer(true);
     33    private static final Timer TIMER = new Timer(true);
    3434
    3535    /** Does the moving */
     
    229229                scheduled = newMoveTaskState;
    230230                if (newMoveTaskState) {
    231                     timer.schedule(this, 0, timerInterval);
     231                    TIMER.schedule(this, 0, timerInterval);
    232232                } else {
    233233                    // We have to create a new instance because rescheduling a
  • trunk/src/org/openstreetmap/josm/gui/datatransfer/importers/TextTagPaster.java

    r11381 r12537  
    2020 */
    2121public final class TextTagPaster extends AbstractTagPaster {
    22     private static final String help = ht("/Action/PasteTags");
     22    private static final String HELP = ht("/Action/PasteTags");
    2323
    2424    /**
     
    4747        Map<String, String> tags = getTagsImpl(support);
    4848        if (tags.isEmpty()) {
    49             TextTagParser.showBadBufferMessage(help);
     49            TextTagParser.showBadBufferMessage(HELP);
    5050            throw new IOException("Invalid tags to paste.");
    5151        }
  • trunk/src/org/openstreetmap/josm/gui/dialogs/relation/MemberTableLinkedCellRenderer.java

    r10378 r12537  
    1717public class MemberTableLinkedCellRenderer extends MemberTableCellRenderer {
    1818
    19     private static final Image arrowUp = ImageProvider.get("dialogs/relation", "arrowup").getImage();
    20     private static final Image arrowDown = ImageProvider.get("dialogs/relation", "arrowdown").getImage();
    21     private static final Image corners = ImageProvider.get("dialogs/relation", "roundedcorners").getImage();
    22     private static final Image roundabout_right = ImageProvider.get("dialogs/relation", "roundabout_right_tiny").getImage();
    23     private static final Image roundabout_left = ImageProvider.get("dialogs/relation", "roundabout_left_tiny").getImage();
     19    private static final Image ARROW_UP = ImageProvider.get("dialogs/relation", "arrowup").getImage();
     20    private static final Image ARROW_DOWN = ImageProvider.get("dialogs/relation", "arrowdown").getImage();
     21    private static final Image CORNERS = ImageProvider.get("dialogs/relation", "roundedcorners").getImage();
     22    private static final Image ROUNDABOUT_RIGHT = ImageProvider.get("dialogs/relation", "roundabout_right_tiny").getImage();
     23    private static final Image ROUNDABOUT_LEFT = ImageProvider.get("dialogs/relation", "roundabout_left_tiny").getImage();
    2424    private transient WayConnectionType value = new WayConnectionType();
    2525
     
    7575                g.setColor(Color.black);
    7676                y1 = 5;
    77                 g.drawImage(corners, xoff, y1-3, xoff+3, y1, 0, 0, 3, 3, new Color(0, 0, 0, 0), null);
    78                 g.drawImage(corners, xoff+xloop-2, y1-3, xoff+xloop+1, y1, 2, 0, 5, 3, new Color(0, 0, 0, 0), null);
     77                g.drawImage(CORNERS, xoff, y1-3, xoff+3, y1, 0, 0, 3, 3, new Color(0, 0, 0, 0), null);
     78                g.drawImage(CORNERS, xoff+xloop-2, y1-3, xoff+xloop+1, y1, 2, 0, 5, 3, new Color(0, 0, 0, 0), null);
    7979                g.drawLine(xoff+3, y1-3, xoff+xloop-3, y1-3);
    8080            } else {
     
    103103                g.fillRect(xoff-1, y2+2, 3, 3);
    104104                g.drawLine(xoff, y2, xoff, y2+2);
    105                 g.drawImage(corners, xoff+xloop-2, y2+1, xoff+xloop+1, y2+4, 2, 2, 5, 5, new Color(0, 0, 0, 0), null);
     105                g.drawImage(CORNERS, xoff+xloop-2, y2+1, xoff+xloop+1, y2+4, 2, 2, 5, 5, new Color(0, 0, 0, 0), null);
    106106                g.drawLine(xoff+3-1, y2+3, xoff+xloop-3, y2+3);
    107107            } else {
     
    160160        switch (value.direction) {
    161161        case FORWARD:
    162             arrow = arrowDown;
     162            arrow = ARROW_DOWN;
    163163            break;
    164164        case BACKWARD:
    165             arrow = arrowUp;
     165            arrow = ARROW_UP;
    166166            break;
    167167        default:
     
    169169        }
    170170        if (value.direction == Direction.ROUNDABOUT_LEFT) {
    171             g.drawImage(roundabout_left, xoff-6, 1, null);
     171            g.drawImage(ROUNDABOUT_LEFT, xoff-6, 1, null);
    172172        } else if (value.direction == Direction.ROUNDABOUT_RIGHT) {
    173             g.drawImage(roundabout_right, xoff-6, 1, null);
     173            g.drawImage(ROUNDABOUT_RIGHT, xoff-6, 1, null);
    174174        }
    175175
     
    180180
    181181        if (value.isOnewayLoopBackwardPart && value.isOnewayLoopForwardPart) {
    182             if (arrow == arrowDown) {
    183                 arrow = arrowUp;
    184             } else if (arrow == arrowUp) {
    185                 arrow = arrowDown;
     182            if (arrow == ARROW_DOWN) {
     183                arrow = ARROW_UP;
     184            } else if (arrow == ARROW_UP) {
     185                arrow = ARROW_DOWN;
    186186            }
    187187        }
  • trunk/src/org/openstreetmap/josm/gui/dialogs/relation/sort/RelationSorter.java

    r10619 r12537  
    33
    44import java.util.ArrayList;
     5import java.util.Arrays;
    56import java.util.Collection;
    67import java.util.HashMap;
     
    2627    }
    2728
    28     private static final Collection<AdditionalSorter> additionalSorters = new ArrayList<>();
    29     static {
     29    private static final Collection<AdditionalSorter> ADDITIONAL_SORTERS = Arrays.asList(
    3030        // first adequate sorter is used, so order matters
    31         additionalSorters.add(new AssociatedStreetRoleStreetSorter());
    32         additionalSorters.add(new AssociatedStreetRoleAddressHouseSorter());
    33         additionalSorters.add(new PublicTransportRoleStopPlatformSorter());
    34     }
     31        new AssociatedStreetRoleStreetSorter(),
     32        new AssociatedStreetRoleAddressHouseSorter(),
     33        new PublicTransportRoleStopPlatformSorter()
     34    );
    3535
    3636    /**
     
    144144        for (RelationMember m : relationMembers) {
    145145            boolean wasAdded = false;
    146             for (AdditionalSorter sorter : additionalSorters) {
     146            for (AdditionalSorter sorter : ADDITIONAL_SORTERS) {
    147147                if (sorter.acceptsMember(m)) {
    148148                    List<RelationMember> list;
  • trunk/src/org/openstreetmap/josm/gui/help/HelpBrowser.java

    r12525 r12537  
    7777    private final transient HelpContentReader reader;
    7878
    79     private static final JosmAction focusAction = new JosmAction(tr("JOSM Help Browser"), "help", "", null, false, false) {
     79    private static final JosmAction FOCUS_ACTION = new JosmAction(tr("JOSM Help Browser"), "help", "", null, false, false) {
    8080        @Override
    8181        public void actionPerformed(ActionEvent e) {
     
    221221            }
    222222            if (windowMenuItem == null && visible) {
    223                 windowMenuItem = MainMenu.add(Main.main.menu.windowMenu, focusAction, MainMenu.WINDOW_MENU_GROUP.VOLATILE);
     223                windowMenuItem = MainMenu.add(Main.main.menu.windowMenu, FOCUS_ACTION, MainMenu.WINDOW_MENU_GROUP.VOLATILE);
    224224            }
    225225        }
  • trunk/src/org/openstreetmap/josm/gui/io/LayerNameAndFilePathTableCell.java

    r11893 r12537  
    3838 */
    3939class LayerNameAndFilePathTableCell extends JPanel implements TableCellRenderer, TableCellEditor {
    40     private static final Color colorError = new Color(255, 197, 197);
     40    private static final Color COLOR_ERROR = new Color(255, 197, 197);
    4141    private static final String ELLIPSIS = '…' + File.separator;
    4242
     
    4646    private final JButton btnFileChooser = new JButton(new LaunchFileChooserAction());
    4747
    48     private static final GBC defaultCellStyle = GBC.eol().fill(GBC.HORIZONTAL).insets(2, 0, 2, 0);
     48    private static final GBC DEFAULT_CELL_STYLE = GBC.eol().fill(GBC.HORIZONTAL).insets(2, 0, 2, 0);
    4949
    5050    private final transient CellEditorSupport cellEditorSupport = new CellEditorSupport(this);
     
    137137        lblLayerName.setIcon(info.getLayer().getIcon());
    138138        lblLayerName.setText(info.getName());
    139         add(lblLayerName, defaultCellStyle);
     139        add(lblLayerName, DEFAULT_CELL_STYLE);
    140140        return tr("The bold text is the name of the layer.");
    141141    }
     
    164164        }
    165165
    166         lblFilename.setBackground(error ? colorError : getBackground());
    167         btnFileChooser.setBackground(error ? colorError : getBackground());
    168 
    169         add(lblFilename, defaultCellStyle);
     166        lblFilename.setBackground(error ? COLOR_ERROR : getBackground());
     167        btnFileChooser.setBackground(error ? COLOR_ERROR : getBackground());
     168
     169        add(lblFilename, DEFAULT_CELL_STYLE);
    170170        return tr("Click cell to change the file path.") + "<br/>" + tooltip;
    171171    }
  • trunk/src/org/openstreetmap/josm/gui/io/SaveLayersTableColumnModel.java

    r12452 r12537  
    2727        private final JLabel needsUpload = new JLabel(tr("should be uploaded"));
    2828        private final JLabel needsSave = new JLabel(tr("should be saved"));
    29         private static final GBC defaultCellStyle = GBC.eol().fill(GBC.HORIZONTAL).insets(2, 0, 2, 0);
     29        private static final GBC DEFAULT_CELL_STYLE = GBC.eol().fill(GBC.HORIZONTAL).insets(2, 0, 2, 0);
    3030
    3131        /**
     
    4848                String htmlInfoName = Utils.escapeReservedCharactersHTML(info.getName());
    4949                if (info.getLayer().requiresUploadToServer() && !info.getLayer().isUploadDiscouraged()) {
    50                     panel.add(needsUpload, defaultCellStyle);
     50                    panel.add(needsUpload, DEFAULT_CELL_STYLE);
    5151                    sb.append(tr("Layer ''{0}'' has modifications which should be uploaded to the server.", htmlInfoName));
    5252
    5353                } else {
    5454                    if (info.isUploadable()) {
    55                         panel.add(pnlEmpty, defaultCellStyle);
     55                        panel.add(pnlEmpty, DEFAULT_CELL_STYLE);
    5656                    }
    5757                    if (info.getLayer().requiresUploadToServer()) {
     
    6464
    6565                if (info.getLayer().requiresSaveToFile()) {
    66                     panel.add(needsSave, defaultCellStyle);
     66                    panel.add(needsSave, DEFAULT_CELL_STYLE);
    6767                    sb.append(tr("Layer ''{0}'' has modifications which should be saved to its associated file ''{1}''.",
    6868                            htmlInfoName, info.getFile().toString()));
    6969                } else {
    7070                    if (info.isSavable()) {
    71                         panel.add(pnlEmpty, defaultCellStyle);
     71                        panel.add(pnlEmpty, DEFAULT_CELL_STYLE);
    7272                    }
    7373                    sb.append(tr("Layer ''{0}'' has no modifications to be saved.", htmlInfoName));
  • trunk/src/org/openstreetmap/josm/gui/io/UploadDialog.java

    r12531 r12537  
    7575
    7676    /** list of custom components that can be added by plugins at JOSM startup */
    77     private static final Collection<Component> customComponents = new ArrayList<>();
     77    private static final Collection<Component> CUSTOM_COMPONENTS = new ArrayList<>();
    7878
    7979    /** the "created_by" changeset OSM key */
     
    136136
    137137        // Custom components
    138         for (Component c : customComponents) {
     138        for (Component c : CUSTOM_COMPONENTS) {
    139139            pnl.add(c, GBC.eol().fill(GBC.HORIZONTAL));
    140140        }
     
    406406    public static boolean addCustomComponent(Component c) {
    407407        if (c != null) {
    408             return customComponents.add(c);
     408            return CUSTOM_COMPONENTS.add(c);
    409409        }
    410410        return false;
  • trunk/src/org/openstreetmap/josm/gui/layer/imagery/SharpenImageProcessor.java

    r10755 r12537  
    2222    private ConvolveOp op;
    2323
    24     private static float[] KERNEL_IDENTITY = new float[] {
     24    private static final float[] KERNEL_IDENTITY = new float[] {
    2525        0, 0, 0,
    2626        0, 1, 0,
     
    2828    };
    2929
    30     private static float[] KERNEL_BLUR = new float[] {
     30    private static final float[] KERNEL_BLUR = new float[] {
    3131        1f / 16, 2f / 16, 1f / 16,
    3232        2f / 16, 4f / 16, 2f / 16,
     
    3434    };
    3535
    36     private static float[] KERNEL_SHARPEN = new float[] {
     36    private static final float[] KERNEL_SHARPEN = new float[] {
    3737        -.5f, -1f, -.5f,
    3838         -1f, 7, -1f,
  • trunk/src/org/openstreetmap/josm/gui/preferences/PreferenceTabbedPane.java

    r12005 r12537  
    251251    // all created tabs
    252252    private final transient List<PreferenceTab> tabs = new ArrayList<>();
    253     private static final Collection<PreferenceSettingFactory> settingsFactories = new LinkedList<>();
    254     private static final PreferenceSettingFactory advancedPreferenceFactory = new AdvancedPreference.Factory();
     253    private static final Collection<PreferenceSettingFactory> SETTINGS_FACTORIES = new LinkedList<>();
     254    private static final PreferenceSettingFactory ADVANCED_PREFERENCE_FACTORY = new AdvancedPreference.Factory();
    255255    private final transient List<PreferenceSetting> settings = new ArrayList<>();
    256256
     
    439439
    440440    public void buildGui() {
    441         Collection<PreferenceSettingFactory> factories = new ArrayList<>(settingsFactories);
     441        Collection<PreferenceSettingFactory> factories = new ArrayList<>(SETTINGS_FACTORIES);
    442442        factories.addAll(PluginHandler.getPreferenceSetting());
    443         factories.add(advancedPreferenceFactory);
     443        factories.add(ADVANCED_PREFERENCE_FACTORY);
    444444
    445445        for (PreferenceSettingFactory factory : factories) {
     
    531531    static {
    532532        // order is important!
    533         settingsFactories.add(new DisplayPreference.Factory());
    534         settingsFactories.add(new DrawingPreference.Factory());
    535         settingsFactories.add(new ColorPreference.Factory());
    536         settingsFactories.add(new LafPreference.Factory());
    537         settingsFactories.add(new LanguagePreference.Factory());
    538         settingsFactories.add(new ServerAccessPreference.Factory());
    539         settingsFactories.add(new AuthenticationPreference.Factory());
    540         settingsFactories.add(new ProxyPreference.Factory());
    541         settingsFactories.add(new OverpassServerPreference.Factory());
    542         settingsFactories.add(new MapPreference.Factory());
    543         settingsFactories.add(new ProjectionPreference.Factory());
    544         settingsFactories.add(new MapPaintPreference.Factory());
    545         settingsFactories.add(new TaggingPresetPreference.Factory());
    546         settingsFactories.add(new BackupPreference.Factory());
    547         settingsFactories.add(new PluginPreference.Factory());
    548         settingsFactories.add(Main.toolbar);
    549         settingsFactories.add(new AudioPreference.Factory());
    550         settingsFactories.add(new ShortcutPreference.Factory());
    551         settingsFactories.add(new ValidatorPreference.Factory());
    552         settingsFactories.add(new ValidatorTestsPreference.Factory());
    553         settingsFactories.add(new ValidatorTagCheckerRulesPreference.Factory());
    554         settingsFactories.add(new RemoteControlPreference.Factory());
    555         settingsFactories.add(new ImageryPreference.Factory());
     533        SETTINGS_FACTORIES.add(new DisplayPreference.Factory());
     534        SETTINGS_FACTORIES.add(new DrawingPreference.Factory());
     535        SETTINGS_FACTORIES.add(new ColorPreference.Factory());
     536        SETTINGS_FACTORIES.add(new LafPreference.Factory());
     537        SETTINGS_FACTORIES.add(new LanguagePreference.Factory());
     538        SETTINGS_FACTORIES.add(new ServerAccessPreference.Factory());
     539        SETTINGS_FACTORIES.add(new AuthenticationPreference.Factory());
     540        SETTINGS_FACTORIES.add(new ProxyPreference.Factory());
     541        SETTINGS_FACTORIES.add(new OverpassServerPreference.Factory());
     542        SETTINGS_FACTORIES.add(new MapPreference.Factory());
     543        SETTINGS_FACTORIES.add(new ProjectionPreference.Factory());
     544        SETTINGS_FACTORIES.add(new MapPaintPreference.Factory());
     545        SETTINGS_FACTORIES.add(new TaggingPresetPreference.Factory());
     546        SETTINGS_FACTORIES.add(new BackupPreference.Factory());
     547        SETTINGS_FACTORIES.add(new PluginPreference.Factory());
     548        SETTINGS_FACTORIES.add(Main.toolbar);
     549        SETTINGS_FACTORIES.add(new AudioPreference.Factory());
     550        SETTINGS_FACTORIES.add(new ShortcutPreference.Factory());
     551        SETTINGS_FACTORIES.add(new ValidatorPreference.Factory());
     552        SETTINGS_FACTORIES.add(new ValidatorTestsPreference.Factory());
     553        SETTINGS_FACTORIES.add(new ValidatorTagCheckerRulesPreference.Factory());
     554        SETTINGS_FACTORIES.add(new RemoteControlPreference.Factory());
     555        SETTINGS_FACTORIES.add(new ImageryPreference.Factory());
    556556    }
    557557
  • trunk/src/org/openstreetmap/josm/gui/preferences/projection/LambertProjectionChoice.java

    r12280 r12537  
    2222public class LambertProjectionChoice extends ListProjectionChoice {
    2323
    24     private static final String[] lambert4zones = {
     24    private static final String[] LAMBERT_4_ZONES = {
    2525        tr("{0} ({1} to {2} degrees)", 1, "51.30", "48.15"),
    2626        tr("{0} ({1} to {2} degrees)", 2, "48.15", "45.45"),
     
    3333     */
    3434    public LambertProjectionChoice() {
    35         super(tr("Lambert 4 Zones (France)"), /* NO-ICON */ "core:lambert", lambert4zones, tr("Lambert CC Zone"));
     35        super(tr("Lambert 4 Zones (France)"), /* NO-ICON */ "core:lambert", LAMBERT_4_ZONES, tr("Lambert CC Zone"));
    3636    }
    3737
  • trunk/src/org/openstreetmap/josm/gui/preferences/projection/UTMFranceDOMProjectionChoice.java

    r12223 r12537  
    1616public class UTMFranceDOMProjectionChoice extends ListProjectionChoice {
    1717
    18     private static final String FortMarigotName = tr("Guadeloupe Fort-Marigot 1949");
    19     private static final String SainteAnneName = tr("Guadeloupe Ste-Anne 1948");
    20     private static final String MartiniqueName = tr("Martinique Fort Desaix 1952");
    21     private static final String Reunion92Name = tr("Reunion RGR92");
    22     private static final String Guyane92Name = tr("Guyane RGFG95");
    23     private static final String[] utmGeodesicsNames = {FortMarigotName, SainteAnneName, MartiniqueName, Reunion92Name, Guyane92Name};
     18    private static final String FORT_MARIGOT_NAME = tr("Guadeloupe Fort-Marigot 1949");
     19    private static final String SAINTE_ANNE_NAME = tr("Guadeloupe Ste-Anne 1948");
     20    private static final String MARTINIQUE_NAME = tr("Martinique Fort Desaix 1952");
     21    private static final String REUNION_92_NAME = tr("Reunion RGR92");
     22    private static final String GUYANE_92_NAME = tr("Guyane RGFG95");
     23    private static final String[] UTM_GEODESIC_NAMES = {FORT_MARIGOT_NAME, SAINTE_ANNE_NAME, MARTINIQUE_NAME, REUNION_92_NAME, GUYANE_92_NAME};
    2424
    25     private static final Integer FortMarigotEPSG = 2969;
    26     private static final Integer SainteAnneEPSG = 2970;
    27     private static final Integer MartiniqueEPSG = 2973;
    28     private static final Integer ReunionEPSG = 2975;
    29     private static final Integer GuyaneEPSG = 2972;
    30     private static final Integer[] utmEPSGs = {FortMarigotEPSG, SainteAnneEPSG, MartiniqueEPSG, ReunionEPSG, GuyaneEPSG };
     25    private static final Integer FORT_MARIGOT_EPSG = 2969;
     26    private static final Integer SAINTE_ANNE_EPSG = 2970;
     27    private static final Integer MARTINIQUE_EPSG = 2973;
     28    private static final Integer REUNION_EPSG = 2975;
     29    private static final Integer GUYANE_EPSG = 2972;
     30    private static final Integer[] UTM_EPSGS = {FORT_MARIGOT_EPSG, SAINTE_ANNE_EPSG, MARTINIQUE_EPSG, REUNION_EPSG, GUYANE_EPSG };
    3131
    3232    /**
     
    3434     */
    3535    public UTMFranceDOMProjectionChoice() {
    36         super(tr("UTM France (DOM)"), /* NO-ICON */ "core:utmfrancedom", utmGeodesicsNames, tr("UTM Geodesic system"));
     36        super(tr("UTM France (DOM)"), /* NO-ICON */ "core:utmfrancedom", UTM_GEODESIC_NAMES, tr("UTM Geodesic system"));
    3737    }
    3838
     
    5454    @Override
    5555    public String getProjectionName() {
    56         return utmGeodesicsNames[index];
     56        return UTM_GEODESIC_NAMES[index];
    5757    }
    5858
    5959    @Override
    6060    public String getCurrentCode() {
    61         return "EPSG:" + utmEPSGs[index];
     61        return "EPSG:" + UTM_EPSGS[index];
    6262    }
    6363
    6464    @Override
    6565    public String[] allCodes() {
    66         String[] res = new String[utmEPSGs.length];
    67         for (int i = 0; i < utmEPSGs.length; ++i) {
    68             res[i] = "EPSG:" + utmEPSGs[i];
     66        String[] res = new String[UTM_EPSGS.length];
     67        for (int i = 0; i < UTM_EPSGS.length; ++i) {
     68            res[i] = "EPSG:" + UTM_EPSGS[i];
    6969        }
    7070        return res;
     
    7373    @Override
    7474    public Collection<String> getPreferencesFromCode(String code) {
    75         for (int i = 0; i < utmEPSGs.length; i++) {
    76             if (("EPSG:" + utmEPSGs[i]).equals(code))
     75        for (int i = 0; i < UTM_EPSGS.length; i++) {
     76            if (("EPSG:" + UTM_EPSGS[i]).equals(code))
    7777                return Collections.singleton(Integer.toString(i+1));
    7878        }
  • trunk/src/org/openstreetmap/josm/gui/tagging/presets/TaggingPresets.java

    r12077 r12537  
    3131
    3232    /** The collection of tagging presets */
    33     private static final Collection<TaggingPreset> taggingPresets = new ArrayList<>();
     33    private static final Collection<TaggingPreset> TAGGING_PRESETS = new ArrayList<>();
    3434
    3535    /** cache for key/value pairs found in the preset */
     
    3939
    4040    /** The collection of listeners */
    41     private static final Collection<TaggingPresetListener> listeners = new ArrayList<>();
     41    private static final Collection<TaggingPresetListener> LISTENERS = new ArrayList<>();
    4242
    4343    private TaggingPresets() {
     
    4949     */
    5050    public static void readFromPreferences() {
    51         taggingPresets.clear();
    52         taggingPresets.addAll(TaggingPresetReader.readFromPreferences(false, false));
    53         cachePresets(taggingPresets);
     51        TAGGING_PRESETS.clear();
     52        TAGGING_PRESETS.addAll(TaggingPresetReader.readFromPreferences(false, false));
     53        cachePresets(TAGGING_PRESETS);
    5454    }
    5555
     
    5959    public static void initialize() {
    6060        readFromPreferences();
    61         for (TaggingPreset tp: taggingPresets) {
     61        for (TaggingPreset tp: TAGGING_PRESETS) {
    6262            if (!(tp instanceof TaggingPresetSeparator)) {
    6363                Main.toolbar.register(tp);
    6464            }
    6565        }
    66         if (taggingPresets.isEmpty()) {
     66        if (TAGGING_PRESETS.isEmpty()) {
    6767            Main.main.menu.presetsMenu.setVisible(false);
    6868        } else {
    6969            Map<TaggingPresetMenu, JMenu> submenus = new HashMap<>();
    70             for (final TaggingPreset p : taggingPresets) {
     70            for (final TaggingPreset p : TAGGING_PRESETS) {
    7171                JMenu m = p.group != null ? submenus.get(p.group) : Main.main.menu.presetsMenu;
    7272                if (m == null && p.group != null) {
     
    136136     */
    137137    public static Collection<TaggingPreset> getTaggingPresets() {
    138         return Collections.unmodifiableCollection(taggingPresets);
     138        return Collections.unmodifiableCollection(TAGGING_PRESETS);
    139139    }
    140140
     
    199199     */
    200200    public static void addTaggingPresets(Collection<TaggingPreset> presets) {
    201         if (presets != null && taggingPresets.addAll(presets)) {
    202             for (TaggingPresetListener listener : listeners) {
     201        if (presets != null && TAGGING_PRESETS.addAll(presets)) {
     202            for (TaggingPresetListener listener : LISTENERS) {
    203203                listener.taggingPresetsModified();
    204204            }
     
    212212    public static void addListener(TaggingPresetListener listener) {
    213213        if (listener != null) {
    214             listeners.add(listener);
     214            LISTENERS.add(listener);
    215215        }
    216216    }
     
    222222    public static void removeListener(TaggingPresetListener listener) {
    223223        if (listener != null) {
    224             listeners.remove(listener);
     224            LISTENERS.remove(listener);
    225225        }
    226226    }
  • trunk/src/org/openstreetmap/josm/gui/util/FileFilterAllFiles.java

    r8126 r12537  
    1414public class FileFilterAllFiles extends FileFilter {
    1515
    16     private static FileFilterAllFiles INSTANCE;
     16    private static FileFilterAllFiles instance;
    1717
    1818    /**
     
    2121     */
    2222    public static synchronized FileFilterAllFiles getInstance() {
    23         if (INSTANCE == null) {
    24             INSTANCE = new FileFilterAllFiles();
     23        if (instance == null) {
     24            instance = new FileFilterAllFiles();
    2525        }
    26         return INSTANCE;
     26        return instance;
    2727    }
    2828
Note: See TracChangeset for help on using the changeset viewer.