- Timestamp:
- 2017-07-30T00:22:46+02:00 (7 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 48 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/ExpertToggleAction.java
r11224 r12537 30 30 31 31 // 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(); 34 34 35 35 private static final BooleanProperty PREF_EXPERT = new BooleanProperty("expert", false); … … 38 38 39 39 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)); 42 42 } 43 43 … … 53 53 public static synchronized void addExpertModeChangeListener(ExpertModeChangeListener listener, boolean fireWhenAdding) { 54 54 if (listener == null) return; 55 listeners.addWeakListener(listener);55 LISTENERS.addWeakListener(listener); 56 56 if (fireWhenAdding) { 57 57 listener.expertChanged(isExpert()); … … 66 66 public static synchronized void removeExpertModeChangeListener(ExpertModeChangeListener listener) { 67 67 if (listener == null) return; 68 listeners.removeListener(listener);68 LISTENERS.removeListener(listener); 69 69 } 70 70 … … 75 75 public static synchronized void addVisibilitySwitcher(Component c) { 76 76 if (c == null) return; 77 visibilityToggleListeners.addWeakListener(c);77 VISIBILITY_TOGGLE_LISTENERS.addWeakListener(c); 78 78 c.setVisible(isExpert()); 79 79 } … … 86 86 public static synchronized void removeVisibilitySwitcher(Component c) { 87 87 if (c == null) return; 88 visibilityToggleListeners.removeListener(c);88 VISIBILITY_TOGGLE_LISTENERS.removeListener(c); 89 89 } 90 90 -
trunk/src/org/openstreetmap/josm/actions/ExtensionFileFilter.java
r10873 r12537 42 42 * @since 4869 43 43 */ 44 private static final ArrayList<FileImporter> importers;44 private static final ArrayList<FileImporter> IMPORTERS; 45 45 46 46 /** … … 48 48 * @since 4869 49 49 */ 50 private static final ArrayList<FileExporter> exporters;50 private static final ArrayList<FileExporter> EXPORTERS; 51 51 52 52 // add some file types only if the relevant classes are there. … … 56 56 static { 57 57 58 importers= new ArrayList<>();58 IMPORTERS = new ArrayList<>(); 59 59 60 60 final List<Class<? extends FileImporter>> importerNames = Arrays.asList( … … 73 73 try { 74 74 FileImporter importer = importerClass.getConstructor().newInstance(); 75 importers.add(importer);75 IMPORTERS.add(importer); 76 76 } catch (ReflectiveOperationException e) { 77 77 Main.debug(e); … … 95 95 } 96 96 97 exporters= new ArrayList<>();97 EXPORTERS = new ArrayList<>(); 98 98 99 99 final List<Class<? extends FileExporter>> exporterClasses = Arrays.asList( … … 110 110 try { 111 111 FileExporter exporter = exporterClass.getConstructor().newInstance(); 112 exporters.add(exporter);112 EXPORTERS.add(exporter); 113 113 Main.getLayerManager().addAndFireActiveLayerChangeListener(exporter); 114 114 } catch (ReflectiveOperationException e) { … … 147 147 public static void addImporter(FileImporter importer) { 148 148 if (importer != null) { 149 importers.add(importer);149 IMPORTERS.add(importer); 150 150 } 151 151 } … … 158 158 public static void addImporterFirst(FileImporter importer) { 159 159 if (importer != null) { 160 importers.add(0, importer);160 IMPORTERS.add(0, importer); 161 161 } 162 162 } … … 169 169 public static void addExporter(FileExporter exporter) { 170 170 if (exporter != null) { 171 exporters.add(exporter);171 EXPORTERS.add(exporter); 172 172 } 173 173 } … … 180 180 public static void addExporterFirst(FileExporter exporter) { 181 181 if (exporter != null) { 182 exporters.add(0, exporter);182 EXPORTERS.add(0, exporter); 183 183 } 184 184 } … … 190 190 */ 191 191 public static List<FileImporter> getImporters() { 192 return Collections.unmodifiableList( importers);192 return Collections.unmodifiableList(IMPORTERS); 193 193 } 194 194 … … 199 199 */ 200 200 public static List<FileExporter> getExporters() { 201 return Collections.unmodifiableList( exporters);201 return Collections.unmodifiableList(EXPORTERS); 202 202 } 203 203 … … 213 213 */ 214 214 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()); 218 218 } 219 219 } … … 231 231 updateAllFormatsImporter(); 232 232 List<ExtensionFileFilter> filters = new LinkedList<>(); 233 for (FileImporter importer : importers) {233 for (FileImporter importer : IMPORTERS) { 234 234 filters.add(importer.filter); 235 235 } … … 248 248 public static List<ExtensionFileFilter> getExportExtensionFileFilters() { 249 249 List<ExtensionFileFilter> filters = new LinkedList<>(); 250 for (FileExporter exporter : exporters) {250 for (FileExporter exporter : EXPORTERS) { 251 251 if (filters.contains(exporter.filter) || !exporter.isEnabled()) { 252 252 continue; … … 267 267 public static ExtensionFileFilter getDefaultImportExtensionFileFilter(String extension) { 268 268 if (extension == null) return new AllFormatsImporter().filter; 269 for (FileImporter importer : importers) {269 for (FileImporter importer : IMPORTERS) { 270 270 if (extension.equals(importer.filter.getDefaultExtension())) 271 271 return importer.filter; … … 283 283 public static ExtensionFileFilter getDefaultExportExtensionFileFilter(String extension) { 284 284 if (extension == null) return new AllFormatsImporter().filter; 285 for (FileExporter exporter : exporters) {285 for (FileExporter exporter : EXPORTERS) { 286 286 if (extension.equals(exporter.filter.getDefaultExtension())) 287 287 return exporter.filter; … … 290 290 // scan all supported extensions 291 291 File file = new File("file." + extension); 292 for (FileExporter exporter : exporters) {292 for (FileExporter exporter : EXPORTERS) { 293 293 if (exporter.filter.accept(file)) 294 294 return exporter.filter; -
trunk/src/org/openstreetmap/josm/actions/OrthogonalizeAction.java
r12527 r12537 75 75 * Remember movements, so the user can later undo it for certain nodes 76 76 */ 77 private static final Map<Node, EastNorth> rememberMovements= new HashMap<>();77 private static final Map<Node, EastNorth> REMEMBER_MOVEMENTS = new HashMap<>(); 78 78 79 79 /** … … 108 108 if (!(p instanceof Node)) throw new InvalidUserInputException("selected object is not a node"); 109 109 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); 112 112 commands.add(new MoveCommand(n, -tmp.east(), -tmp.north())); 113 rememberMovements.remove(n);113 REMEMBER_MOVEMENTS.remove(n); 114 114 } 115 115 } … … 209 209 } else { 210 210 if (nodeList.size() == 2 || nodeList.isEmpty()) { 211 OrthogonalizeAction.rememberMovements.clear();211 REMEMBER_MOVEMENTS.clear(); 212 212 final Collection<Command> commands = new LinkedList<>(); 213 213 … … 424 424 throw new AssertionError("heading node has changed"); 425 425 } else { 426 OrthogonalizeAction.rememberMovements.put(n, new EastNorth(dx, dy));426 REMEMBER_MOVEMENTS.put(n, new EastNorth(dx, dy)); 427 427 commands.add(new MoveCommand(n, dx, dy)); 428 428 } -
trunk/src/org/openstreetmap/josm/actions/PasteTagsAction.java
r10737 r12537 24 24 public final class PasteTagsAction extends JosmAction { 25 25 26 private static final String help= ht("/Action/PasteTags");26 private static final String HELP = ht("/Action/PasteTags"); 27 27 private final OsmTransferHandler transferHandler = new OsmTransferHandler(); 28 28 … … 35 35 Shortcut.registerShortcut("system:pastestyle", tr("Edit: {0}", tr("Paste Tags")), 36 36 KeyEvent.VK_V, Shortcut.CTRL_SHIFT), true); 37 putValue("help", help);37 putValue("help", HELP); 38 38 } 39 39 -
trunk/src/org/openstreetmap/josm/actions/UploadAction.java
r11848 r12537 52 52 * however, a plugin might also want to insert something after that. 53 53 */ 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<>(); 56 56 57 57 static { … … 59 59 * Calls validator before upload. 60 60 */ 61 uploadHooks.add(new ValidateUploadHook());61 UPLOAD_HOOKS.add(new ValidateUploadHook()); 62 62 63 63 /** 64 64 * Fixes database errors 65 65 */ 66 uploadHooks.add(new FixDataHook());66 UPLOAD_HOOKS.add(new FixDataHook()); 67 67 68 68 /** 69 69 * Checks server capabilities before upload. 70 70 */ 71 uploadHooks.add(new ApiPreconditionCheckerHook());71 UPLOAD_HOOKS.add(new ApiPreconditionCheckerHook()); 72 72 73 73 /** 74 74 * Adjusts the upload order of new relations 75 75 */ 76 uploadHooks.add(new RelationUploadOrderHook());76 UPLOAD_HOOKS.add(new RelationUploadOrderHook()); 77 77 78 78 /** 79 79 * Removes discardable tags like created_by on modified objects 80 80 */ 81 lateUploadHooks.add(new DiscardTagsHook());81 LATE_UPLOAD_HOOKS.add(new DiscardTagsHook()); 82 82 } 83 83 … … 102 102 if (hook == null) return; 103 103 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); 106 106 } 107 107 } else { 108 if (! uploadHooks.contains(hook)) {109 uploadHooks.add(0, hook);108 if (!UPLOAD_HOOKS.contains(hook)) { 109 UPLOAD_HOOKS.add(0, hook); 110 110 } 111 111 } … … 119 119 public static void unregisterUploadHook(UploadHook hook) { 120 120 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); 126 126 } 127 127 } … … 204 204 // 205 205 if (apiData != null) { 206 for (UploadHook hook : uploadHooks) {206 for (UploadHook hook : UPLOAD_HOOKS) { 207 207 if (!hook.checkUpload(apiData)) 208 208 return false; … … 240 240 return; 241 241 242 for (UploadHook hook : lateUploadHooks) {242 for (UploadHook hook : LATE_UPLOAD_HOOKS) { 243 243 if (!hook.checkUpload(apiData)) 244 244 return; -
trunk/src/org/openstreetmap/josm/actions/mapmode/DeleteAction.java
r12526 r12537 56 56 private transient WaySegment oldHighlightedWaySegment; 57 57 58 private static final HighlightHelper highlightHelper= new HighlightHelper();58 private static final HighlightHelper HIGHLIGHT_HELPER = new HighlightHelper(); 59 59 private boolean drawTargetHighlight; 60 60 … … 177 177 */ 178 178 private void removeHighlighting() { 179 highlightHelper.clear();179 HIGHLIGHT_HELPER.clear(); 180 180 DataSet ds = getLayerManager().getEditDataSet(); 181 181 if (ds != null) { … … 232 232 oldHighlightedWaySegment = newHighlightedWaySegment; 233 233 } 234 needsRepaint |= highlightHelper.highlightOnly(newHighlights);234 needsRepaint |= HIGHLIGHT_HELPER.highlightOnly(newHighlights); 235 235 if (needsRepaint && editLayer != null) { 236 236 editLayer.invalidate(); -
trunk/src/org/openstreetmap/josm/actions/search/PushbackTokenizer.java
r12409 r12537 148 148 } 149 149 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('"'); 152 152 153 153 private String getString(boolean quoted) { 154 List<Character> sChars = quoted ? specialCharsQuoted : specialChars;154 List<Character> sChars = quoted ? SPECIAL_CHARS_QUOTED : SPECIAL_CHARS; 155 155 StringBuilder s = new StringBuilder(); 156 156 boolean escape = false; -
trunk/src/org/openstreetmap/josm/actions/search/SearchAction.java
r12464 r12537 125 125 } 126 126 127 private static final LinkedList<SearchSetting> searchHistory= new LinkedList<>();127 private static final LinkedList<SearchSetting> SEARCH_HISTORY = new LinkedList<>(); 128 128 static { 129 129 for (String s: Main.pref.getCollection("search.history", Collections.<String>emptyList())) { 130 130 SearchSetting ss = SearchSetting.readFromString(s); 131 131 if (ss != null) { 132 searchHistory.add(ss);132 SEARCH_HISTORY.add(ss); 133 133 } 134 134 } … … 140 140 */ 141 141 public static Collection<SearchSetting> getSearchHistory() { 142 return searchHistory;142 return SEARCH_HISTORY; 143 143 } 144 144 … … 148 148 */ 149 149 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)) { 153 153 // 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)); 156 156 } 157 157 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) { 163 163 savedHistory.add(item.writeToString()); 164 164 } -
trunk/src/org/openstreetmap/josm/corrector/ReverseWayNoTagCorrector.java
r12279 r12537 36 36 * Tags that imply a semantic meaning from the way direction and cannot be changed. 37 37 */ 38 private static final TagCollection directionalTags= new TagCollection(Arrays.asList(38 private static final TagCollection DIRECTIONAL_TAGS = new TagCollection(Arrays.asList( 39 39 new Tag("natural", "coastline"), 40 40 new Tag("natural", "cliff"), … … 54 54 for (Map.Entry<String, String> entry : way.getKeys().entrySet()) { 55 55 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(); 57 57 if (isDirectional) { 58 58 final boolean cannotBeCorrected = ReverseWayTagCorrector.getTagCorrections(tag).isEmpty(); -
trunk/src/org/openstreetmap/josm/corrector/ReverseWayTagCorrector.java
r12412 r12537 53 53 } 54 54 55 private static final Collection<Pattern> ignoredKeys= new ArrayList<>();55 private static final Collection<Pattern> IGNORED_KEYS = new ArrayList<>(); 56 56 static { 57 57 for (String s : OsmPrimitive.getUninterestingKeys()) { 58 ignoredKeys.add(getPatternFor(s));58 IGNORED_KEYS.add(getPatternFor(s)); 59 59 } 60 60 for (String s : new String[]{"name", "ref", "tiger:county"}) { 61 ignoredKeys.add(getPatternFor(s, false));61 IGNORED_KEYS.add(getPatternFor(s, false)); 62 62 } 63 63 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)); 65 65 } 66 66 } … … 292 292 293 293 private static boolean ignoreKeyForCorrection(String key) { 294 for (Pattern ignoredKey : ignoredKeys) {294 for (Pattern ignoredKey : IGNORED_KEYS) { 295 295 if (ignoredKey.matcher(key).matches()) { 296 296 return true; -
trunk/src/org/openstreetmap/josm/data/Preferences.java
r12409 r12537 1457 1457 throw new IllegalArgumentException(ex); 1458 1458 } 1459 for (Entry<String, String> key _value : hash.entrySet()) {1459 for (Entry<String, String> keyValue : hash.entrySet()) { 1460 1460 Object value; 1461 1461 Field f; 1462 1462 try { 1463 f = klass.getDeclaredField(key _value.getKey().replace('-', '_'));1463 f = klass.getDeclaredField(keyValue.getKey().replace('-', '_')); 1464 1464 } catch (NoSuchFieldException ex) { 1465 1465 Main.trace(ex); … … 1471 1471 Utils.setObjectsAccessible(f); 1472 1472 if (f.getType() == Boolean.class || f.getType() == boolean.class) { 1473 value = Boolean.valueOf(key _value.getValue());1473 value = Boolean.valueOf(keyValue.getValue()); 1474 1474 } else if (f.getType() == Integer.class || f.getType() == int.class) { 1475 1475 try { 1476 value = Integer.valueOf(key _value.getValue());1476 value = Integer.valueOf(keyValue.getValue()); 1477 1477 } catch (NumberFormatException nfe) { 1478 1478 continue; … … 1480 1480 } else if (f.getType() == Double.class || f.getType() == double.class) { 1481 1481 try { 1482 value = Double.valueOf(key _value.getValue());1482 value = Double.valueOf(keyValue.getValue()); 1483 1483 } catch (NumberFormatException nfe) { 1484 1484 continue; 1485 1485 } 1486 1486 } else if (f.getType() == String.class) { 1487 value = key _value.getValue();1487 value = keyValue.getValue(); 1488 1488 } else if (f.getType().isAssignableFrom(Map.class)) { 1489 value = mapFromJson(key _value.getValue());1489 value = mapFromJson(keyValue.getValue()); 1490 1490 } else if (f.getType().isAssignableFrom(MultiMap.class)) { 1491 value = multiMapFromJson(key _value.getValue());1491 value = multiMapFromJson(keyValue.getValue()); 1492 1492 } else 1493 1493 throw new JosmRuntimeException("unsupported preference primitive type"); -
trunk/src/org/openstreetmap/josm/data/SystemOfMeasurement.java
r11553 r12537 80 80 } 81 81 82 private static final CopyOnWriteArrayList<SoMChangeListener> somChangeListeners= new CopyOnWriteArrayList<>();82 private static final CopyOnWriteArrayList<SoMChangeListener> SOM_CHANGE_LISTENERS = new CopyOnWriteArrayList<>(); 83 83 84 84 /** … … 89 89 */ 90 90 public static void removeSoMChangeListener(SoMChangeListener listener) { 91 somChangeListeners.remove(listener);91 SOM_CHANGE_LISTENERS.remove(listener); 92 92 } 93 93 … … 100 100 public static void addSoMChangeListener(SoMChangeListener listener) { 101 101 if (listener != null) { 102 somChangeListeners.addIfAbsent(listener);102 SOM_CHANGE_LISTENERS.addIfAbsent(listener); 103 103 } 104 104 } 105 105 106 106 protected static void fireSoMChanged(String oldSoM, String newSoM) { 107 for (SoMChangeListener l : somChangeListeners) {107 for (SoMChangeListener l : SOM_CHANGE_LISTENERS) { 108 108 l.systemOfMeasurementChanged(oldSoM, newSoM); 109 109 } -
trunk/src/org/openstreetmap/josm/data/cache/JCSCacheManager.java
r11746 r12537 48 48 public static final BooleanProperty USE_BLOCK_CACHE = new BooleanProperty(PREFERENCE_PREFIX + ".use_block_cache", true); 49 49 50 private static final AuxiliaryCacheFactory diskCacheFactory=50 private static final AuxiliaryCacheFactory DISK_CACHE_FACTORY = 51 51 USE_BLOCK_CACHE.get() ? new BlockDiskCacheFactory() : new IndexedDiskCacheFactory(); 52 52 private static FileLock cacheDirLock; … … 177 177 try { 178 178 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())}); 181 181 } 182 182 } catch (IOException e) { -
trunk/src/org/openstreetmap/josm/data/cache/JCSCachedTileLoaderJob.java
r11958 r12537 81 81 82 82 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<>(); 85 85 86 86 protected final long now; // when the job started … … 162 162 throw new IllegalArgumentException("No url returned"); 163 163 } 164 synchronized ( inProgress) {165 Set<ICachedLoaderListener> newListeners = inProgress.get(deduplicationKey);164 synchronized (IN_PROGRESS) { 165 Set<ICachedLoaderListener> newListeners = IN_PROGRESS.get(deduplicationKey); 166 166 if (newListeners == null) { 167 167 newListeners = new HashSet<>(); 168 inProgress.put(deduplicationKey, newListeners);168 IN_PROGRESS.put(deduplicationKey, newListeners); 169 169 first = true; 170 170 } … … 259 259 private void finishLoading(LoadResult result) { 260 260 Set<ICachedLoaderListener> listeners; 261 synchronized ( inProgress) {261 synchronized (IN_PROGRESS) { 262 262 try { 263 listeners = inProgress.remove(getUrl().toString());263 listeners = IN_PROGRESS.remove(getUrl().toString()); 264 264 } catch (IOException e) { 265 265 listeners = null; … … 312 312 // then just use HEAD request and check returned values 313 313 if (isObjectLoadable() && 314 Boolean.TRUE.equals( useHead.get(getServerKey())) &&314 Boolean.TRUE.equals(USE_HEAD.get(getServerKey())) && 315 315 isCacheValidUsingHead()) { 316 316 LOG.log(Level.FINE, "JCS - cache entry verified using HEAD request: {0}", getUrl()); … … 346 346 LOG.log(Level.INFO, "JCS - Host: {0} found not to return 304 codes for If-Modified-Since or If-None-Match headers", 347 347 serverKey); 348 useHead.put(serverKey, Boolean.TRUE);348 USE_HEAD.put(serverKey, Boolean.TRUE); 349 349 } 350 350 -
trunk/src/org/openstreetmap/josm/data/imagery/TMSCachedTileLoaderJob.java
r11858 r12537 51 51 // we need another deduplication of Tile Loader listeners, as for each submit, new TMSCachedTileLoaderJob was created 52 52 // 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<>(); 54 54 55 55 /** … … 71 71 if (listener != null) { 72 72 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); 75 75 if (newListeners == null) { 76 76 newListeners = new HashSet<>(); 77 inProgress.put(deduplicationKey, newListeners);77 IN_PROGRESS.put(deduplicationKey, newListeners); 78 78 } 79 79 newListeners.add(listener); … … 162 162 this.attributes = attributes; // as we might get notification from other object than our selfs, pass attributes along 163 163 Set<TileLoaderListener> listeners; 164 synchronized ( inProgress) {165 listeners = inProgress.remove(getCacheKey());164 synchronized (IN_PROGRESS) { 165 listeners = IN_PROGRESS.remove(getCacheKey()); 166 166 } 167 167 boolean status = result.equals(LoadResult.SUCCESS); -
trunk/src/org/openstreetmap/josm/data/imagery/TemplatedWMSTileSource.java
r11860 r12537 45 45 // CHECKSTYLE.ON: SingleSpaceSeparator 46 46 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)); 48 48 49 49 private static final Pattern[] ALL_PATTERNS = { … … 111 111 String bbox; 112 112 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)); 114 115 } 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)); 116 118 } 117 119 … … 132 134 break; 133 135 case "w": 134 replacement = latLonFormat.format(w);136 replacement = LATLON_FORMAT.format(w); 135 137 break; 136 138 case "s": 137 replacement = latLonFormat.format(s);139 replacement = LATLON_FORMAT.format(s); 138 140 break; 139 141 case "e": 140 replacement = latLonFormat.format(e);142 replacement = LATLON_FORMAT.format(e); 141 143 break; 142 144 case "n": 143 replacement = latLonFormat.format(n);145 replacement = LATLON_FORMAT.format(n); 144 146 break; 145 147 case "width": -
trunk/src/org/openstreetmap/josm/data/osm/ChangesetCache.java
r11349 r12537 37 37 public final class ChangesetCache implements PreferenceChangedListener { 38 38 /** the unique instance */ 39 private static final ChangesetCache instance= new ChangesetCache();39 private static final ChangesetCache INSTANCE = new ChangesetCache(); 40 40 41 41 /** the cached changesets */ … … 56 56 */ 57 57 public static ChangesetCache getInstance() { 58 return instance;58 return INSTANCE; 59 59 } 60 60 -
trunk/src/org/openstreetmap/josm/data/osm/DataSet.java
r12479 r12537 638 638 * dataset. (However, the selection does only change in the active layer) 639 639 */ 640 private static final Collection<SelectionChangedListener> selListeners= new CopyOnWriteArrayList<>();640 private static final Collection<SelectionChangedListener> SEL_LISTENERS = new CopyOnWriteArrayList<>(); 641 641 642 642 /** … … 647 647 */ 648 648 public static void addSelectionListener(SelectionChangedListener listener) { 649 ((CopyOnWriteArrayList<SelectionChangedListener>) selListeners).addIfAbsent(listener);649 ((CopyOnWriteArrayList<SelectionChangedListener>) SEL_LISTENERS).addIfAbsent(listener); 650 650 } 651 651 … … 657 657 */ 658 658 public static void removeSelectionListener(SelectionChangedListener listener) { 659 selListeners.remove(listener);659 SEL_LISTENERS.remove(listener); 660 660 } 661 661 … … 671 671 672 672 private static void fireDreprecatedSelectionChange(Collection<? extends OsmPrimitive> currentSelection) { 673 for (SelectionChangedListener l : selListeners) {673 for (SelectionChangedListener l : SEL_LISTENERS) { 674 674 l.selectionChanged(currentSelection); 675 675 } -
trunk/src/org/openstreetmap/josm/data/osm/QuadBuckets.java
r12122 r12537 23 23 */ 24 24 public class QuadBuckets<T extends OsmPrimitive> implements Collection<T> { 25 private static final boolean consistency_testing= false;25 private static final boolean CONSISTENCY_TESTING = false; 26 26 private static final byte NW_INDEX = 1; 27 27 private static final byte NE_INDEX = 3; … … 271 271 272 272 void doAdd(T o) { 273 if ( consistency_testing) {273 if (CONSISTENCY_TESTING) { 274 274 if (o instanceof Node && !matches(o, this)) { 275 275 o.getBBox().getIndex(level); -
trunk/src/org/openstreetmap/josm/data/osm/User.java
r11912 r12537 34 34 * @see #getAnonymous() 35 35 */ 36 private static final User anonymous= createLocalUser(tr("<anonymous>"));36 private static final User ANONYMOUS = createLocalUser(tr("<anonymous>")); 37 37 38 38 private static long getNextLocalUid() { … … 131 131 */ 132 132 public static User getAnonymous() { 133 return anonymous;133 return ANONYMOUS; 134 134 } 135 135 -
trunk/src/org/openstreetmap/josm/data/osm/event/DatasetEventManager.java
r11928 r12537 29 29 public class DatasetEventManager implements ActiveLayerChangeListener, Listener { 30 30 31 private static final DatasetEventManager instance= new DatasetEventManager();31 private static final DatasetEventManager INSTANCE = new DatasetEventManager(); 32 32 33 33 private final class EdtRunnable implements Runnable { … … 139 139 */ 140 140 public static DatasetEventManager getInstance() { 141 return instance;141 return INSTANCE; 142 142 } 143 143 -
trunk/src/org/openstreetmap/josm/data/osm/event/SelectionEventManager.java
r12116 r12537 32 32 public class SelectionEventManager implements DataSelectionListener, ActiveLayerChangeListener { 33 33 34 private static final SelectionEventManager instance= new SelectionEventManager();34 private static final SelectionEventManager INSTANCE = new SelectionEventManager(); 35 35 36 36 /** … … 39 39 */ 40 40 public static SelectionEventManager getInstance() { 41 return instance;41 return INSTANCE; 42 42 } 43 43 -
trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/PaintColors.java
r12376 r12537 93 93 private static volatile Color backgroundColorCache; 94 94 95 private static final MapPaintSylesUpdateListener styleOverrideListener= new MapPaintSylesUpdateListener() {95 private static final MapPaintSylesUpdateListener STYLE_OVERRIDE_LISTENER = new MapPaintSylesUpdateListener() { 96 96 //TODO: Listen to wireframe map mode changes. 97 97 @Override … … 107 107 108 108 static { 109 MapPaintStyles.addMapPaintSylesUpdateListener( styleOverrideListener);109 MapPaintStyles.addMapPaintSylesUpdateListener(STYLE_OVERRIDE_LISTENER); 110 110 } 111 111 -
trunk/src/org/openstreetmap/josm/data/validation/OsmValidator.java
r12390 r12537 79 79 private static double griddetail; 80 80 81 private static final Collection<String> ignoredErrors= new TreeSet<>();81 private static final Collection<String> IGNORED_ERRORS = new TreeSet<>(); 82 82 83 83 /** 84 84 * All registered tests 85 85 */ 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<>(); 88 88 89 89 /** … … 139 139 */ 140 140 public static void addTest(Class<? extends Test> testClass) { 141 allTests.add(testClass);141 ALL_TESTS.add(testClass); 142 142 try { 143 allTestsMap.put(testClass.getName(), testClass.getConstructor().newInstance());143 ALL_TESTS_MAP.put(testClass.getName(), testClass.getConstructor().newInstance()); 144 144 } catch (ReflectiveOperationException e) { 145 145 Main.error(e); … … 182 182 183 183 private static void loadIgnoredErrors() { 184 ignoredErrors.clear();184 IGNORED_ERRORS.clear(); 185 185 if (ValidatorPreference.PREF_USE_IGNORE.get()) { 186 186 Path path = Paths.get(getValidatorDir()).resolve("ignorederrors"); 187 187 if (path.toFile().exists()) { 188 188 try { 189 ignoredErrors.addAll(Files.readAllLines(path, StandardCharsets.UTF_8));189 IGNORED_ERRORS.addAll(Files.readAllLines(path, StandardCharsets.UTF_8)); 190 190 } catch (final FileNotFoundException e) { 191 191 Main.debug(Main.getErrorMessage(e)); … … 204 204 */ 205 205 public static void addIgnoredError(String s) { 206 ignoredErrors.add(s);206 IGNORED_ERRORS.add(s); 207 207 } 208 208 … … 213 213 */ 214 214 public static boolean hasIgnoredError(String s) { 215 return ignoredErrors.contains(s);215 return IGNORED_ERRORS.contains(s); 216 216 } 217 217 … … 221 221 public static void saveIgnoredErrors() { 222 222 try (PrintWriter out = new PrintWriter(new File(getValidatorDir(), "ignorederrors"), StandardCharsets.UTF_8.name())) { 223 for (String e : ignoredErrors) {223 for (String e : IGNORED_ERRORS) { 224 224 out.println(e); 225 225 } … … 254 254 */ 255 255 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); 259 259 } 260 260 … … 271 271 return null; 272 272 } 273 return (T) allTestsMap.get(testClass.getName());273 return (T) ALL_TESTS_MAP.get(testClass.getName()); 274 274 } 275 275 … … 318 318 */ 319 319 public static Collection<Class<? extends Test>> getAllAvailableTestClasses() { 320 return Collections.unmodifiableCollection( allTests);320 return Collections.unmodifiableCollection(ALL_TESTS); 321 321 } 322 322 -
trunk/src/org/openstreetmap/josm/gui/DefaultNameFormatter.java
r11900 r12537 53 53 private static DefaultNameFormatter instance; 54 54 55 private static final List<NameFormatterHook> formatHooks= new LinkedList<>();55 private static final List<NameFormatterHook> FORMAT_HOOKS = new LinkedList<>(); 56 56 57 57 /** … … 75 75 public static void registerFormatHook(NameFormatterHook hook) { 76 76 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); 79 79 } 80 80 } … … 87 87 public static void unregisterFormatHook(NameFormatterHook hook) { 88 88 if (hook == null) return; 89 if ( formatHooks.contains(hook)) {90 formatHooks.remove(hook);89 if (FORMAT_HOOKS.contains(hook)) { 90 FORMAT_HOOKS.remove(hook); 91 91 } 92 92 } … … 203 203 204 204 String result = name.toString(); 205 for (NameFormatterHook hook: formatHooks) {205 for (NameFormatterHook hook: FORMAT_HOOKS) { 206 206 String hookResult = hook.checkFormat(node, result); 207 207 if (hookResult != null) … … 295 295 296 296 String result = name.toString(); 297 for (NameFormatterHook hook: formatHooks) {297 for (NameFormatterHook hook: FORMAT_HOOKS) { 298 298 String hookResult = hook.checkFormat(way, result); 299 299 if (hookResult != null) … … 333 333 334 334 String result = name.toString(); 335 for (NameFormatterHook hook: formatHooks) {335 for (NameFormatterHook hook: FORMAT_HOOKS) { 336 336 String hookResult = hook.checkFormat(relation, result); 337 337 if (hookResult != null) … … 430 430 } 431 431 432 for (NameFormatterHook hook: formatHooks) {432 for (NameFormatterHook hook: FORMAT_HOOKS) { 433 433 String hookResult = hook.checkRelationTypeName(relation, name); 434 434 if (hookResult != null) -
trunk/src/org/openstreetmap/josm/gui/MapSlider.java
r12391 r12537 20 20 class MapSlider extends JSlider implements PropertyChangeListener, ChangeListener, Helpful { 21 21 22 private static final double zoomStep= 1.1;22 private static final double ZOOM_STEP = 1.1; 23 23 private final MapView mv; 24 24 private boolean preventChange; … … 40 40 public void propertyChange(PropertyChangeEvent evt) { 41 41 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)); 43 43 preventChange = true; 44 44 setValue(zoom); … … 59 59 } else { 60 60 double maxScale = this.mv.getMaxScale(); 61 double scale = maxScale/Math.pow( zoomStep, getValue());61 double scale = maxScale/Math.pow(ZOOM_STEP, getValue()); 62 62 double snapped = mv.scaleFloor(scale); 63 63 mv.zoomTo(this.mv.getCenter(), snapped); -
trunk/src/org/openstreetmap/josm/gui/bbox/SlippyMapControler.java
r11452 r12537 31 31 32 32 /** 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); 34 34 35 35 /** Does the moving */ … … 229 229 scheduled = newMoveTaskState; 230 230 if (newMoveTaskState) { 231 timer.schedule(this, 0, timerInterval);231 TIMER.schedule(this, 0, timerInterval); 232 232 } else { 233 233 // We have to create a new instance because rescheduling a -
trunk/src/org/openstreetmap/josm/gui/datatransfer/importers/TextTagPaster.java
r11381 r12537 20 20 */ 21 21 public final class TextTagPaster extends AbstractTagPaster { 22 private static final String help= ht("/Action/PasteTags");22 private static final String HELP = ht("/Action/PasteTags"); 23 23 24 24 /** … … 47 47 Map<String, String> tags = getTagsImpl(support); 48 48 if (tags.isEmpty()) { 49 TextTagParser.showBadBufferMessage( help);49 TextTagParser.showBadBufferMessage(HELP); 50 50 throw new IOException("Invalid tags to paste."); 51 51 } -
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/MemberTableLinkedCellRenderer.java
r10378 r12537 17 17 public class MemberTableLinkedCellRenderer extends MemberTableCellRenderer { 18 18 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(); 24 24 private transient WayConnectionType value = new WayConnectionType(); 25 25 … … 75 75 g.setColor(Color.black); 76 76 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); 79 79 g.drawLine(xoff+3, y1-3, xoff+xloop-3, y1-3); 80 80 } else { … … 103 103 g.fillRect(xoff-1, y2+2, 3, 3); 104 104 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); 106 106 g.drawLine(xoff+3-1, y2+3, xoff+xloop-3, y2+3); 107 107 } else { … … 160 160 switch (value.direction) { 161 161 case FORWARD: 162 arrow = arrowDown;162 arrow = ARROW_DOWN; 163 163 break; 164 164 case BACKWARD: 165 arrow = arrowUp;165 arrow = ARROW_UP; 166 166 break; 167 167 default: … … 169 169 } 170 170 if (value.direction == Direction.ROUNDABOUT_LEFT) { 171 g.drawImage( roundabout_left, xoff-6, 1, null);171 g.drawImage(ROUNDABOUT_LEFT, xoff-6, 1, null); 172 172 } 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); 174 174 } 175 175 … … 180 180 181 181 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; 186 186 } 187 187 } -
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/sort/RelationSorter.java
r10619 r12537 3 3 4 4 import java.util.ArrayList; 5 import java.util.Arrays; 5 6 import java.util.Collection; 6 7 import java.util.HashMap; … … 26 27 } 27 28 28 private static final Collection<AdditionalSorter> additionalSorters = new ArrayList<>(); 29 static { 29 private static final Collection<AdditionalSorter> ADDITIONAL_SORTERS = Arrays.asList( 30 30 // 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 ); 35 35 36 36 /** … … 144 144 for (RelationMember m : relationMembers) { 145 145 boolean wasAdded = false; 146 for (AdditionalSorter sorter : additionalSorters) {146 for (AdditionalSorter sorter : ADDITIONAL_SORTERS) { 147 147 if (sorter.acceptsMember(m)) { 148 148 List<RelationMember> list; -
trunk/src/org/openstreetmap/josm/gui/help/HelpBrowser.java
r12525 r12537 77 77 private final transient HelpContentReader reader; 78 78 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) { 80 80 @Override 81 81 public void actionPerformed(ActionEvent e) { … … 221 221 } 222 222 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); 224 224 } 225 225 } -
trunk/src/org/openstreetmap/josm/gui/io/LayerNameAndFilePathTableCell.java
r11893 r12537 38 38 */ 39 39 class 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); 41 41 private static final String ELLIPSIS = '…' + File.separator; 42 42 … … 46 46 private final JButton btnFileChooser = new JButton(new LaunchFileChooserAction()); 47 47 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); 49 49 50 50 private final transient CellEditorSupport cellEditorSupport = new CellEditorSupport(this); … … 137 137 lblLayerName.setIcon(info.getLayer().getIcon()); 138 138 lblLayerName.setText(info.getName()); 139 add(lblLayerName, defaultCellStyle);139 add(lblLayerName, DEFAULT_CELL_STYLE); 140 140 return tr("The bold text is the name of the layer."); 141 141 } … … 164 164 } 165 165 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); 170 170 return tr("Click cell to change the file path.") + "<br/>" + tooltip; 171 171 } -
trunk/src/org/openstreetmap/josm/gui/io/SaveLayersTableColumnModel.java
r12452 r12537 27 27 private final JLabel needsUpload = new JLabel(tr("should be uploaded")); 28 28 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); 30 30 31 31 /** … … 48 48 String htmlInfoName = Utils.escapeReservedCharactersHTML(info.getName()); 49 49 if (info.getLayer().requiresUploadToServer() && !info.getLayer().isUploadDiscouraged()) { 50 panel.add(needsUpload, defaultCellStyle);50 panel.add(needsUpload, DEFAULT_CELL_STYLE); 51 51 sb.append(tr("Layer ''{0}'' has modifications which should be uploaded to the server.", htmlInfoName)); 52 52 53 53 } else { 54 54 if (info.isUploadable()) { 55 panel.add(pnlEmpty, defaultCellStyle);55 panel.add(pnlEmpty, DEFAULT_CELL_STYLE); 56 56 } 57 57 if (info.getLayer().requiresUploadToServer()) { … … 64 64 65 65 if (info.getLayer().requiresSaveToFile()) { 66 panel.add(needsSave, defaultCellStyle);66 panel.add(needsSave, DEFAULT_CELL_STYLE); 67 67 sb.append(tr("Layer ''{0}'' has modifications which should be saved to its associated file ''{1}''.", 68 68 htmlInfoName, info.getFile().toString())); 69 69 } else { 70 70 if (info.isSavable()) { 71 panel.add(pnlEmpty, defaultCellStyle);71 panel.add(pnlEmpty, DEFAULT_CELL_STYLE); 72 72 } 73 73 sb.append(tr("Layer ''{0}'' has no modifications to be saved.", htmlInfoName)); -
trunk/src/org/openstreetmap/josm/gui/io/UploadDialog.java
r12531 r12537 75 75 76 76 /** 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<>(); 78 78 79 79 /** the "created_by" changeset OSM key */ … … 136 136 137 137 // Custom components 138 for (Component c : customComponents) {138 for (Component c : CUSTOM_COMPONENTS) { 139 139 pnl.add(c, GBC.eol().fill(GBC.HORIZONTAL)); 140 140 } … … 406 406 public static boolean addCustomComponent(Component c) { 407 407 if (c != null) { 408 return customComponents.add(c);408 return CUSTOM_COMPONENTS.add(c); 409 409 } 410 410 return false; -
trunk/src/org/openstreetmap/josm/gui/layer/imagery/SharpenImageProcessor.java
r10755 r12537 22 22 private ConvolveOp op; 23 23 24 private static f loat[] KERNEL_IDENTITY = new float[] {24 private static final float[] KERNEL_IDENTITY = new float[] { 25 25 0, 0, 0, 26 26 0, 1, 0, … … 28 28 }; 29 29 30 private static f loat[] KERNEL_BLUR = new float[] {30 private static final float[] KERNEL_BLUR = new float[] { 31 31 1f / 16, 2f / 16, 1f / 16, 32 32 2f / 16, 4f / 16, 2f / 16, … … 34 34 }; 35 35 36 private static f loat[] KERNEL_SHARPEN = new float[] {36 private static final float[] KERNEL_SHARPEN = new float[] { 37 37 -.5f, -1f, -.5f, 38 38 -1f, 7, -1f, -
trunk/src/org/openstreetmap/josm/gui/preferences/PreferenceTabbedPane.java
r12005 r12537 251 251 // all created tabs 252 252 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(); 255 255 private final transient List<PreferenceSetting> settings = new ArrayList<>(); 256 256 … … 439 439 440 440 public void buildGui() { 441 Collection<PreferenceSettingFactory> factories = new ArrayList<>( settingsFactories);441 Collection<PreferenceSettingFactory> factories = new ArrayList<>(SETTINGS_FACTORIES); 442 442 factories.addAll(PluginHandler.getPreferenceSetting()); 443 factories.add( advancedPreferenceFactory);443 factories.add(ADVANCED_PREFERENCE_FACTORY); 444 444 445 445 for (PreferenceSettingFactory factory : factories) { … … 531 531 static { 532 532 // 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()); 556 556 } 557 557 -
trunk/src/org/openstreetmap/josm/gui/preferences/projection/LambertProjectionChoice.java
r12280 r12537 22 22 public class LambertProjectionChoice extends ListProjectionChoice { 23 23 24 private static final String[] lambert4zones= {24 private static final String[] LAMBERT_4_ZONES = { 25 25 tr("{0} ({1} to {2} degrees)", 1, "51.30", "48.15"), 26 26 tr("{0} ({1} to {2} degrees)", 2, "48.15", "45.45"), … … 33 33 */ 34 34 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")); 36 36 } 37 37 -
trunk/src/org/openstreetmap/josm/gui/preferences/projection/UTMFranceDOMProjectionChoice.java
r12223 r12537 16 16 public class UTMFranceDOMProjectionChoice extends ListProjectionChoice { 17 17 18 private static final String F ortMarigotName= tr("Guadeloupe Fort-Marigot 1949");19 private static final String S ainteAnneName= tr("Guadeloupe Ste-Anne 1948");20 private static final String M artiniqueName= tr("Martinique Fort Desaix 1952");21 private static final String R eunion92Name= tr("Reunion RGR92");22 private static final String G uyane92Name= 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}; 24 24 25 private static final Integer F ortMarigotEPSG = 2969;26 private static final Integer S ainteAnneEPSG = 2970;27 private static final Integer M artiniqueEPSG = 2973;28 private static final Integer R eunionEPSG = 2975;29 private static final Integer G uyaneEPSG = 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 }; 31 31 32 32 /** … … 34 34 */ 35 35 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")); 37 37 } 38 38 … … 54 54 @Override 55 55 public String getProjectionName() { 56 return utmGeodesicsNames[index];56 return UTM_GEODESIC_NAMES[index]; 57 57 } 58 58 59 59 @Override 60 60 public String getCurrentCode() { 61 return "EPSG:" + utmEPSGs[index];61 return "EPSG:" + UTM_EPSGS[index]; 62 62 } 63 63 64 64 @Override 65 65 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]; 69 69 } 70 70 return res; … … 73 73 @Override 74 74 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)) 77 77 return Collections.singleton(Integer.toString(i+1)); 78 78 } -
trunk/src/org/openstreetmap/josm/gui/tagging/presets/TaggingPresets.java
r12077 r12537 31 31 32 32 /** The collection of tagging presets */ 33 private static final Collection<TaggingPreset> taggingPresets= new ArrayList<>();33 private static final Collection<TaggingPreset> TAGGING_PRESETS = new ArrayList<>(); 34 34 35 35 /** cache for key/value pairs found in the preset */ … … 39 39 40 40 /** The collection of listeners */ 41 private static final Collection<TaggingPresetListener> listeners= new ArrayList<>();41 private static final Collection<TaggingPresetListener> LISTENERS = new ArrayList<>(); 42 42 43 43 private TaggingPresets() { … … 49 49 */ 50 50 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); 54 54 } 55 55 … … 59 59 public static void initialize() { 60 60 readFromPreferences(); 61 for (TaggingPreset tp: taggingPresets) {61 for (TaggingPreset tp: TAGGING_PRESETS) { 62 62 if (!(tp instanceof TaggingPresetSeparator)) { 63 63 Main.toolbar.register(tp); 64 64 } 65 65 } 66 if ( taggingPresets.isEmpty()) {66 if (TAGGING_PRESETS.isEmpty()) { 67 67 Main.main.menu.presetsMenu.setVisible(false); 68 68 } else { 69 69 Map<TaggingPresetMenu, JMenu> submenus = new HashMap<>(); 70 for (final TaggingPreset p : taggingPresets) {70 for (final TaggingPreset p : TAGGING_PRESETS) { 71 71 JMenu m = p.group != null ? submenus.get(p.group) : Main.main.menu.presetsMenu; 72 72 if (m == null && p.group != null) { … … 136 136 */ 137 137 public static Collection<TaggingPreset> getTaggingPresets() { 138 return Collections.unmodifiableCollection( taggingPresets);138 return Collections.unmodifiableCollection(TAGGING_PRESETS); 139 139 } 140 140 … … 199 199 */ 200 200 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) { 203 203 listener.taggingPresetsModified(); 204 204 } … … 212 212 public static void addListener(TaggingPresetListener listener) { 213 213 if (listener != null) { 214 listeners.add(listener);214 LISTENERS.add(listener); 215 215 } 216 216 } … … 222 222 public static void removeListener(TaggingPresetListener listener) { 223 223 if (listener != null) { 224 listeners.remove(listener);224 LISTENERS.remove(listener); 225 225 } 226 226 } -
trunk/src/org/openstreetmap/josm/gui/util/FileFilterAllFiles.java
r8126 r12537 14 14 public class FileFilterAllFiles extends FileFilter { 15 15 16 private static FileFilterAllFiles INSTANCE;16 private static FileFilterAllFiles instance; 17 17 18 18 /** … … 21 21 */ 22 22 public static synchronized FileFilterAllFiles getInstance() { 23 if ( INSTANCE== null) {24 INSTANCE= new FileFilterAllFiles();23 if (instance == null) { 24 instance = new FileFilterAllFiles(); 25 25 } 26 return INSTANCE;26 return instance; 27 27 } 28 28 -
trunk/src/org/openstreetmap/josm/io/DefaultProxySelector.java
r12279 r12537 41 41 * We therefore read the property at class loading time and remember it's value. 42 42 */ 43 private static boolean JVM_WILL_USE_SYSTEM_PROXIES;43 private static boolean jvmWillUseSystemProxies; 44 44 static { 45 45 String v = System.getProperty("java.net.useSystemProxies"); 46 46 if (v != null && v.equals(Boolean.TRUE.toString())) { 47 JVM_WILL_USE_SYSTEM_PROXIES= true;47 jvmWillUseSystemProxies = true; 48 48 } 49 49 } … … 59 59 */ 60 60 public static boolean willJvmRetrieveSystemProxies() { 61 return JVM_WILL_USE_SYSTEM_PROXIES;61 return jvmWillUseSystemProxies; 62 62 } 63 63 … … 202 202 switch(proxyPolicy) { 203 203 case USE_SYSTEM_SETTINGS: 204 if (! JVM_WILL_USE_SYSTEM_PROXIES) {204 if (!jvmWillUseSystemProxies) { 205 205 Main.warn(tr("The JVM is not configured to lookup proxies from the system settings. "+ 206 206 "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 45 45 private final OsmDataLayer layer; 46 46 private final Projection projection; 47 private static final boolean skipEmptyNodes= true;47 private static final boolean SKIP_EMPTY_NODES = true; 48 48 49 49 /** … … 165 165 if (p.isIncomplete()) { 166 166 return; 167 } else if ( skipEmptyNodes&& p instanceof Node && p.getKeys().isEmpty()) {167 } else if (SKIP_EMPTY_NODES && p instanceof Node && p.getKeys().isEmpty()) { 168 168 return; 169 169 } -
trunk/src/org/openstreetmap/josm/io/OverpassDownloadReader.java
r11987 r12537 99 99 static final Pattern OUTPUT_FORMAT_STATEMENT = Pattern.compile(".*\\[out:([a-z]{3,})\\].*", Pattern.DOTALL); 100 100 101 static final Map<OverpassOutpoutFormat, Class<? extends AbstractReader>> outputFormatReaders= new ConcurrentHashMap<>();101 static final Map<OverpassOutpoutFormat, Class<? extends AbstractReader>> OUTPUT_FORMAT_READERS = new ConcurrentHashMap<>(); 102 102 103 103 final String overpassServer; … … 125 125 public static final Class<? extends AbstractReader> registerOverpassOutpoutFormatReader( 126 126 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)); 128 128 } 129 129 … … 232 232 Matcher m = OUTPUT_FORMAT_STATEMENT.matcher(overpassQuery); 233 233 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))); 235 235 if (readerClass != null) { 236 236 try { -
trunk/src/org/openstreetmap/josm/io/XmlWriter.java
r9828 r12537 62 62 String encS = null; 63 63 if (!keepApos || unencoded.charAt(i) != '\'') { 64 encS = XmlWriter.encoding.get(unencoded.charAt(i));64 encS = ENCODING.get(unencoded.charAt(i)); 65 65 } 66 66 if (encS != null) { … … 80 80 * The output writer to save the values to. 81 81 */ 82 private static final Map<Character, String> encoding= new HashMap<>();82 private static final Map<Character, String> ENCODING = new HashMap<>(); 83 83 static { 84 encoding.put('<', "<");85 encoding.put('>', ">");86 encoding.put('"', """);87 encoding.put('\'', "'");88 encoding.put('&', "&");89 encoding.put('\n', "
");90 encoding.put('\r', "
");91 encoding.put('\t', "	");84 ENCODING.put('<', "<"); 85 ENCODING.put('>', ">"); 86 ENCODING.put('"', """); 87 ENCODING.put('\'', "'"); 88 ENCODING.put('&', "&"); 89 ENCODING.put('\n', "
"); 90 ENCODING.put('\r', "
"); 91 ENCODING.put('\t', "	"); 92 92 } 93 93 -
trunk/src/org/openstreetmap/josm/io/remotecontrol/AddTagsDialog.java
r12523 r12537 51 51 52 52 private final String sender; 53 private static final Set<String> trustedSenders= new HashSet<>();53 private static final Set<String> TRUSTED_SENDERS = new HashSet<>(); 54 54 55 55 static final class PropertyTableModel extends DefaultTableModel { … … 227 227 tablePanel.add(propertyTable.getTableHeader(), GBC.eol().fill(GBC.HORIZONTAL)); 228 228 tablePanel.add(propertyTable, GBC.eol().fill(GBC.BOTH)); 229 if (!sender.isEmpty() && ! trustedSenders.contains(sender)) {229 if (!sender.isEmpty() && !TRUSTED_SENDERS.contains(sender)) { 230 230 final JCheckBox c = new JCheckBox(); 231 231 c.setAction(new AbstractAction(tr("Accept all tags from {0} for this session", sender)) { 232 232 @Override public void actionPerformed(ActionEvent e) { 233 233 if (c.isSelected()) 234 trustedSenders.add(sender);234 TRUSTED_SENDERS.add(sender); 235 235 else 236 trustedSenders.remove(sender);236 TRUSTED_SENDERS.remove(sender); 237 237 } 238 238 }); … … 263 263 } 264 264 if (buttonIndex == 2) { 265 trustedSenders.remove(sender);265 TRUSTED_SENDERS.remove(sender); 266 266 } 267 267 setVisible(false); … … 308 308 */ 309 309 public static void addTags(String[][] keyValue, String sender, Collection<? extends OsmPrimitive> primitives) { 310 if ( trustedSenders.contains(sender)) {310 if (TRUSTED_SENDERS.contains(sender)) { 311 311 if (Main.getLayerManager().getEditDataSet() != null) { 312 312 for (String[] row : keyValue) { -
trunk/src/org/openstreetmap/josm/io/session/SessionReader.java
r12489 r12537 147 147 } 148 148 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<>(); 150 150 151 151 private URI sessionFileURI; … … 174 174 */ 175 175 public static void registerSessionLayerImporter(String layerType, Class<? extends SessionLayerImporter> importer) { 176 sessionLayerImporters.put(layerType, importer);176 SESSION_LAYER_IMPORTERS.put(layerType, importer); 177 177 } 178 178 … … 183 183 */ 184 184 public static SessionLayerImporter getSessionLayerImporter(String layerType) { 185 Class<? extends SessionLayerImporter> importerClass = sessionLayerImporters.get(layerType);185 Class<? extends SessionLayerImporter> importerClass = SESSION_LAYER_IMPORTERS.get(layerType); 186 186 if (importerClass == null) 187 187 return null; -
trunk/src/org/openstreetmap/josm/tools/I18n.java
r10983 r12537 97 97 98 98 /* 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[] { 100 100 /* JFileChooser windows laf */ 101 101 "FileChooser.detailsViewActionLabelText", … … 691 691 JFileChooser.setDefaultLocale(l); 692 692 JColorChooser.setDefaultLocale(l); 693 for (String key : javaInternalMessageKeys) {693 for (String key : JAVA_INTERNAL_MESSAGE_KEYS) { 694 694 String us = UIManager.getString(key, Locale.US); 695 695 String loc = UIManager.getString(key, l); -
trunk/src/org/openstreetmap/josm/tools/PlatformHookOsx.java
r12279 r12537 31 31 public class PlatformHookOsx implements PlatformHook, InvocationHandler { 32 32 33 private static final PlatformHookOsx ivhandler= new PlatformHookOsx();33 private static final PlatformHookOsx INVOCATION_HANDLER = new PlatformHookOsx(); 34 34 35 35 private String oSBuildNumber; … … 59 59 Class<?> preferencesHandler = findHandlerClass("PreferencesHandler"); 60 60 Object proxy = Proxy.newProxyInstance(PlatformHookOsx.class.getClassLoader(), new Class<?>[] { 61 quitHandler, aboutHandler, openFilesHandler, preferencesHandler}, ivhandler);61 quitHandler, aboutHandler, openFilesHandler, preferencesHandler}, INVOCATION_HANDLER); 62 62 Object appli = eawtApplication.getConstructor((Class[]) null).newInstance((Object[]) null); 63 63 if (Utils.getJavaVersion() >= 9) {
Note:
See TracChangeset
for help on using the changeset viewer.