Changeset 11536 in josm


Ignore:
Timestamp:
2017-02-04T15:26:23+01:00 (7 years ago)
Author:
Don-vip
Message:

sonar - fb-contrib:WOC_WRITE_ONLY_COLLECTION_FIELD - Correctness - Class creates and initializes a collection but never reads or gains information from it

File:
1 edited

Legend:

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

    r11396 r11536  
    119119
    120120    private final List<ToggleDialog> allDialogs = new ArrayList<>();
    121     private final List<MapMode> mapModes = new ArrayList<>();
    122121    private final List<IconToggleButton> allDialogButtons = new ArrayList<>();
    123122    public final List<IconToggleButton> allMapModeButtons = new ArrayList<>();
     
    388387
    389388    public void addMapMode(IconToggleButton b) {
    390         if (b.getAction() instanceof MapMode) {
    391             mapModes.add((MapMode) b.getAction());
    392         } else
     389        if (!(b.getAction() instanceof MapMode))
    393390            throw new IllegalArgumentException("MapMode action must be subclass of MapMode");
    394391        allMapModeButtons.add(b);
Note: See TracChangeset for help on using the changeset viewer.