Changeset 3253 in josm


Ignore:
Timestamp:
2010-05-15T19:59:15+02:00 (10 years ago)
Author:
jttt
Message:

See #3892: NPE when dragging virtual node (further debugging info)

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

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/command/MoveCommand.java

    r3187 r3253  
    9595                throw new AssertionError("null detected in node list");
    9696            if (n.getEastNorth() == null)
    97                 throw new AssertionError("unexpected null value for n.getEastNorth(). id of n is " + n.getUniqueId());
     97                throw new AssertionError(n.get3892DebugInfo());
    9898
    9999            n.setEastNorth(n.getEastNorth().add(x, y));
  • trunk/src/org/openstreetmap/josm/data/coor/CachedLatLon.java

    r3083 r3253  
    4747        return "CachedLatLon[lat="+lat()+",lon="+lon()+"]";
    4848    }
     49
     50    // Only for Node.get3892DebugInfo()
     51    public Projection getProjection() {
     52        return proj;
     53    }
    4954}
  • trunk/src/org/openstreetmap/josm/data/osm/Node.java

    r3180 r3253  
    198198        return (OsmPrimitive.getFilteredList(getReferrers(), Way.class)).size() > 1;
    199199    }
     200
     201    public String get3892DebugInfo() {
     202        StringBuilder builder = new StringBuilder();
     203        builder.append("Unexpected error. Please report it to http://josm.openstreetmap.de/ticket/3892\n");
     204        builder.append(toString());
     205        builder.append("\n");
     206        if (coor == null) {
     207            builder.append("Coor is null\n");
     208        } else {
     209            builder.append(String.format("EastNorth: %s\n", coor.getEastNorth()));
     210            builder.append(coor.getProjection());
     211            builder.append("\n");
     212        }
     213
     214        return builder.toString();
     215    }
    200216}
Note: See TracChangeset for help on using the changeset viewer.