Ignore:
Timestamp:
2016-02-06T14:52:34+01:00 (5 years ago)
Author:
bastiK
Message:

applied #12438 - hide items from list of recently added tags (patch by kolesar; minor changes)

Location:
trunk/src/org/openstreetmap/josm/data/preferences
Files:
1 added
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/preferences/ParametrizedEnumProperty.java

    r9689 r9743  
    66public abstract class ParametrizedEnumProperty<T extends Enum<T>> {
    77
    8     private final T defaultValue;
    9     private final Class<T> enumClass;
     8    protected final T defaultValue;
     9    protected final Class<T> enumClass;
    1010
    1111    public ParametrizedEnumProperty(Class<T> enumClass, T defaultValue) {
    1212        this.defaultValue = defaultValue;
    1313        this.enumClass = enumClass;
    14         if (Main.pref != null) {
    15             get();
    16         }
    1714    }
    1815
     
    2825
    2926    protected T parse(String s) {
    30         return Enum.valueOf(enumClass, s);
     27        try {
     28            return Enum.valueOf(enumClass, s);
     29        } catch (IllegalArgumentException e) {
     30            return defaultValue;
     31        }
    3132    }
    3233}
Note: See TracChangeset for help on using the changeset viewer.