Changeset 12537 in josm


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

PMD - VariableNamingConventions

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

Legend:

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

    r11224 r12537  
    3030
    3131    // TODO: Switch to checked list. We can do this as soon as we do not see any more warnings.
    32     private static final ListenerList<ExpertModeChangeListener> listeners = ListenerList.createUnchecked();
    33     private static final ListenerList<Component> visibilityToggleListeners = ListenerList.createUnchecked();
     32    private static final ListenerList<ExpertModeChangeListener> LISTENERS = ListenerList.createUnchecked();
     33    private static final ListenerList<Component> VISIBILITY_TOGGLE_LISTENERS = ListenerList.createUnchecked();
    3434
    3535    private static final BooleanProperty PREF_EXPERT = new BooleanProperty("expert", false);
     
    3838
    3939    private static synchronized void fireExpertModeChanged(boolean isExpert) {
    40         listeners.fireEvent(listener -> listener.expertChanged(isExpert));
    41         visibilityToggleListeners.fireEvent(c -> c.setVisible(isExpert));
     40        LISTENERS.fireEvent(listener -> listener.expertChanged(isExpert));
     41        VISIBILITY_TOGGLE_LISTENERS.fireEvent(c -> c.setVisible(isExpert));
    4242    }
    4343
     
    5353    public static synchronized void addExpertModeChangeListener(ExpertModeChangeListener listener, boolean fireWhenAdding) {
    5454        if (listener == null) return;
    55         listeners.addWeakListener(listener);
     55        LISTENERS.addWeakListener(listener);
    5656        if (fireWhenAdding) {
    5757            listener.expertChanged(isExpert());
     
    6666    public static synchronized void removeExpertModeChangeListener(ExpertModeChangeListener listener) {
    6767        if (listener == null) return;
    68         listeners.removeListener(listener);
     68        LISTENERS.removeListener(listener);
    6969    }
    7070
     
    7575    public static synchronized void addVisibilitySwitcher(Component c) {
    7676        if (c == null) return;
    77         visibilityToggleListeners.addWeakListener(c);
     77        VISIBILITY_TOGGLE_LISTENERS.addWeakListener(c);
    7878        c.setVisible(isExpert());
    7979    }
     
    8686    public static synchronized void removeVisibilitySwitcher(Component c) {
    8787        if (c == null) return;
    88         visibilityToggleListeners.removeListener(c);
     88        VISIBILITY_TOGGLE_LISTENERS.removeListener(c);
    8989    }
    9090
  • trunk/src/org/openstreetmap/josm/actions/ExtensionFileFilter.java

    r10873 r12537  
    4242     * @since 4869
    4343     */
    44     private static final ArrayList<FileImporter> importers;
     44    private static final ArrayList<FileImporter> IMPORTERS;
    4545
    4646    /**
     
    4848     * @since 4869
    4949     */
    50     private static final ArrayList<FileExporter> exporters;
     50    private static final ArrayList<FileExporter> EXPORTERS;
    5151
    5252    // add some file types only if the relevant classes are there.
     
    5656    static {
    5757
    58         importers = new ArrayList<>();
     58        IMPORTERS = new ArrayList<>();
    5959
    6060        final List<Class<? extends FileImporter>> importerNames = Arrays.asList(
     
    7373            try {
    7474                FileImporter importer = importerClass.getConstructor().newInstance();
    75                 importers.add(importer);
     75                IMPORTERS.add(importer);
    7676            } catch (ReflectiveOperationException e) {
    7777                Main.debug(e);
     
    9595        }
    9696
    97         exporters = new ArrayList<>();
     97        EXPORTERS = new ArrayList<>();
    9898
    9999        final List<Class<? extends FileExporter>> exporterClasses = Arrays.asList(
     
    110110            try {
    111111                FileExporter exporter = exporterClass.getConstructor().newInstance();
    112                 exporters.add(exporter);
     112                EXPORTERS.add(exporter);
    113113                Main.getLayerManager().addAndFireActiveLayerChangeListener(exporter);
    114114            } catch (ReflectiveOperationException e) {
     
    147147    public static void addImporter(FileImporter importer) {
    148148        if (importer != null) {
    149             importers.add(importer);
     149            IMPORTERS.add(importer);
    150150        }
    151151    }
     
    158158    public static void addImporterFirst(FileImporter importer) {
    159159        if (importer != null) {
    160             importers.add(0, importer);
     160            IMPORTERS.add(0, importer);
    161161        }
    162162    }
     
    169169    public static void addExporter(FileExporter exporter) {
    170170        if (exporter != null) {
    171             exporters.add(exporter);
     171            EXPORTERS.add(exporter);
    172172        }
    173173    }
     
    180180    public static void addExporterFirst(FileExporter exporter) {
    181181        if (exporter != null) {
    182             exporters.add(0, exporter);
     182            EXPORTERS.add(0, exporter);
    183183        }
    184184    }
     
    190190     */
    191191    public static List<FileImporter> getImporters() {
    192         return Collections.unmodifiableList(importers);
     192        return Collections.unmodifiableList(IMPORTERS);
    193193    }
    194194
     
    199199     */
    200200    public static List<FileExporter> getExporters() {
    201         return Collections.unmodifiableList(exporters);
     201        return Collections.unmodifiableList(EXPORTERS);
    202202    }
    203203
     
    213213     */
    214214    public static void updateAllFormatsImporter() {
    215         for (int i = 0; i < importers.size(); i++) {
    216             if (importers.get(i) instanceof AllFormatsImporter) {
    217                 importers.set(i, new AllFormatsImporter());
     215        for (int i = 0; i < IMPORTERS.size(); i++) {
     216            if (IMPORTERS.get(i) instanceof AllFormatsImporter) {
     217                IMPORTERS.set(i, new AllFormatsImporter());
    218218            }
    219219        }
     
    231231        updateAllFormatsImporter();
    232232        List<ExtensionFileFilter> filters = new LinkedList<>();
    233         for (FileImporter importer : importers) {
     233        for (FileImporter importer : IMPORTERS) {
    234234            filters.add(importer.filter);
    235235        }
     
    248248    public static List<ExtensionFileFilter> getExportExtensionFileFilters() {
    249249        List<ExtensionFileFilter> filters = new LinkedList<>();
    250         for (FileExporter exporter : exporters) {
     250        for (FileExporter exporter : EXPORTERS) {
    251251            if (filters.contains(exporter.filter) || !exporter.isEnabled()) {
    252252                continue;
     
    267267    public static ExtensionFileFilter getDefaultImportExtensionFileFilter(String extension) {
    268268        if (extension == null) return new AllFormatsImporter().filter;
    269         for (FileImporter importer : importers) {
     269        for (FileImporter importer : IMPORTERS) {
    270270            if (extension.equals(importer.filter.getDefaultExtension()))
    271271                return importer.filter;
     
    283283    public static ExtensionFileFilter getDefaultExportExtensionFileFilter(String extension) {
    284284        if (extension == null) return new AllFormatsImporter().filter;
    285         for (FileExporter exporter : exporters) {
     285        for (FileExporter exporter : EXPORTERS) {
    286286            if (extension.equals(exporter.filter.getDefaultExtension()))
    287287                return exporter.filter;
     
    290290        // scan all supported extensions
    291291        File file = new File("file." + extension);
    292         for (FileExporter exporter : exporters) {
     292        for (FileExporter exporter : EXPORTERS) {
    293293            if (exporter.filter.accept(file))
    294294                return exporter.filter;
  • trunk/src/org/openstreetmap/josm/actions/OrthogonalizeAction.java

    r12527 r12537  
    7575     * Remember movements, so the user can later undo it for certain nodes
    7676     */
    77     private static final Map<Node, EastNorth> rememberMovements = new HashMap<>();
     77    private static final Map<Node, EastNorth> REMEMBER_MOVEMENTS = new HashMap<>();
    7878
    7979    /**
     
    108108                    if (!(p instanceof Node)) throw new InvalidUserInputException("selected object is not a node");
    109109                    Node n = (Node) p;
    110                     if (rememberMovements.containsKey(n)) {
    111                         EastNorth tmp = rememberMovements.get(n);
     110                    if (REMEMBER_MOVEMENTS.containsKey(n)) {
     111                        EastNorth tmp = REMEMBER_MOVEMENTS.get(n);
    112112                        commands.add(new MoveCommand(n, -tmp.east(), -tmp.north()));
    113                         rememberMovements.remove(n);
     113                        REMEMBER_MOVEMENTS.remove(n);
    114114                    }
    115115                }
     
    209209        } else {
    210210            if (nodeList.size() == 2 || nodeList.isEmpty()) {
    211                 OrthogonalizeAction.rememberMovements.clear();
     211                REMEMBER_MOVEMENTS.clear();
    212212                final Collection<Command> commands = new LinkedList<>();
    213213
     
    424424                    throw new AssertionError("heading node has changed");
    425425            } else {
    426                 OrthogonalizeAction.rememberMovements.put(n, new EastNorth(dx, dy));
     426                REMEMBER_MOVEMENTS.put(n, new EastNorth(dx, dy));
    427427                commands.add(new MoveCommand(n, dx, dy));
    428428            }
  • trunk/src/org/openstreetmap/josm/actions/PasteTagsAction.java

    r10737 r12537  
    2424public final class PasteTagsAction extends JosmAction {
    2525
    26     private static final String help = ht("/Action/PasteTags");
     26    private static final String HELP = ht("/Action/PasteTags");
    2727    private final OsmTransferHandler transferHandler = new OsmTransferHandler();
    2828
     
    3535                Shortcut.registerShortcut("system:pastestyle", tr("Edit: {0}", tr("Paste Tags")),
    3636                KeyEvent.VK_V, Shortcut.CTRL_SHIFT), true);
    37         putValue("help", help);
     37        putValue("help", HELP);
    3838    }
    3939
  • trunk/src/org/openstreetmap/josm/actions/UploadAction.java

    r11848 r12537  
    5252     * however, a plugin might also want to insert something after that.
    5353     */
    54     private static final List<UploadHook> uploadHooks = new LinkedList<>();
    55     private static final List<UploadHook> lateUploadHooks = new LinkedList<>();
     54    private static final List<UploadHook> UPLOAD_HOOKS = new LinkedList<>();
     55    private static final List<UploadHook> LATE_UPLOAD_HOOKS = new LinkedList<>();
    5656
    5757    static {
     
    5959         * Calls validator before upload.
    6060         */
    61         uploadHooks.add(new ValidateUploadHook());
     61        UPLOAD_HOOKS.add(new ValidateUploadHook());
    6262
    6363        /**
    6464         * Fixes database errors
    6565         */
    66         uploadHooks.add(new FixDataHook());
     66        UPLOAD_HOOKS.add(new FixDataHook());
    6767
    6868        /**
    6969         * Checks server capabilities before upload.
    7070         */
    71         uploadHooks.add(new ApiPreconditionCheckerHook());
     71        UPLOAD_HOOKS.add(new ApiPreconditionCheckerHook());
    7272
    7373        /**
    7474         * Adjusts the upload order of new relations
    7575         */
    76         uploadHooks.add(new RelationUploadOrderHook());
     76        UPLOAD_HOOKS.add(new RelationUploadOrderHook());
    7777
    7878        /**
    7979         * Removes discardable tags like created_by on modified objects
    8080         */
    81         lateUploadHooks.add(new DiscardTagsHook());
     81        LATE_UPLOAD_HOOKS.add(new DiscardTagsHook());
    8282    }
    8383
     
    102102        if (hook == null) return;
    103103        if (late) {
    104             if (!lateUploadHooks.contains(hook)) {
    105                 lateUploadHooks.add(0, hook);
     104            if (!LATE_UPLOAD_HOOKS.contains(hook)) {
     105                LATE_UPLOAD_HOOKS.add(0, hook);
    106106            }
    107107        } else {
    108             if (!uploadHooks.contains(hook)) {
    109                 uploadHooks.add(0, hook);
     108            if (!UPLOAD_HOOKS.contains(hook)) {
     109                UPLOAD_HOOKS.add(0, hook);
    110110            }
    111111        }
     
    119119    public static void unregisterUploadHook(UploadHook hook) {
    120120        if (hook == null) return;
    121         if (uploadHooks.contains(hook)) {
    122             uploadHooks.remove(hook);
    123         }
    124         if (lateUploadHooks.contains(hook)) {
    125             lateUploadHooks.remove(hook);
     121        if (UPLOAD_HOOKS.contains(hook)) {
     122            UPLOAD_HOOKS.remove(hook);
     123        }
     124        if (LATE_UPLOAD_HOOKS.contains(hook)) {
     125            LATE_UPLOAD_HOOKS.remove(hook);
    126126        }
    127127    }
     
    204204        //
    205205        if (apiData != null) {
    206             for (UploadHook hook : uploadHooks) {
     206            for (UploadHook hook : UPLOAD_HOOKS) {
    207207                if (!hook.checkUpload(apiData))
    208208                    return false;
     
    240240            return;
    241241
    242         for (UploadHook hook : lateUploadHooks) {
     242        for (UploadHook hook : LATE_UPLOAD_HOOKS) {
    243243            if (!hook.checkUpload(apiData))
    244244                return;
  • trunk/src/org/openstreetmap/josm/actions/mapmode/DeleteAction.java

    r12526 r12537  
    5656    private transient WaySegment oldHighlightedWaySegment;
    5757
    58     private static final HighlightHelper highlightHelper = new HighlightHelper();
     58    private static final HighlightHelper HIGHLIGHT_HELPER = new HighlightHelper();
    5959    private boolean drawTargetHighlight;
    6060
     
    177177     */
    178178    private void removeHighlighting() {
    179         highlightHelper.clear();
     179        HIGHLIGHT_HELPER.clear();
    180180        DataSet ds = getLayerManager().getEditDataSet();
    181181        if (ds != null) {
     
    232232            oldHighlightedWaySegment = newHighlightedWaySegment;
    233233        }
    234         needsRepaint |= highlightHelper.highlightOnly(newHighlights);
     234        needsRepaint |= HIGHLIGHT_HELPER.highlightOnly(newHighlights);
    235235        if (needsRepaint && editLayer != null) {
    236236            editLayer.invalidate();
  • trunk/src/org/openstreetmap/josm/actions/search/PushbackTokenizer.java

    r12409 r12537  
    148148    }
    149149
    150     private static final List<Character> specialChars = Arrays.asList('"', ':', '(', ')', '|', '^', '=', '?', '<', '>');
    151     private static final List<Character> specialCharsQuoted = Arrays.asList('"');
     150    private static final List<Character> SPECIAL_CHARS = Arrays.asList('"', ':', '(', ')', '|', '^', '=', '?', '<', '>');
     151    private static final List<Character> SPECIAL_CHARS_QUOTED = Arrays.asList('"');
    152152
    153153    private String getString(boolean quoted) {
    154         List<Character> sChars = quoted ? specialCharsQuoted : specialChars;
     154        List<Character> sChars = quoted ? SPECIAL_CHARS_QUOTED : SPECIAL_CHARS;
    155155        StringBuilder s = new StringBuilder();
    156156        boolean escape = false;
  • trunk/src/org/openstreetmap/josm/actions/search/SearchAction.java

    r12464 r12537  
    125125    }
    126126
    127     private static final LinkedList<SearchSetting> searchHistory = new LinkedList<>();
     127    private static final LinkedList<SearchSetting> SEARCH_HISTORY = new LinkedList<>();
    128128    static {
    129129        for (String s: Main.pref.getCollection("search.history", Collections.<String>emptyList())) {
    130130            SearchSetting ss = SearchSetting.readFromString(s);
    131131            if (ss != null) {
    132                 searchHistory.add(ss);
     132                SEARCH_HISTORY.add(ss);
    133133            }
    134134        }
     
    140140     */
    141141    public static Collection<SearchSetting> getSearchHistory() {
    142         return searchHistory;
     142        return SEARCH_HISTORY;
    143143    }
    144144
     
    148148     */
    149149    public static void saveToHistory(SearchSetting s) {
    150         if (searchHistory.isEmpty() || !s.equals(searchHistory.getFirst())) {
    151             searchHistory.addFirst(new SearchSetting(s));
    152         } else if (searchHistory.contains(s)) {
     150        if (SEARCH_HISTORY.isEmpty() || !s.equals(SEARCH_HISTORY.getFirst())) {
     151            SEARCH_HISTORY.addFirst(new SearchSetting(s));
     152        } else if (SEARCH_HISTORY.contains(s)) {
    153153            // move existing entry to front, fixes #8032 - search history loses entries when re-using queries
    154             searchHistory.remove(s);
    155             searchHistory.addFirst(new SearchSetting(s));
     154            SEARCH_HISTORY.remove(s);
     155            SEARCH_HISTORY.addFirst(new SearchSetting(s));
    156156        }
    157157        int maxsize = Main.pref.getInteger("search.history-size", DEFAULT_SEARCH_HISTORY_SIZE);
    158         while (searchHistory.size() > maxsize) {
    159             searchHistory.removeLast();
    160         }
    161         Set<String> savedHistory = new LinkedHashSet<>(searchHistory.size());
    162         for (SearchSetting item: searchHistory) {
     158        while (SEARCH_HISTORY.size() > maxsize) {
     159            SEARCH_HISTORY.removeLast();
     160        }
     161        Set<String> savedHistory = new LinkedHashSet<>(SEARCH_HISTORY.size());
     162        for (SearchSetting item: SEARCH_HISTORY) {
    163163            savedHistory.add(item.writeToString());
    164164        }
  • trunk/src/org/openstreetmap/josm/corrector/ReverseWayNoTagCorrector.java

    r12279 r12537  
    3636     * Tags that imply a semantic meaning from the way direction and cannot be changed.
    3737     */
    38     private static final TagCollection directionalTags = new TagCollection(Arrays.asList(
     38    private static final TagCollection DIRECTIONAL_TAGS = new TagCollection(Arrays.asList(
    3939            new Tag("natural", "coastline"),
    4040            new Tag("natural", "cliff"),
     
    5454        for (Map.Entry<String, String> entry : way.getKeys().entrySet()) {
    5555            final Tag tag = new Tag(entry.getKey(), entry.getValue());
    56             final boolean isDirectional = directionalTags.contains(tag) || tag.isDirectionKey();
     56            final boolean isDirectional = DIRECTIONAL_TAGS.contains(tag) || tag.isDirectionKey();
    5757            if (isDirectional) {
    5858                final boolean cannotBeCorrected = ReverseWayTagCorrector.getTagCorrections(tag).isEmpty();
  • trunk/src/org/openstreetmap/josm/corrector/ReverseWayTagCorrector.java

    r12412 r12537  
    5353    }
    5454
    55     private static final Collection<Pattern> ignoredKeys = new ArrayList<>();
     55    private static final Collection<Pattern> IGNORED_KEYS = new ArrayList<>();
    5656    static {
    5757        for (String s : OsmPrimitive.getUninterestingKeys()) {
    58             ignoredKeys.add(getPatternFor(s));
     58            IGNORED_KEYS.add(getPatternFor(s));
    5959        }
    6060        for (String s : new String[]{"name", "ref", "tiger:county"}) {
    61             ignoredKeys.add(getPatternFor(s, false));
     61            IGNORED_KEYS.add(getPatternFor(s, false));
    6262        }
    6363        for (String s : new String[]{"tiger:county", "turn:lanes", "change:lanes", "placement"}) {
    64             ignoredKeys.add(getPatternFor(s, true));
     64            IGNORED_KEYS.add(getPatternFor(s, true));
    6565        }
    6666    }
     
    292292
    293293    private static boolean ignoreKeyForCorrection(String key) {
    294         for (Pattern ignoredKey : ignoredKeys) {
     294        for (Pattern ignoredKey : IGNORED_KEYS) {
    295295            if (ignoredKey.matcher(key).matches()) {
    296296                return true;
  • trunk/src/org/openstreetmap/josm/data/Preferences.java

    r12409 r12537  
    14571457            throw new IllegalArgumentException(ex);
    14581458        }
    1459         for (Entry<String, String> key_value : hash.entrySet()) {
     1459        for (Entry<String, String> keyValue : hash.entrySet()) {
    14601460            Object value;
    14611461            Field f;
    14621462            try {
    1463                 f = klass.getDeclaredField(key_value.getKey().replace('-', '_'));
     1463                f = klass.getDeclaredField(keyValue.getKey().replace('-', '_'));
    14641464            } catch (NoSuchFieldException ex) {
    14651465                Main.trace(ex);
     
    14711471            Utils.setObjectsAccessible(f);
    14721472            if (f.getType() == Boolean.class || f.getType() == boolean.class) {
    1473                 value = Boolean.valueOf(key_value.getValue());
     1473                value = Boolean.valueOf(keyValue.getValue());
    14741474            } else if (f.getType() == Integer.class || f.getType() == int.class) {
    14751475                try {
    1476                     value = Integer.valueOf(key_value.getValue());
     1476                    value = Integer.valueOf(keyValue.getValue());
    14771477                } catch (NumberFormatException nfe) {
    14781478                    continue;
     
    14801480            } else if (f.getType() == Double.class || f.getType() == double.class) {
    14811481                try {
    1482                     value = Double.valueOf(key_value.getValue());
     1482                    value = Double.valueOf(keyValue.getValue());
    14831483                } catch (NumberFormatException nfe) {
    14841484                    continue;
    14851485                }
    14861486            } else if (f.getType() == String.class) {
    1487                 value = key_value.getValue();
     1487                value = keyValue.getValue();
    14881488            } else if (f.getType().isAssignableFrom(Map.class)) {
    1489                 value = mapFromJson(key_value.getValue());
     1489                value = mapFromJson(keyValue.getValue());
    14901490            } else if (f.getType().isAssignableFrom(MultiMap.class)) {
    1491                 value = multiMapFromJson(key_value.getValue());
     1491                value = multiMapFromJson(keyValue.getValue());
    14921492            } else
    14931493                throw new JosmRuntimeException("unsupported preference primitive type");
  • trunk/src/org/openstreetmap/josm/data/SystemOfMeasurement.java

    r11553 r12537  
    8080    }
    8181
    82     private static final CopyOnWriteArrayList<SoMChangeListener> somChangeListeners = new CopyOnWriteArrayList<>();
     82    private static final CopyOnWriteArrayList<SoMChangeListener> SOM_CHANGE_LISTENERS = new CopyOnWriteArrayList<>();
    8383
    8484    /**
     
    8989     */
    9090    public static void removeSoMChangeListener(SoMChangeListener listener) {
    91         somChangeListeners.remove(listener);
     91        SOM_CHANGE_LISTENERS.remove(listener);
    9292    }
    9393
     
    100100    public static void addSoMChangeListener(SoMChangeListener listener) {
    101101        if (listener != null) {
    102             somChangeListeners.addIfAbsent(listener);
     102            SOM_CHANGE_LISTENERS.addIfAbsent(listener);
    103103        }
    104104    }
    105105
    106106    protected static void fireSoMChanged(String oldSoM, String newSoM) {
    107         for (SoMChangeListener l : somChangeListeners) {
     107        for (SoMChangeListener l : SOM_CHANGE_LISTENERS) {
    108108            l.systemOfMeasurementChanged(oldSoM, newSoM);
    109109        }
  • trunk/src/org/openstreetmap/josm/data/cache/JCSCacheManager.java

    r11746 r12537  
    4848    public static final BooleanProperty USE_BLOCK_CACHE = new BooleanProperty(PREFERENCE_PREFIX + ".use_block_cache", true);
    4949
    50     private static final AuxiliaryCacheFactory diskCacheFactory =
     50    private static final AuxiliaryCacheFactory DISK_CACHE_FACTORY =
    5151            USE_BLOCK_CACHE.get() ? new BlockDiskCacheFactory() : new IndexedDiskCacheFactory();
    5252    private static FileLock cacheDirLock;
     
    177177            try {
    178178                if (cc.getAuxCaches().length == 0) {
    179                     AuxiliaryCache<K, V> diskCache = diskCacheFactory.createCache(diskAttributes, cacheManager, null, new StandardSerializer());
    180                     cc.setAuxCaches(new AuxiliaryCache[]{diskCache});
     179                    cc.setAuxCaches(new AuxiliaryCache[]{DISK_CACHE_FACTORY.createCache(
     180                            diskAttributes, cacheManager, null, new StandardSerializer())});
    181181                }
    182182            } catch (IOException e) {
  • trunk/src/org/openstreetmap/josm/data/cache/JCSCachedTileLoaderJob.java

    r11958 r12537  
    8181
    8282
    83     private static final ConcurrentMap<String, Set<ICachedLoaderListener>> inProgress = new ConcurrentHashMap<>();
    84     private static final ConcurrentMap<String, Boolean> useHead = new ConcurrentHashMap<>();
     83    private static final ConcurrentMap<String, Set<ICachedLoaderListener>> IN_PROGRESS = new ConcurrentHashMap<>();
     84    private static final ConcurrentMap<String, Boolean> USE_HEAD = new ConcurrentHashMap<>();
    8585
    8686    protected final long now; // when the job started
     
    162162            throw new IllegalArgumentException("No url returned");
    163163        }
    164         synchronized (inProgress) {
    165             Set<ICachedLoaderListener> newListeners = inProgress.get(deduplicationKey);
     164        synchronized (IN_PROGRESS) {
     165            Set<ICachedLoaderListener> newListeners = IN_PROGRESS.get(deduplicationKey);
    166166            if (newListeners == null) {
    167167                newListeners = new HashSet<>();
    168                 inProgress.put(deduplicationKey, newListeners);
     168                IN_PROGRESS.put(deduplicationKey, newListeners);
    169169                first = true;
    170170            }
     
    259259    private void finishLoading(LoadResult result) {
    260260        Set<ICachedLoaderListener> listeners;
    261         synchronized (inProgress) {
     261        synchronized (IN_PROGRESS) {
    262262            try {
    263                 listeners = inProgress.remove(getUrl().toString());
     263                listeners = IN_PROGRESS.remove(getUrl().toString());
    264264            } catch (IOException e) {
    265265                listeners = null;
     
    312312            // then just use HEAD request and check returned values
    313313            if (isObjectLoadable() &&
    314                     Boolean.TRUE.equals(useHead.get(getServerKey())) &&
     314                    Boolean.TRUE.equals(USE_HEAD.get(getServerKey())) &&
    315315                    isCacheValidUsingHead()) {
    316316                LOG.log(Level.FINE, "JCS - cache entry verified using HEAD request: {0}", getUrl());
     
    346346                LOG.log(Level.INFO, "JCS - Host: {0} found not to return 304 codes for If-Modified-Since or If-None-Match headers",
    347347                        serverKey);
    348                 useHead.put(serverKey, Boolean.TRUE);
     348                USE_HEAD.put(serverKey, Boolean.TRUE);
    349349            }
    350350
  • trunk/src/org/openstreetmap/josm/data/imagery/TMSCachedTileLoaderJob.java

    r11858 r12537  
    5151    // we need another deduplication of Tile Loader listeners, as for each submit, new TMSCachedTileLoaderJob was created
    5252    // that way, we reduce calls to tileLoadingFinished, and general CPU load due to surplus Map repaints
    53     private static final ConcurrentMap<String, Set<TileLoaderListener>> inProgress = new ConcurrentHashMap<>();
     53    private static final ConcurrentMap<String, Set<TileLoaderListener>> IN_PROGRESS = new ConcurrentHashMap<>();
    5454
    5555    /**
     
    7171        if (listener != null) {
    7272            String deduplicationKey = getCacheKey();
    73             synchronized (inProgress) {
    74                 Set<TileLoaderListener> newListeners = inProgress.get(deduplicationKey);
     73            synchronized (IN_PROGRESS) {
     74                Set<TileLoaderListener> newListeners = IN_PROGRESS.get(deduplicationKey);
    7575                if (newListeners == null) {
    7676                    newListeners = new HashSet<>();
    77                     inProgress.put(deduplicationKey, newListeners);
     77                    IN_PROGRESS.put(deduplicationKey, newListeners);
    7878                }
    7979                newListeners.add(listener);
     
    162162        this.attributes = attributes; // as we might get notification from other object than our selfs, pass attributes along
    163163        Set<TileLoaderListener> listeners;
    164         synchronized (inProgress) {
    165             listeners = inProgress.remove(getCacheKey());
     164        synchronized (IN_PROGRESS) {
     165            listeners = IN_PROGRESS.remove(getCacheKey());
    166166        }
    167167        boolean status = result.equals(LoadResult.SUCCESS);
  • trunk/src/org/openstreetmap/josm/data/imagery/TemplatedWMSTileSource.java

    r11860 r12537  
    4545    // CHECKSTYLE.ON: SingleSpaceSeparator
    4646
    47     private static final NumberFormat latLonFormat = new DecimalFormat("###0.0000000", new DecimalFormatSymbols(Locale.US));
     47    private static final NumberFormat LATLON_FORMAT = new DecimalFormat("###0.0000000", new DecimalFormatSymbols(Locale.US));
    4848
    4949    private static final Pattern[] ALL_PATTERNS = {
     
    111111        String bbox;
    112112        if (switchLatLon) {
    113             bbox = String.format("%s,%s,%s,%s", latLonFormat.format(s), latLonFormat.format(w), latLonFormat.format(n), latLonFormat.format(e));
     113            bbox = String.format("%s,%s,%s,%s",
     114                    LATLON_FORMAT.format(s), LATLON_FORMAT.format(w), LATLON_FORMAT.format(n), LATLON_FORMAT.format(e));
    114115        } else {
    115             bbox = String.format("%s,%s,%s,%s", latLonFormat.format(w), latLonFormat.format(s), latLonFormat.format(e), latLonFormat.format(n));
     116            bbox = String.format("%s,%s,%s,%s",
     117                    LATLON_FORMAT.format(w), LATLON_FORMAT.format(s), LATLON_FORMAT.format(e), LATLON_FORMAT.format(n));
    116118        }
    117119
     
    132134                break;
    133135            case "w":
    134                 replacement = latLonFormat.format(w);
     136                replacement = LATLON_FORMAT.format(w);
    135137                break;
    136138            case "s":
    137                 replacement = latLonFormat.format(s);
     139                replacement = LATLON_FORMAT.format(s);
    138140                break;
    139141            case "e":
    140                 replacement = latLonFormat.format(e);
     142                replacement = LATLON_FORMAT.format(e);
    141143                break;
    142144            case "n":
    143                 replacement = latLonFormat.format(n);
     145                replacement = LATLON_FORMAT.format(n);
    144146                break;
    145147            case "width":
  • trunk/src/org/openstreetmap/josm/data/osm/ChangesetCache.java

    r11349 r12537  
    3737public final class ChangesetCache implements PreferenceChangedListener {
    3838    /** the unique instance */
    39     private static final ChangesetCache instance = new ChangesetCache();
     39    private static final ChangesetCache INSTANCE = new ChangesetCache();
    4040
    4141    /** the cached changesets */
     
    5656     */
    5757    public static ChangesetCache getInstance() {
    58         return instance;
     58        return INSTANCE;
    5959    }
    6060
  • trunk/src/org/openstreetmap/josm/data/osm/DataSet.java

    r12479 r12537  
    638638     * dataset. (However, the selection does only change in the active layer)
    639639     */
    640     private static final Collection<SelectionChangedListener> selListeners = new CopyOnWriteArrayList<>();
     640    private static final Collection<SelectionChangedListener> SEL_LISTENERS = new CopyOnWriteArrayList<>();
    641641
    642642    /**
     
    647647     */
    648648    public static void addSelectionListener(SelectionChangedListener listener) {
    649         ((CopyOnWriteArrayList<SelectionChangedListener>) selListeners).addIfAbsent(listener);
     649        ((CopyOnWriteArrayList<SelectionChangedListener>) SEL_LISTENERS).addIfAbsent(listener);
    650650    }
    651651
     
    657657     */
    658658    public static void removeSelectionListener(SelectionChangedListener listener) {
    659         selListeners.remove(listener);
     659        SEL_LISTENERS.remove(listener);
    660660    }
    661661
     
    671671
    672672    private static void fireDreprecatedSelectionChange(Collection<? extends OsmPrimitive> currentSelection) {
    673         for (SelectionChangedListener l : selListeners) {
     673        for (SelectionChangedListener l : SEL_LISTENERS) {
    674674            l.selectionChanged(currentSelection);
    675675        }
  • trunk/src/org/openstreetmap/josm/data/osm/QuadBuckets.java

    r12122 r12537  
    2323 */
    2424public class QuadBuckets<T extends OsmPrimitive> implements Collection<T> {
    25     private static final boolean consistency_testing = false;
     25    private static final boolean CONSISTENCY_TESTING = false;
    2626    private static final byte NW_INDEX = 1;
    2727    private static final byte NE_INDEX = 3;
     
    271271
    272272        void doAdd(T o) {
    273             if (consistency_testing) {
     273            if (CONSISTENCY_TESTING) {
    274274                if (o instanceof Node && !matches(o, this)) {
    275275                    o.getBBox().getIndex(level);
  • trunk/src/org/openstreetmap/josm/data/osm/User.java

    r11912 r12537  
    3434     * @see #getAnonymous()
    3535     */
    36     private static final User anonymous = createLocalUser(tr("<anonymous>"));
     36    private static final User ANONYMOUS = createLocalUser(tr("<anonymous>"));
    3737
    3838    private static long getNextLocalUid() {
     
    131131     */
    132132    public static User getAnonymous() {
    133         return anonymous;
     133        return ANONYMOUS;
    134134    }
    135135
  • trunk/src/org/openstreetmap/josm/data/osm/event/DatasetEventManager.java

    r11928 r12537  
    2929public class DatasetEventManager implements ActiveLayerChangeListener, Listener {
    3030
    31     private static final DatasetEventManager instance = new DatasetEventManager();
     31    private static final DatasetEventManager INSTANCE = new DatasetEventManager();
    3232
    3333    private final class EdtRunnable implements Runnable {
     
    139139     */
    140140    public static DatasetEventManager getInstance() {
    141         return instance;
     141        return INSTANCE;
    142142    }
    143143
  • trunk/src/org/openstreetmap/josm/data/osm/event/SelectionEventManager.java

    r12116 r12537  
    3232public class SelectionEventManager implements DataSelectionListener, ActiveLayerChangeListener {
    3333
    34     private static final SelectionEventManager instance = new SelectionEventManager();
     34    private static final SelectionEventManager INSTANCE = new SelectionEventManager();
    3535
    3636    /**
     
    3939     */
    4040    public static SelectionEventManager getInstance() {
    41         return instance;
     41        return INSTANCE;
    4242    }
    4343
  • trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/PaintColors.java

    r12376 r12537  
    9393    private static volatile Color backgroundColorCache;
    9494
    95     private static final MapPaintSylesUpdateListener styleOverrideListener = new MapPaintSylesUpdateListener() {
     95    private static final MapPaintSylesUpdateListener STYLE_OVERRIDE_LISTENER = new MapPaintSylesUpdateListener() {
    9696        //TODO: Listen to wireframe map mode changes.
    9797        @Override
     
    107107
    108108    static {
    109         MapPaintStyles.addMapPaintSylesUpdateListener(styleOverrideListener);
     109        MapPaintStyles.addMapPaintSylesUpdateListener(STYLE_OVERRIDE_LISTENER);
    110110    }
    111111
  • trunk/src/org/openstreetmap/josm/data/validation/OsmValidator.java

    r12390 r12537  
    7979    private static double griddetail;
    8080
    81     private static final Collection<String> ignoredErrors = new TreeSet<>();
     81    private static final Collection<String> IGNORED_ERRORS = new TreeSet<>();
    8282
    8383    /**
    8484     * All registered tests
    8585     */
    86     private static final Collection<Class<? extends Test>> allTests = new ArrayList<>();
    87     private static final Map<String, Test> allTestsMap = new HashMap<>();
     86    private static final Collection<Class<? extends Test>> ALL_TESTS = new ArrayList<>();
     87    private static final Map<String, Test> ALL_TESTS_MAP = new HashMap<>();
    8888
    8989    /**
     
    139139     */
    140140    public static void addTest(Class<? extends Test> testClass) {
    141         allTests.add(testClass);
     141        ALL_TESTS.add(testClass);
    142142        try {
    143             allTestsMap.put(testClass.getName(), testClass.getConstructor().newInstance());
     143            ALL_TESTS_MAP.put(testClass.getName(), testClass.getConstructor().newInstance());
    144144        } catch (ReflectiveOperationException e) {
    145145            Main.error(e);
     
    182182
    183183    private static void loadIgnoredErrors() {
    184         ignoredErrors.clear();
     184        IGNORED_ERRORS.clear();
    185185        if (ValidatorPreference.PREF_USE_IGNORE.get()) {
    186186            Path path = Paths.get(getValidatorDir()).resolve("ignorederrors");
    187187            if (path.toFile().exists()) {
    188188                try {
    189                     ignoredErrors.addAll(Files.readAllLines(path, StandardCharsets.UTF_8));
     189                    IGNORED_ERRORS.addAll(Files.readAllLines(path, StandardCharsets.UTF_8));
    190190                } catch (final FileNotFoundException e) {
    191191                    Main.debug(Main.getErrorMessage(e));
     
    204204     */
    205205    public static void addIgnoredError(String s) {
    206         ignoredErrors.add(s);
     206        IGNORED_ERRORS.add(s);
    207207    }
    208208
     
    213213     */
    214214    public static boolean hasIgnoredError(String s) {
    215         return ignoredErrors.contains(s);
     215        return IGNORED_ERRORS.contains(s);
    216216    }
    217217
     
    221221    public static void saveIgnoredErrors() {
    222222        try (PrintWriter out = new PrintWriter(new File(getValidatorDir(), "ignorederrors"), StandardCharsets.UTF_8.name())) {
    223             for (String e : ignoredErrors) {
     223            for (String e : IGNORED_ERRORS) {
    224224                out.println(e);
    225225            }
     
    254254     */
    255255    public static SortedMap<String, Test> getAllTestsMap() {
    256         applyPrefs(allTestsMap, false);
    257         applyPrefs(allTestsMap, true);
    258         return new TreeMap<>(allTestsMap);
     256        applyPrefs(ALL_TESTS_MAP, false);
     257        applyPrefs(ALL_TESTS_MAP, true);
     258        return new TreeMap<>(ALL_TESTS_MAP);
    259259    }
    260260
     
    271271            return null;
    272272        }
    273         return (T) allTestsMap.get(testClass.getName());
     273        return (T) ALL_TESTS_MAP.get(testClass.getName());
    274274    }
    275275
     
    318318     */
    319319    public static Collection<Class<? extends Test>> getAllAvailableTestClasses() {
    320         return Collections.unmodifiableCollection(allTests);
     320        return Collections.unmodifiableCollection(ALL_TESTS);
    321321    }
    322322
  • 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
  • trunk/src/org/openstreetmap/josm/io/DefaultProxySelector.java

    r12279 r12537  
    4141     * We therefore read the property at class loading time and remember it's value.
    4242     */
    43     private static boolean JVM_WILL_USE_SYSTEM_PROXIES;
     43    private static boolean jvmWillUseSystemProxies;
    4444    static {
    4545        String v = System.getProperty("java.net.useSystemProxies");
    4646        if (v != null && v.equals(Boolean.TRUE.toString())) {
    47             JVM_WILL_USE_SYSTEM_PROXIES = true;
     47            jvmWillUseSystemProxies = true;
    4848        }
    4949    }
     
    5959     */
    6060    public static boolean willJvmRetrieveSystemProxies() {
    61         return JVM_WILL_USE_SYSTEM_PROXIES;
     61        return jvmWillUseSystemProxies;
    6262    }
    6363
     
    202202        switch(proxyPolicy) {
    203203        case USE_SYSTEM_SETTINGS:
    204             if (!JVM_WILL_USE_SYSTEM_PROXIES) {
     204            if (!jvmWillUseSystemProxies) {
    205205                Main.warn(tr("The JVM is not configured to lookup proxies from the system settings. "+
    206206                        "The property ''java.net.useSystemProxies'' was missing at startup time.  Will not use a proxy."));
  • trunk/src/org/openstreetmap/josm/io/GeoJSONWriter.java

    r12439 r12537  
    4545    private final OsmDataLayer layer;
    4646    private final Projection projection;
    47     private static final boolean skipEmptyNodes = true;
     47    private static final boolean SKIP_EMPTY_NODES = true;
    4848
    4949    /**
     
    165165        if (p.isIncomplete()) {
    166166            return;
    167         } else if (skipEmptyNodes && p instanceof Node && p.getKeys().isEmpty()) {
     167        } else if (SKIP_EMPTY_NODES && p instanceof Node && p.getKeys().isEmpty()) {
    168168            return;
    169169        }
  • trunk/src/org/openstreetmap/josm/io/OverpassDownloadReader.java

    r11987 r12537  
    9999    static final Pattern OUTPUT_FORMAT_STATEMENT = Pattern.compile(".*\\[out:([a-z]{3,})\\].*", Pattern.DOTALL);
    100100
    101     static final Map<OverpassOutpoutFormat, Class<? extends AbstractReader>> outputFormatReaders = new ConcurrentHashMap<>();
     101    static final Map<OverpassOutpoutFormat, Class<? extends AbstractReader>> OUTPUT_FORMAT_READERS = new ConcurrentHashMap<>();
    102102
    103103    final String overpassServer;
     
    125125    public static final Class<? extends AbstractReader> registerOverpassOutpoutFormatReader(
    126126            OverpassOutpoutFormat format, Class<? extends AbstractReader> readerClass) {
    127         return outputFormatReaders.put(Objects.requireNonNull(format), Objects.requireNonNull(readerClass));
     127        return OUTPUT_FORMAT_READERS.put(Objects.requireNonNull(format), Objects.requireNonNull(readerClass));
    128128    }
    129129
     
    232232        Matcher m = OUTPUT_FORMAT_STATEMENT.matcher(overpassQuery);
    233233        if (m.matches()) {
    234             Class<? extends AbstractReader> readerClass = outputFormatReaders.get(OverpassOutpoutFormat.from(m.group(1)));
     234            Class<? extends AbstractReader> readerClass = OUTPUT_FORMAT_READERS.get(OverpassOutpoutFormat.from(m.group(1)));
    235235            if (readerClass != null) {
    236236                try {
  • trunk/src/org/openstreetmap/josm/io/XmlWriter.java

    r9828 r12537  
    6262                String encS = null;
    6363                if (!keepApos || unencoded.charAt(i) != '\'') {
    64                     encS = XmlWriter.encoding.get(unencoded.charAt(i));
     64                    encS = ENCODING.get(unencoded.charAt(i));
    6565                }
    6666                if (encS != null) {
     
    8080     * The output writer to save the values to.
    8181     */
    82     private static final Map<Character, String> encoding = new HashMap<>();
     82    private static final Map<Character, String> ENCODING = new HashMap<>();
    8383    static {
    84         encoding.put('<', "&lt;");
    85         encoding.put('>', "&gt;");
    86         encoding.put('"', "&quot;");
    87         encoding.put('\'', "&apos;");
    88         encoding.put('&', "&amp;");
    89         encoding.put('\n', "&#xA;");
    90         encoding.put('\r', "&#xD;");
    91         encoding.put('\t', "&#x9;");
     84        ENCODING.put('<', "&lt;");
     85        ENCODING.put('>', "&gt;");
     86        ENCODING.put('"', "&quot;");
     87        ENCODING.put('\'', "&apos;");
     88        ENCODING.put('&', "&amp;");
     89        ENCODING.put('\n', "&#xA;");
     90        ENCODING.put('\r', "&#xD;");
     91        ENCODING.put('\t', "&#x9;");
    9292    }
    9393
  • trunk/src/org/openstreetmap/josm/io/remotecontrol/AddTagsDialog.java

    r12523 r12537  
    5151
    5252    private final String sender;
    53     private static final Set<String> trustedSenders = new HashSet<>();
     53    private static final Set<String> TRUSTED_SENDERS = new HashSet<>();
    5454
    5555    static final class PropertyTableModel extends DefaultTableModel {
     
    227227        tablePanel.add(propertyTable.getTableHeader(), GBC.eol().fill(GBC.HORIZONTAL));
    228228        tablePanel.add(propertyTable, GBC.eol().fill(GBC.BOTH));
    229         if (!sender.isEmpty() && !trustedSenders.contains(sender)) {
     229        if (!sender.isEmpty() && !TRUSTED_SENDERS.contains(sender)) {
    230230            final JCheckBox c = new JCheckBox();
    231231            c.setAction(new AbstractAction(tr("Accept all tags from {0} for this session", sender)) {
    232232                @Override public void actionPerformed(ActionEvent e) {
    233233                    if (c.isSelected())
    234                         trustedSenders.add(sender);
     234                        TRUSTED_SENDERS.add(sender);
    235235                    else
    236                         trustedSenders.remove(sender);
     236                        TRUSTED_SENDERS.remove(sender);
    237237                }
    238238            });
     
    263263        }
    264264        if (buttonIndex == 2) {
    265             trustedSenders.remove(sender);
     265            TRUSTED_SENDERS.remove(sender);
    266266        }
    267267        setVisible(false);
     
    308308     */
    309309    public static void addTags(String[][] keyValue, String sender, Collection<? extends OsmPrimitive> primitives) {
    310         if (trustedSenders.contains(sender)) {
     310        if (TRUSTED_SENDERS.contains(sender)) {
    311311            if (Main.getLayerManager().getEditDataSet() != null) {
    312312                for (String[] row : keyValue) {
  • trunk/src/org/openstreetmap/josm/io/session/SessionReader.java

    r12489 r12537  
    147147    }
    148148
    149     private static final Map<String, Class<? extends SessionLayerImporter>> sessionLayerImporters = new HashMap<>();
     149    private static final Map<String, Class<? extends SessionLayerImporter>> SESSION_LAYER_IMPORTERS = new HashMap<>();
    150150
    151151    private URI sessionFileURI;
     
    174174     */
    175175    public static void registerSessionLayerImporter(String layerType, Class<? extends SessionLayerImporter> importer) {
    176         sessionLayerImporters.put(layerType, importer);
     176        SESSION_LAYER_IMPORTERS.put(layerType, importer);
    177177    }
    178178
     
    183183     */
    184184    public static SessionLayerImporter getSessionLayerImporter(String layerType) {
    185         Class<? extends SessionLayerImporter> importerClass = sessionLayerImporters.get(layerType);
     185        Class<? extends SessionLayerImporter> importerClass = SESSION_LAYER_IMPORTERS.get(layerType);
    186186        if (importerClass == null)
    187187            return null;
  • trunk/src/org/openstreetmap/josm/tools/I18n.java

    r10983 r12537  
    9797
    9898    /* Localization keys for file chooser (and color chooser). */
    99     private static final String[] javaInternalMessageKeys = new String[] {
     99    private static final String[] JAVA_INTERNAL_MESSAGE_KEYS = new String[] {
    100100        /* JFileChooser windows laf */
    101101        "FileChooser.detailsViewActionLabelText",
     
    691691        JFileChooser.setDefaultLocale(l);
    692692        JColorChooser.setDefaultLocale(l);
    693         for (String key : javaInternalMessageKeys) {
     693        for (String key : JAVA_INTERNAL_MESSAGE_KEYS) {
    694694            String us = UIManager.getString(key, Locale.US);
    695695            String loc = UIManager.getString(key, l);
  • trunk/src/org/openstreetmap/josm/tools/PlatformHookOsx.java

    r12279 r12537  
    3131public class PlatformHookOsx implements PlatformHook, InvocationHandler {
    3232
    33     private static final PlatformHookOsx ivhandler = new PlatformHookOsx();
     33    private static final PlatformHookOsx INVOCATION_HANDLER = new PlatformHookOsx();
    3434
    3535    private String oSBuildNumber;
     
    5959            Class<?> preferencesHandler = findHandlerClass("PreferencesHandler");
    6060            Object proxy = Proxy.newProxyInstance(PlatformHookOsx.class.getClassLoader(), new Class<?>[] {
    61                 quitHandler, aboutHandler, openFilesHandler, preferencesHandler}, ivhandler);
     61                quitHandler, aboutHandler, openFilesHandler, preferencesHandler}, INVOCATION_HANDLER);
    6262            Object appli = eawtApplication.getConstructor((Class[]) null).newInstance((Object[]) null);
    6363            if (Utils.getJavaVersion() >= 9) {
Note: See TracChangeset for help on using the changeset viewer.