Changeset 12537 in josm for trunk/src/org/openstreetmap/josm/gui/DefaultNameFormatter.java
- Timestamp:
- 2017-07-30T00:22:46+02:00 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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)
Note:
See TracChangeset
for help on using the changeset viewer.