Changeset 12403 in josm


Ignore:
Timestamp:
2017-06-12T00:19:19+02:00 (7 years ago)
Author:
Don-vip
Message:

see #14929 - findbugs

Location:
trunk/src/org/openstreetmap/josm/gui/autofilter
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/autofilter/AutoFilterManager.java

    r12401 r12403  
    5858     * Property to determines if the auto filter feature is enabled.
    5959     */
    60     public static BooleanProperty PROP_AUTO_FILTER_ENABLED = new BooleanProperty("auto.filter.enabled", Boolean.TRUE);
     60    public static final BooleanProperty PROP_AUTO_FILTER_ENABLED = new BooleanProperty("auto.filter.enabled", Boolean.TRUE);
    6161
    6262    /**
    6363     * Property to determine the current auto filter rule.
    6464     */
    65     public static StringProperty PROP_AUTO_FILTER_RULE = new StringProperty("auto.filter.rule", "level");
     65    public static final StringProperty PROP_AUTO_FILTER_RULE = new StringProperty("auto.filter.rule", "level");
    6666
    6767    /**
    6868     * The unique instance.
    6969     */
    70     private static AutoFilterManager instance;
     70    private static volatile AutoFilterManager instance;
    7171
    7272    /**
     
    319319     * @return the currently selected auto filter, or null
    320320     */
    321     public AutoFilter getCurrentAutoFilter() {
     321    public synchronized AutoFilter getCurrentAutoFilter() {
    322322        return currentAutoFilter;
    323323    }
  • trunk/src/org/openstreetmap/josm/gui/autofilter/AutoFilterRule.java

    r12400 r12403  
    2121    private Function<String, String> valueFormatter = s -> s;
    2222
    23     private Comparator<String> valueComparator = Comparator.comparingInt(s -> Integer.valueOf(valueFormatter.apply(s)));
     23    private Comparator<String> valueComparator = Comparator.comparingInt(s -> Integer.parseInt(valueFormatter.apply(s)));
    2424
    2525    /**
     
    9999            new AutoFilterRule("voltage", 5)
    100100                .setValueFormatter(s -> s.replaceAll("000$", "k") + 'V')
    101                 .setValueComparator(Comparator.comparingInt(s -> Integer.valueOf(s)))
     101                .setValueComparator(Comparator.comparingInt(s -> Integer.parseInt(s)))
    102102        };
    103103    }
Note: See TracChangeset for help on using the changeset viewer.