Changeset 4672 in josm for trunk


Ignore:
Timestamp:
2011-12-20T22:34:49+01:00 (13 years ago)
Author:
stoecker
Message:

fix #6727 - patch by Kalle Lampila - fix error with deleted objects

Location:
trunk/src/org/openstreetmap/josm
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/validation/TestError.java

    r4131 r4672  
    99import java.util.List;
    1010import java.util.TreeSet;
     11import java.util.ArrayList;
    1112
    1213import org.openstreetmap.josm.command.Command;
     
    122123
    123124    /**
     125     * Gets the list of primitives affected by this error and are selectable
     126     * @return the list of selectable primitives affected by this error
     127     */
     128    public Collection<? extends OsmPrimitive> getSelectablePrimitives() {
     129        List<OsmPrimitive> selectablePrimitives = new ArrayList<OsmPrimitive>(primitives.size());
     130        for (OsmPrimitive o : primitives) {
     131            if (o.isSelectable()) {
     132                selectablePrimitives.add(o);
     133            }
     134        }
     135        return selectablePrimitives;
     136    }
     137
     138
     139    /**
    124140     * Sets the list of primitives affected by this error
    125141     * @param primitives the list of primitives affected by this error
  • trunk/src/org/openstreetmap/josm/gui/dialogs/ValidatorDialog.java

    r4462 r4672  
    329329                if (nodeInfo instanceof TestError) {
    330330                    TestError error = (TestError) nodeInfo;
    331                     sel.addAll(error.getPrimitives());
     331                    sel.addAll(error.getSelectablePrimitives());
    332332                }
    333333            }
Note: See TracChangeset for help on using the changeset viewer.