| 1 | ### Eclipse Workspace Patch 1.0
|
|---|
| 2 | #P JOSM
|
|---|
| 3 | Index: src/org/openstreetmap/josm/data/validation/tests/DuplicateRelation.java
|
|---|
| 4 | ===================================================================
|
|---|
| 5 | --- src/org/openstreetmap/josm/data/validation/tests/DuplicateRelation.java (revision 4229)
|
|---|
| 6 | +++ src/org/openstreetmap/josm/data/validation/tests/DuplicateRelation.java (working copy)
|
|---|
| 7 | @@ -6,13 +6,11 @@
|
|---|
| 8 | import java.util.ArrayList;
|
|---|
| 9 | import java.util.Collection;
|
|---|
| 10 | import java.util.HashSet;
|
|---|
| 11 | -import java.util.LinkedList;
|
|---|
| 12 | import java.util.LinkedHashSet;
|
|---|
| 13 | +import java.util.LinkedList;
|
|---|
| 14 | import java.util.List;
|
|---|
| 15 | import java.util.Map;
|
|---|
| 16 | -import java.util.Vector;
|
|---|
| 17 |
|
|---|
| 18 | -import org.openstreetmap.josm.Main;
|
|---|
| 19 | import org.openstreetmap.josm.command.ChangeCommand;
|
|---|
| 20 | import org.openstreetmap.josm.command.Command;
|
|---|
| 21 | import org.openstreetmap.josm.command.DeleteCommand;
|
|---|
| 22 | @@ -24,10 +22,10 @@
|
|---|
| 23 | import org.openstreetmap.josm.data.osm.Relation;
|
|---|
| 24 | import org.openstreetmap.josm.data.osm.RelationMember;
|
|---|
| 25 | import org.openstreetmap.josm.data.osm.Way;
|
|---|
| 26 | -import org.openstreetmap.josm.gui.progress.ProgressMonitor;
|
|---|
| 27 | import org.openstreetmap.josm.data.validation.Severity;
|
|---|
| 28 | import org.openstreetmap.josm.data.validation.Test;
|
|---|
| 29 | import org.openstreetmap.josm.data.validation.TestError;
|
|---|
| 30 | +import org.openstreetmap.josm.gui.progress.ProgressMonitor;
|
|---|
| 31 | import org.openstreetmap.josm.tools.MultiMap;
|
|---|
| 32 | /**
|
|---|
| 33 | * Tests if there are duplicate relations
|
|---|
| 34 | @@ -137,15 +135,15 @@
|
|---|
| 35 | */
|
|---|
| 36 | public DuplicateRelation()
|
|---|
| 37 | {
|
|---|
| 38 | - super(tr("Duplicated relations")+".",
|
|---|
| 39 | - tr("This test checks that there are no relations with same tags and same members with same roles."));
|
|---|
| 40 | + super(tr("Duplicated relations."),
|
|---|
| 41 | + tr("This test checks that there are no relations with same tags and same members with same roles."));
|
|---|
| 42 | }
|
|---|
| 43 |
|
|---|
| 44 |
|
|---|
| 45 | @Override
|
|---|
| 46 | public void startTest(ProgressMonitor monitor)
|
|---|
| 47 | {
|
|---|
| 48 | - super.startTest(monitor);
|
|---|
| 49 | + super.startTest(monitor);
|
|---|
| 50 | relations = new MultiMap<RelationPair, OsmPrimitive>(1000);
|
|---|
| 51 | relations_nokeys = new MultiMap<List<RelationMember>, OsmPrimitive>(1000);
|
|---|
| 52 | }
|
|---|
| 53 | @@ -153,7 +151,7 @@
|
|---|
| 54 | @Override
|
|---|
| 55 | public void endTest()
|
|---|
| 56 | {
|
|---|
| 57 | - super.endTest();
|
|---|
| 58 | + super.endTest();
|
|---|
| 59 | for(LinkedHashSet<OsmPrimitive> duplicated : relations.values() )
|
|---|
| 60 | {
|
|---|
| 61 | if( duplicated.size() > 1)
|
|---|
| 62 | @@ -198,8 +196,9 @@
|
|---|
| 63 | HashSet<Relation> rel_fix = new HashSet<Relation>();
|
|---|
| 64 |
|
|---|
| 65 | for (OsmPrimitive osm : sel)
|
|---|
| 66 | - if (osm instanceof Relation)
|
|---|
| 67 | + if (osm instanceof Relation) {
|
|---|
| 68 | rel_fix.add((Relation)osm);
|
|---|
| 69 | + }
|
|---|
| 70 |
|
|---|
| 71 | if( rel_fix.size() < 2 )
|
|---|
| 72 | return null;
|
|---|
| 73 | @@ -265,8 +264,9 @@
|
|---|
| 74 | HashSet<Relation> relations = new HashSet<Relation>();
|
|---|
| 75 |
|
|---|
| 76 | for (OsmPrimitive osm : sel)
|
|---|
| 77 | - if (osm instanceof Relation)
|
|---|
| 78 | + if (osm instanceof Relation) {
|
|---|
| 79 | relations.add((Relation)osm);
|
|---|
| 80 | + }
|
|---|
| 81 |
|
|---|
| 82 | if (relations.size() < 2)
|
|---|
| 83 | return false;
|
|---|