Ignore:
Timestamp:
2017-01-12T02:36:14+01:00 (7 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/data
Files:
3 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        }
Note: See TracChangeset for help on using the changeset viewer.