Changeset 12542 in josm


Ignore:
Timestamp:
2017-07-30T17:07:42+02:00 (3 weeks ago)
Author:
Don-vip
Message:

partial revert of r12537

Location:
trunk
Files:
17 edited

Legend:

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

    r12537 r12542  
    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> VISIBILITY_TOGGLE_LISTENERS = ListenerList.createUnchecked();
     32    private static final ListenerList<ExpertModeChangeListener> listeners = ListenerList.createUnchecked();
     33    private static final ListenerList<Component> visibilityToggleListeners = 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         VISIBILITY_TOGGLE_LISTENERS.fireEvent(c -> c.setVisible(isExpert));
     40        listeners.fireEvent(listener -> listener.expertChanged(isExpert));
     41        visibilityToggleListeners.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         VISIBILITY_TOGGLE_LISTENERS.addWeakListener(c);
     77        visibilityToggleListeners.addWeakListener(c);
    7878        c.setVisible(isExpert());
    7979    }
     
    8686    public static synchronized void removeVisibilitySwitcher(Component c) {
    8787        if (c == null) return;
    88         VISIBILITY_TOGGLE_LISTENERS.removeListener(c);
     88        visibilityToggleListeners.removeListener(c);
    8989    }
    9090
  • trunk/src/org/openstreetmap/josm/actions/ExtensionFileFilter.java

    r12537 r12542  
    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

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

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

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

    r12537 r12542  
    8181
    8282
    83     private static final ConcurrentMap<String, Set<ICachedLoaderListener>> IN_PROGRESS = new ConcurrentHashMap<>();
    84     private static final ConcurrentMap<String, Boolean> USE_HEAD = new ConcurrentHashMap<>();
     83    private static final ConcurrentMap<String, Set<ICachedLoaderListener>> inProgress = new ConcurrentHashMap<>();
     84    private static final ConcurrentMap<String, Boolean> useHead = new ConcurrentHashMap<>();
    8585
    8686    protected final long now; // when the job started
     
    162162            throw new IllegalArgumentException("No url returned");
    163163        }
    164         synchronized (IN_PROGRESS) {
    165             Set<ICachedLoaderListener> newListeners = IN_PROGRESS.get(deduplicationKey);
     164        synchronized (inProgress) {
     165            Set<ICachedLoaderListener> newListeners = inProgress.get(deduplicationKey);
    166166            if (newListeners == null) {
    167167                newListeners = new HashSet<>();
    168                 IN_PROGRESS.put(deduplicationKey, newListeners);
     168                inProgress.put(deduplicationKey, newListeners);
    169169                first = true;
    170170            }
     
    259259    private void finishLoading(LoadResult result) {
    260260        Set<ICachedLoaderListener> listeners;
    261         synchronized (IN_PROGRESS) {
     261        synchronized (inProgress) {
    262262            try {
    263                 listeners = IN_PROGRESS.remove(getUrl().toString());
     263                listeners = inProgress.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(USE_HEAD.get(getServerKey())) &&
     314                    Boolean.TRUE.equals(useHead.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                 USE_HEAD.put(serverKey, Boolean.TRUE);
     348                useHead.put(serverKey, Boolean.TRUE);
    349349            }
    350350
  • trunk/src/org/openstreetmap/josm/data/imagery/TMSCachedTileLoaderJob.java

    r12537 r12542  
    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>> IN_PROGRESS = new ConcurrentHashMap<>();
     53    private static final ConcurrentMap<String, Set<TileLoaderListener>> inProgress = new ConcurrentHashMap<>();
    5454
    5555    /**
     
    7171        if (listener != null) {
    7272            String deduplicationKey = getCacheKey();
    73             synchronized (IN_PROGRESS) {
    74                 Set<TileLoaderListener> newListeners = IN_PROGRESS.get(deduplicationKey);
     73            synchronized (inProgress) {
     74                Set<TileLoaderListener> newListeners = inProgress.get(deduplicationKey);
    7575                if (newListeners == null) {
    7676                    newListeners = new HashSet<>();
    77                     IN_PROGRESS.put(deduplicationKey, newListeners);
     77                    inProgress.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 (IN_PROGRESS) {
    165             listeners = IN_PROGRESS.remove(getCacheKey());
     164        synchronized (inProgress) {
     165            listeners = inProgress.remove(getCacheKey());
    166166        }
    167167        boolean status = result.equals(LoadResult.SUCCESS);
  • trunk/src/org/openstreetmap/josm/data/osm/AbstractPrimitive.java

    r12536 r12542  
    4747    }
    4848
    49     private static final AtomicLong ID_COUNTER = new AtomicLong(0);
     49    private static final AtomicLong idCounter = new AtomicLong(0);
    5050
    5151    /**
     
    5454     */
    5555    static long generateUniqueId() {
    56         return ID_COUNTER.decrementAndGet();
     56        return idCounter.decrementAndGet();
    5757    }
    5858
     
    6363     */
    6464    public static long currentUniqueId() {
    65         return ID_COUNTER.get();
     65        return idCounter.get();
    6666    }
    6767
     
    7676            throw new IllegalArgumentException("Cannot modify the id counter backwards");
    7777        }
    78         ID_COUNTER.set(newId);
     78        idCounter.set(newId);
    7979    }
    8080
  • trunk/src/org/openstreetmap/josm/data/osm/DataSet.java

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

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

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

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

    r12537 r12542  
    3131
    3232    /** The collection of tagging presets */
    33     private static final Collection<TaggingPreset> TAGGING_PRESETS = new ArrayList<>();
     33    private static final Collection<TaggingPreset> taggingPresets = 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         TAGGING_PRESETS.clear();
    52         TAGGING_PRESETS.addAll(TaggingPresetReader.readFromPreferences(false, false));
    53         cachePresets(TAGGING_PRESETS);
     51        taggingPresets.clear();
     52        taggingPresets.addAll(TaggingPresetReader.readFromPreferences(false, false));
     53        cachePresets(taggingPresets);
    5454    }
    5555
     
    5959    public static void initialize() {
    6060        readFromPreferences();
    61         for (TaggingPreset tp: TAGGING_PRESETS) {
     61        for (TaggingPreset tp: taggingPresets) {
    6262            if (!(tp instanceof TaggingPresetSeparator)) {
    6363                Main.toolbar.register(tp);
    6464            }
    6565        }
    66         if (TAGGING_PRESETS.isEmpty()) {
     66        if (taggingPresets.isEmpty()) {
    6767            Main.main.menu.presetsMenu.setVisible(false);
    6868        } else {
    6969            Map<TaggingPresetMenu, JMenu> submenus = new HashMap<>();
    70             for (final TaggingPreset p : TAGGING_PRESETS) {
     70            for (final TaggingPreset p : taggingPresets) {
    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(TAGGING_PRESETS);
     138        return Collections.unmodifiableCollection(taggingPresets);
    139139    }
    140140
     
    199199     */
    200200    public static void addTaggingPresets(Collection<TaggingPreset> presets) {
    201         if (presets != null && TAGGING_PRESETS.addAll(presets)) {
    202             for (TaggingPresetListener listener : LISTENERS) {
     201        if (presets != null && taggingPresets.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/io/OverpassDownloadReader.java

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

    r12537 r12542  
    5151
    5252    private final String sender;
    53     private static final Set<String> TRUSTED_SENDERS = new HashSet<>();
     53    private static final Set<String> trustedSenders = 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() && !TRUSTED_SENDERS.contains(sender)) {
     229        if (!sender.isEmpty() && !trustedSenders.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                         TRUSTED_SENDERS.add(sender);
     234                        trustedSenders.add(sender);
    235235                    else
    236                         TRUSTED_SENDERS.remove(sender);
     236                        trustedSenders.remove(sender);
    237237                }
    238238            });
     
    263263        }
    264264        if (buttonIndex == 2) {
    265             TRUSTED_SENDERS.remove(sender);
     265            trustedSenders.remove(sender);
    266266        }
    267267        setVisible(false);
     
    308308     */
    309309    public static void addTags(String[][] keyValue, String sender, Collection<? extends OsmPrimitive> primitives) {
    310         if (TRUSTED_SENDERS.contains(sender)) {
     310        if (trustedSenders.contains(sender)) {
    311311            if (Main.getLayerManager().getEditDataSet() != null) {
    312312                for (String[] row : keyValue) {
  • trunk/src/org/openstreetmap/josm/io/session/SessionReader.java

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

    r12539 r12542  
    4343  <rule ref="rulesets/java/naming.xml/VariableNamingConventions">
    4444    <properties>
    45         <property name="violationSuppressXPath" value="//FieldDeclaration[@Public='true']|//FieldDeclaration/../Annotation/MarkerAnnotation/Name[@Image='pref']"/>
     45        <property name="violationSuppressXPath" value="//FieldDeclaration[@Public='true']
     46                | //FieldDeclaration/../Annotation/MarkerAnnotation/Name[@Image='pref']
     47                | //FieldDeclaration/Type/ReferenceType/ClassOrInterfaceType[@Image!='Boolean' and
     48                                                                             @Image!='Byte' and
     49                                                                             @Image!='Character' and
     50                                                                             @Image!='Class' and
     51                                                                             @Image!='Double' and
     52                                                                             @Image!='Enum' and
     53                                                                             @Image!='Float' and
     54                                                                             @Image!='Integer' and
     55                                                                             @Image!='Long' and
     56                                                                             @Image!='Number' and
     57                                                                             @Image!='Short' and
     58                                                                             @Image!='String' ]"/>
    4659    </properties>
    4760  </rule>
Note: See TracChangeset for help on using the changeset viewer.