- Timestamp:
- 2016-11-23T23:39:40+01:00 (8 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/validation/TestError.java
r11235 r11298 3 3 4 4 import java.text.MessageFormat; 5 import java.util.ArrayList;6 5 import java.util.Arrays; 7 6 import java.util.Collection; … … 381 380 382 381 /** 383 * Gets the list of primitives affected by this error and are selectable384 * @return the list of selectable primitives affected by this error385 */386 public Collection<? extends OsmPrimitive> getSelectablePrimitives() {387 List<OsmPrimitive> selectablePrimitives = new ArrayList<>(primitives.size());388 for (OsmPrimitive o : primitives) {389 if (o.isSelectable()) {390 selectablePrimitives.add(o);391 }392 }393 return selectablePrimitives;394 }395 396 /**397 382 * Sets the list of primitives affected by this error 398 383 * @param primitives the list of primitives affected by this error* -
trunk/src/org/openstreetmap/josm/gui/dialogs/ValidatorDialog.java
r10880 r11298 337 337 if (nodeInfo instanceof TestError) { 338 338 TestError error = (TestError) nodeInfo; 339 sel.addAll(error.getSelectablePrimitives()); 339 error.getPrimitives().stream() 340 .filter(OsmPrimitive::isSelectable) 341 .forEach(sel::add); 340 342 } 341 343 } … … 388 390 hasFixes = hasFixes || error.isFixable(); 389 391 if (addSelected) { 390 sel.addAll(error.getSelectablePrimitives()); 392 error.getPrimitives().stream() 393 .filter(OsmPrimitive::isSelectable) 394 .forEach(sel::add); 391 395 } 392 396 }
Note:
See TracChangeset
for help on using the changeset viewer.