Changeset 16333 in josm for trunk/src/org/openstreetmap
- Timestamp:
- 2020-04-18T10:41:25+02:00 (5 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/validation/tests/Addresses.java
r15911 r16333 305 305 if (number != null) { 306 306 number = number.trim().toUpperCase(Locale.ENGLISH); 307 List<OsmPrimitive> list = map.get(number); 308 if (list == null) { 309 list = new ArrayList<>(); 310 map.put(number, list); 311 } 307 List<OsmPrimitive> list = map.computeIfAbsent(number, k -> new ArrayList<>()); 312 308 list.add(p); 313 309 } -
trunk/src/org/openstreetmap/josm/data/validation/tests/Highways.java
r15364 r16333 125 125 } 126 126 if (!link || !linkOk) { 127 List<Way> list = map.get(value); 128 if (list == null) { 129 list = new ArrayList<>(); 130 map.put(value, list); 131 } 127 List<Way> list = map.computeIfAbsent(value, k -> new ArrayList<>()); 132 128 list.add(h); 133 129 } -
trunk/src/org/openstreetmap/josm/data/validation/tests/MultipolygonTest.java
r16119 r16333 325 325 continue; // cannot be a problem node 326 326 } 327 List<Way> ways = nodeMap.get(n); 328 if (ways == null) { 329 ways = new ArrayList<>(); 330 nodeMap.put(n, ways); 331 } 327 List<Way> ways = nodeMap.computeIfAbsent(n, k -> new ArrayList<>()); 332 328 ways.add(rm.getWay()); 333 329 if (ways.size() > 2 || (ways.size() == 2 && i != 0 && i + 1 != numNodes)) { … … 563 559 boolean samePoly = false; 564 560 if (crossingPolys[0] != null && crossingPolys[1] != null) { 565 List<PolyData> crossingPolygons = problemPolygonMap.get(crossingPolys[0]); 566 if (crossingPolygons == null) { 567 crossingPolygons = new ArrayList<>(); 568 problemPolygonMap.put(crossingPolys[0], crossingPolygons); 569 } 561 List<PolyData> crossingPolygons = problemPolygonMap.computeIfAbsent(crossingPolys[0], k -> new ArrayList<>()); 570 562 crossingPolygons.add(crossingPolys[1]); 571 563 if (crossingPolys[0] == crossingPolys[1]) { -
trunk/src/org/openstreetmap/josm/gui/conflict/tags/TagConflictResolverModel.java
r12660 r16333 88 88 for (String key: tags.getKeys()) { 89 89 MultiValueResolutionDecision decision = new MultiValueResolutionDecision(tags.getTagsFor(key)); 90 if (decisions.get(key) == null) { 91 decisions.put(key, decision); 92 } 90 decisions.putIfAbsent(key, decision); 93 91 } 94 92 displayedKeys.clear(); … … 106 104 } 107 105 for (String key: tags.getKeys()) { 108 if (!decisions.get(key).isDecided() && !keys.contains(key)) {106 if (!decisions.get(key).isDecided()) { 109 107 keys.add(key); 110 108 } -
trunk/src/org/openstreetmap/josm/io/ValidatorErrorWriter.java
r16088 r16333 81 81 for (Entry<String, Map<String, List<TestError>>> e2 : e1.getValue().entrySet()) { 82 82 ErrorClass errorClass = new ErrorClass(e1.getKey(), e2.getKey()); 83 List<TestError> list = map.get(errorClass); 84 if (list == null) { 85 list = new ArrayList<>(); 86 map.put(errorClass, list); 87 } 83 List<TestError> list = map.computeIfAbsent(errorClass, k -> new ArrayList<>()); 88 84 e2.getValue().values().forEach(list::addAll); 89 85 }
Note:
See TracChangeset
for help on using the changeset viewer.