Ticket #21438: 21438.patch

File 21438.patch, 1.7 KB (added by marcello@…, 3 years ago)

Patch

  • src/org/openstreetmap/josm/gui/tagging/presets/TaggingPresets.java

     
    204204    /**
    205205     * Return set of values for a key in the tagging presets
    206206     * @param key the key
    207      * @return set of values for a key in the tagging presets or null if none is found
     207     * @return set of values for a key in the tagging presets
    208208     */
    209209    public static Set<String> getPresetValues(String key) {
    210210        Set<String> values = PRESET_TAG_CACHE.get(key);
    211211        if (values != null)
    212212            return Collections.unmodifiableSet(values);
    213         return null;
     213        return Collections.emptySet();
    214214    }
    215215
    216216    /**
  • src/org/openstreetmap/josm/data/validation/tests/TagChecker.java

     
    545545     */
    546546    private static Set<String> getPresetValues(String key) {
    547547        Set<String> res = TaggingPresets.getPresetValues(key);
    548         if (res != null)
     548        if (!Utils.isEmpty(res))
    549549            return res;
    550550        if (additionalPresetsValueData.contains(key))
    551551            return Collections.emptySet();
     
    560560     * @since 9023
    561561     */
    562562    public static boolean isKeyInPresets(String key) {
    563         return TaggingPresets.getPresetValues(key) != null;
     563        return !Utils.isEmpty(TaggingPresets.getPresetValues(key));
    564564    }
    565565
    566566    /**