- Timestamp:
- 2021-10-17T12:00:02+02:00 (3 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/validation/tests/TagChecker.java
r18277 r18281 545 545 */ 546 546 private static Set<String> getPresetValues(String key) { 547 Set<String> res = TaggingPresets.getPresetValues(key);548 if (!Utils.isEmpty(res))549 return res;547 if (TaggingPresets.isKeyInPresets(key)) { 548 return TaggingPresets.getPresetValues(key); 549 } 550 550 if (additionalPresetsValueData.contains(key)) 551 551 return Collections.emptySet(); … … 559 559 * @return {@code true} if the given key is in internal presets 560 560 * @since 9023 561 */ 561 * @deprecated Use {@link TaggingPresets#isKeyInPresets(String)} instead 562 */ 563 @Deprecated 562 564 public static boolean isKeyInPresets(String key) { 563 return !Utils.isEmpty(TaggingPresets.getPresetValues(key));565 return TaggingPresets.isKeyInPresets(key); 564 566 } 565 567 … … 883 885 return; 884 886 if (additionalPresetsValueData != null && !isTagIgnored(key, value)) { 885 if (! isKeyInPresets(key)) {887 if (!TaggingPresets.isKeyInPresets(key)) { 886 888 spellCheckKey(withErrors, p, key); 887 889 } else if (!isTagInPresets(key, value)) { … … 907 909 fixedKey = prettifiedKey; 908 910 } else { 909 fixedKey = isKeyInPresets(prettifiedKey) ? prettifiedKey : harmonizedKeys.get(prettifiedKey);911 fixedKey = TaggingPresets.isKeyInPresets(prettifiedKey) ? prettifiedKey : harmonizedKeys.get(prettifiedKey); 910 912 } 911 913 if (fixedKey == null && ignoreDataTag.stream().anyMatch(a -> a.getKey().equals(prettifiedKey))) { -
trunk/src/org/openstreetmap/josm/gui/tagging/presets/TaggingPresets.java
r18277 r18281 215 215 216 216 /** 217 * Determines if the given key is in the loaded presets. 218 * @param key key 219 * @return {@code true} if the given key in the loaded presets 220 * @since xxx 221 */ 222 public static boolean isKeyInPresets(String key) { 223 return PRESET_TAG_CACHE.get(key) != null; 224 } 225 226 /** 217 227 * Replies a new collection of all presets matching the parameters. 218 228 *
Note:
See TracChangeset
for help on using the changeset viewer.