- Timestamp:
- 2021-02-22T13:59:25+01:00 (4 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/conflict/ConflictCollection.java
r15832 r17524 11 11 import java.util.Set; 12 12 import java.util.concurrent.CopyOnWriteArrayList; 13 import java.util.function.Predicate; 13 14 import java.util.stream.Collectors; 14 15 … … 344 345 } 345 346 347 /** 348 * Returns the number of conflicts involving nodes. 349 * @return The number of conflicts involving nodes. 350 * @since 17524 351 */ 352 public final long getNumberOfNodeConflicts() { 353 return getNumberOfConflicts(c -> c.getMy() instanceof Node); 354 } 355 356 /** 357 * Returns the number of conflicts involving nodes. 358 * @return The number of conflicts involving nodes. 359 * @since 17524 360 */ 361 public final long getNumberOfWayConflicts() { 362 return getNumberOfConflicts(c -> c.getMy() instanceof Way); 363 } 364 365 /** 366 * Returns the number of conflicts involving nodes. 367 * @return The number of conflicts involving nodes. 368 * @since 17524 369 */ 370 public final long getNumberOfRelationConflicts() { 371 return getNumberOfConflicts(c -> c.getMy() instanceof Relation); 372 } 373 374 private long getNumberOfConflicts(Predicate<Conflict<?>> predicate) { 375 return conflicts.isEmpty() ? 0 : conflicts.stream().filter(Objects::nonNull).filter(predicate).count(); 376 } 377 346 378 @Override 347 379 public int hashCode() { -
trunk/src/org/openstreetmap/josm/gui/dialogs/ConflictDialog.java
r17340 r17524 238 238 setTitle(trn("Conflict: {0} unresolved", "Conflicts: {0} unresolved", conflictsCount, conflictsCount) + 239 239 " ("+tr("Rel.:{0} / Ways:{1} / Nodes:{2}", 240 conflicts.get RelationConflicts().size(),241 conflicts.get WayConflicts().size(),242 conflicts.getN odeConflicts().size())+')');240 conflicts.getNumberOfRelationConflicts(), 241 conflicts.getNumberOfWayConflicts(), 242 conflicts.getNumberOfNodeConflicts())+')'); 243 243 } else { 244 244 setTitle(tr("Conflict"));
Note:
See TracChangeset
for help on using the changeset viewer.