Changeset 2838 in osm for applications/editors/josm/plugins/validator/src/org
- Timestamp:
- 2007-05-08T16:11:53+02:00 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/validator/src/org/openstreetmap/josm/plugins/validator/tests/UnorderedWay.java
r2591 r2838 3 3 import static org.openstreetmap.josm.tools.I18n.tr; 4 4 5 import java.util.*;6 7 5 import org.openstreetmap.josm.actions.ReorderAction; 8 import org.openstreetmap.josm.command.*; 9 import org.openstreetmap.josm.data.osm.OsmPrimitive; 10 import org.openstreetmap.josm.data.osm.Segment; 11 import org.openstreetmap.josm.data.osm.Way; 12 import org.openstreetmap.josm.plugins.validator.Severity; 13 import org.openstreetmap.josm.plugins.validator.Test; 14 import org.openstreetmap.josm.plugins.validator.TestError; 6 import org.openstreetmap.josm.command.Command; 7 import org.openstreetmap.josm.data.osm.*; 8 import org.openstreetmap.josm.plugins.validator.*; 15 9 16 10 /** … … 48 42 public Command fixError(TestError testError) 49 43 { 50 List<Command> commands = new ArrayList<Command>(50);51 52 44 for(OsmPrimitive p : testError.getPrimitives() ) 53 45 { 54 Way w = (Way)p; 55 Way newWay = new Way(w); 56 newWay.segments.clear(); 57 newWay.segments.addAll(ReorderAction.sortSegments(new HashSet<Segment>(w.segments))); 58 return new ChangeCommand(p, newWay); 46 return ReorderAction.reorderWay((Way)p); 59 47 } 60 48 61 return commands.size() > 1 ? new SequenceCommand("Remove keys", commands) : commands.get(0);49 return null; 62 50 } 63 51
Note:
See TracChangeset
for help on using the changeset viewer.