Ignore:
Timestamp:
2017-09-14T02:25:27+02:00 (2 years ago)
Author:
bastiK
Message:

see #15229 - include support for the long type in IPreferences

File:
1 edited

Legend:

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

    r12851 r12853  
    585585     * @return {@code true}, if something has changed (i.e. value is different than before)
    586586     * @see LongProperty#put(Long)
    587      */
     587     * @deprecated use {@link IPreferences#putLong(java.lang.String, long)}
     588     */
     589    @Deprecated
    588590    public boolean putLong(final String key, final Long value) {
    589591        return put(key, Long.toString(value));
     
    961963
    962964    /**
    963      * Gets a long preference
    964      * @param key The preference key
    965      * @param def The default value to use
    966      * @return The long value or the default value if it could not be parsed
    967      * @see LongProperty#get()
    968      */
    969     public synchronized long getLong(String key, long def) {
    970         String v = get(key, Long.toString(def));
    971         if (null == v)
    972             return def;
    973 
    974         try {
    975             return Long.parseLong(v);
    976         } catch (NumberFormatException e) {
    977             // fall out
    978             Logging.trace(e);
    979         }
    980         return def;
    981     }
    982 
    983     /**
    984965     * Get a list of values for a certain key
    985966     * @param key the identifier for the setting
Note: See TracChangeset for help on using the changeset viewer.