Ticket #20729: 20729-replace-isDrawable.patch

File 20729-replace-isDrawable.patch, 2.2 KB (added by GerdP, 3 years ago)

My proposal to fix the tests by replacing sDrawable() by more appropriate methods

  • src/org/openstreetmap/josm/data/osm/visitor/paint/relations/Multipolygon.java

     
    513513        for (RelationMember m : r.getMembers()) {
    514514            if (m.getMember().isIncomplete()) {
    515515                this.incomplete = true;
    516             } else if (m.getMember().isDrawable() && m.isWay()) {
     516            } else if (!m.getMember().isDeleted() && m.isWay()) {
    517517                Way w = m.getWay();
    518518
    519                 if (w.getNodesCount() < 2) {
     519                if (!w.hasOnlyLocatableNodes() || w.getNodesCount() < 2) {
    520520                    continue;
    521521                }
    522522
  • src/org/openstreetmap/josm/data/validation/tests/LongSegment.java

     
    135135
    136136    private static boolean isUsableNode(OsmPrimitive p) {
    137137        // test changed nodes - ways referred by them may not be checked automatically.
    138         return p instanceof Node && p.isDrawable();
     138        return p instanceof Node && ((Node) p).isLatLonKnown();
    139139    }
    140140
    141141    private static boolean isUsableWay(OsmPrimitive p) {
  • src/org/openstreetmap/josm/data/validation/tests/UnconnectedWays.java

     
    594594            }
    595595            Node a = w.getNode(i-1);
    596596            Node b = w.getNode(i);
    597             if (a.isDrawable() && b.isDrawable()) {
     597            if (a.isLatLonKnown() && b.isLatLonKnown()) {
    598598                MyWaySegment ws = new MyWaySegment(w, a, b, concersArea);
    599599                ret.add(ws);
    600600            }