Changeset 11461 in josm


Ignore:
Timestamp:
2017-01-12T02:36:14+01:00 (8 years ago)
Author:
Don-vip
Message:

sonar - fb-contrib:SPP_USE_CONTAINSKEY - Style - Method calls keySet() just to call contains, use containsKey instead

Location:
trunk/src/org/openstreetmap/josm
Files:
5 edited

Legend:

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

    r11452 r11461  
    15841584        if (setting instanceof MapListSetting) {
    15851585            List<Map<String, String>> l = new ArrayList<>(((MapListSetting) setting).getValue());
    1586             if (l.stream().noneMatch(x -> x.values().contains(url))) {
     1586            if (l.stream().noneMatch(x -> x.containsValue(url))) {
    15871587                RulePrefHelper helper = ValidatorTagCheckerRulesPreference.RulePrefHelper.INSTANCE;
    15881588                Optional<ExtendedSourceEntry> val = helper.getDefault().stream().filter(x -> url.equals(x.url)).findFirst();
  • trunk/src/org/openstreetmap/josm/data/osm/visitor/MergeSourceBuildingVisitor.java

    r10134 r11461  
    5555
    5656    protected boolean isAlreadyRemembered(OsmPrimitive primitive) {
    57         return mappedPrimitives.keySet().contains(primitive);
     57        return mappedPrimitives.containsKey(primitive);
    5858    }
    5959
  • trunk/src/org/openstreetmap/josm/data/preferences/MapListSetting.java

    r11394 r11461  
    4141            throw new IllegalArgumentException("Error: Null as list element in preference setting");
    4242        for (Map<String, String> map : value) {
    43             if (map.keySet().contains(null))
     43            if (map.containsKey(null))
    4444                throw new IllegalArgumentException("Error: Null as map key in preference setting");
    45             if (map.values().contains(null))
     45            if (map.containsValue(null))
    4646                throw new IllegalArgumentException("Error: Null as map value in preference setting");
    4747        }
  • trunk/src/org/openstreetmap/josm/gui/dialogs/relation/RelationDialogManager.java

    r10345 r11461  
    150150        if (relation == null) return false;
    151151        DialogContext context = new DialogContext(layer, relation);
    152         return openDialogs.keySet().contains(context);
    153 
     152        return openDialogs.containsKey(context);
    154153    }
    155154
  • trunk/src/org/openstreetmap/josm/gui/history/HistoryBrowserDialogManager.java

    r11366 r11461  
    8888
    8989    private void show(long id, HistoryBrowserDialog dialog) {
    90         if (dialogs.values().contains(dialog)) {
     90        if (dialogs.containsValue(dialog)) {
    9191            show(id);
    9292        } else {
     
    9898
    9999    private void show(long id) {
    100         if (dialogs.keySet().contains(id)) {
     100        if (dialogs.containsKey(id)) {
    101101            dialogs.get(id).toFront();
    102102        }
Note: See TracChangeset for help on using the changeset viewer.