Ticket #24075: 24075.KeyedItem_MatchType#ofString.patch

File 24075.KeyedItem_MatchType#ofString.patch, 1.2 KB (added by taylor.smock, 15 months ago)

KeyedItem.MatchType#ofString only

  • src/org/openstreetmap/josm/gui/tagging/presets/items/KeyedItem.java

    Subject: [PATCH] #24075: KeyedItem.MatchType#ofString
    ---
    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
    diff --git a/src/org/openstreetmap/josm/gui/tagging/presets/items/KeyedItem.java b/src/org/openstreetmap/josm/gui/tagging/presets/items/KeyedItem.java
    a b  
    7878        /** Positive if key and value matches, negative otherwise. */
    7979        KEY_VALUE_REQUIRED("keyvalue!");
    8080
     81        private static final MatchType[] VALUES = values();
     82
    8183        private final String value;
    8284
    8385        MatchType(String value) {
     
    98100         * @return the {@code MatchType} for the given textual value
    99101         */
    100102        public static MatchType ofString(String type) {
    101             for (MatchType i : EnumSet.allOf(MatchType.class)) {
     103            for (MatchType i : VALUES) {
    102104                if (i.getValue().equals(type))
    103105                    return i;
    104106            }