Ignore:
Timestamp:
2009-10-11T23:06:32+02:00 (15 years ago)
Author:
jttt
Message:

Use OsmPrimitive.isNew() instead of getId() == 0

Location:
applications/editors/josm/plugins/validator
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/validator/build.xml

    r18069 r18092  
    2626                <attribute name="Plugin-Description" value="An OSM data validator. It checks for problems in data, and provides fixes for the common ones. Spellcheck integrated for tag names."/>
    2727                <attribute name="Plugin-Link" value="http://wiki.openstreetmap.org/index.php/JOSM/Plugins/Validator"/>
    28                 <attribute name="Plugin-Mainversion" value="2263"/>
     28                <attribute name="Plugin-Mainversion" value="2273"/>
    2929                <attribute name="Plugin-Version" value="${version.entry.commit.revision}"/>
    3030            </manifest>
  • applications/editors/josm/plugins/validator/src/org/openstreetmap/josm/plugins/validator/TestError.java

    r17479 r18092  
    153153        for (OsmPrimitive o : primitives) {
    154154            // ignore data not yet uploaded
    155             if (o.getId() == 0)
     155            if (o.isNew())
    156156                return null;
    157157            String type = "u";
  • applications/editors/josm/plugins/validator/src/org/openstreetmap/josm/plugins/validator/tests/DuplicateNode.java

    r17722 r18092  
    44
    55import java.awt.geom.Area;
    6 
    76import java.util.Collection;
    87import java.util.LinkedList;
     
    3130 */
    3231public class DuplicateNode extends Test{
    33        
     32
    3433        private static BackreferencedDataSet backreferences;
    35        
     34
    3635        public static BackreferencedDataSet getBackreferenceDataSet() {
    3736                if (backreferences == null) {
     
    4140                return backreferences;
    4241        }
    43        
     42
    4443        public static void clearBackreferences() {
    4544                backreferences = null;
    4645        }
    47        
     46
    4847    protected static int DUPLICATE_NODE = 1;
    4948
     
    132131        if (a != null) {
    133132            for (OsmPrimitive osm : del) {
    134                 if (osm instanceof Node && osm.getId() != 0) {
     133                if (osm instanceof Node && !osm.isNew()) {
    135134                    Node n = (Node) osm;
    136135                    if (!a.contains(n.getCoor())) {
  • applications/editors/josm/plugins/validator/src/org/openstreetmap/josm/plugins/validator/tests/DuplicateWay.java

    r17722 r18092  
    66import java.util.LinkedList;
    77import java.util.List;
     8import java.util.Map;
    89import java.util.Vector;
    9 import java.util.Map;
    1010
    1111import org.openstreetmap.josm.Main;
     
    1515import org.openstreetmap.josm.data.coor.LatLon;
    1616import org.openstreetmap.josm.data.osm.Node;
     17import org.openstreetmap.josm.data.osm.OsmPrimitive;
    1718import org.openstreetmap.josm.data.osm.Way;
    18 import org.openstreetmap.josm.data.osm.OsmPrimitive;
    1919import org.openstreetmap.josm.gui.progress.ProgressMonitor;
    2020import org.openstreetmap.josm.plugins.validator.Severity;
     
    120120        // or one "at random" if no such exists. Rest of the ways will be deleted
    121121        for (Way w: ways) {
    122             if (w.getId() > 0) {
     122            if (!w.isNew()) {
    123123                if (idToKeep == 0 || w.getId() < idToKeep) idToKeep = w.getId();
    124124            }
Note: See TracChangeset for help on using the changeset viewer.