- Timestamp:
- 2019-06-21T01:53:11+02:00 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/command/SplitWayCommand.java
r15078 r15186 43 43 private static volatile Consumer<String> warningNotifier = Logging::warn; 44 44 45 private static final class RelationInformation { 46 boolean warnme; 47 boolean insert; 48 Relation relation; 49 } 50 45 51 /** 46 52 * Sets the global warning notifier. … … 320 326 boolean insert = true; 321 327 if (relationSpecialTypes.containsKey(type) && "restriction".equals(relationSpecialTypes.get(type))) { 322 Map<String, Boolean> rValue = treatAsRestriction(r, rm, c, newWays, way, changedWay); 323 warnme = rValue.containsKey("warnme") ? rValue.get("warnme") : warnme; 324 insert = rValue.containsKey("insert") ? rValue.get("insert") : insert; 328 RelationInformation rValue = treatAsRestriction(r, rm, c, newWays, way, changedWay); 329 warnme = rValue.warnme; 330 insert = rValue.insert; 331 c = rValue.relation; 325 332 } else if (!("route".equals(type)) && !("multipolygon".equals(type))) { 326 333 warnme = true; … … 410 417 } 411 418 412 private static Map<String, Boolean>treatAsRestriction(Relation r,419 private static RelationInformation treatAsRestriction(Relation r, 413 420 RelationMember rm, Relation c, Collection<Way> newWays, Way way, 414 421 Way changedWay) { 415 HashMap<String, Boolean> rMap = new HashMap<>();422 RelationInformation relationInformation = new RelationInformation(); 416 423 /* this code assumes the restriction is correct. No real error checking done */ 417 424 String role = rm.getRole(); … … 448 455 c.addMember(new RelationMember(role, res)); 449 456 c.removeMembersFor(way); 450 r Map.put("insert", false);457 relationInformation.insert = false; 451 458 } 452 459 } else { 453 r Map.put("insert", false);460 relationInformation.insert = false; 454 461 } 455 462 } else if (!"via".equals(role)) { 456 rMap.put("warnme", true); 457 } 458 return rMap; 463 relationInformation.warnme = true; 464 } 465 relationInformation.relation = c; 466 return relationInformation; 459 467 } 460 468
Note:
See TracChangeset
for help on using the changeset viewer.