Opened 18 years ago
Closed 18 years ago
#385 closed defect (fixed)
NPE when loading relations pointing to missing nodes.
Reported by: | Owned by: | ||
---|---|---|---|
Priority: | major | Milestone: | |
Component: | Core | Version: | |
Keywords: | Cc: |
Description
JOSM shows the error-message "Unexpected Exception" when I try to download the following area:
http://www.openstreetmap.org/index.html?mlat=49.929192&mlon=8.598929&zoom=14
Other areas, for example the next village eastern of this, can be downloaded and displayed correctly. The last thing I have done before the error appeared was editing a bus-route followed by a restart of JOSM, because of a recurring "Error 500" while trying to upload the data.
The JOSM bug-report:
Path: josm URL: http://www.openstreetmap.de/svn/josm Repository Root: http://www.openstreetmap.de/svn/josm Repository UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b Revision: 352 Node Kind: directory Last Changed Author: gebner Last Changed Rev: 352 Last Changed Date: 2007-10-08 00:04:33 +0200 (Mon, 08 Oct 2007) java.lang.NullPointerException at org.openstreetmap.josm.gui.NavigatableComponent.getPoint(NavigatableComponent.java:108) at org.openstreetmap.josm.data.osm.visitor.SimplePaintVisitor.drawNode(SimplePaintVisitor.java:164) at org.openstreetmap.josm.data.osm.visitor.SimplePaintVisitor.visit(SimplePaintVisitor.java:102) at org.openstreetmap.josm.data.osm.Node.visit(Node.java:41) at org.openstreetmap.josm.data.osm.visitor.SimplePaintVisitor.visitAll(SimplePaintVisitor.java:81) at org.openstreetmap.josm.gui.layer.OsmDataLayer.paint(OsmDataLayer.java:158) at org.openstreetmap.josm.gui.MapView.paint(MapView.java:182) at javax.swing.JComponent.paintChildren(JComponent.java:843) at javax.swing.JComponent.paint(JComponent.java:1015) at javax.swing.JComponent.paintWithOffscreenBuffer(JComponent.java:4972) at javax.swing.JComponent.paintDoubleBuffered(JComponent.java:4925) at javax.swing.JComponent._paintImmediately(JComponent.java:4868) at javax.swing.JComponent.paintImmediately(JComponent.java:4675) at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:451) at javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(SystemEventQueueUtilities.java:114) at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209) at java.awt.EventQueue.dispatchEvent(EventQueue.java:461) at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149) at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
Attachments (0)
Change History (1)
comment:1 by , 18 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Summary: | Error: Unexpected Exception → NPE when loading relations pointing to missing nodes. |
This was caused by an incomplete relation (the nodes with roles stop_5 and stop_7 are not present in the response of the API):
When I added the remove-segments stuff to JOSM, I actually expected incomplete objects to go away -- they were things from the dark past, and we didn't need them as of API 0.4 as no incomplete ways were returned from the API back then. That was before we decided to do relations and remove-segments in one go. However, with relations this has changed. As relations can be linked to each other they could theoretically (and probably soon really) cause a bbox request to return the whole world if it were to return no incomplete relations.
So I guess we'll have to live with incomplete objects. Back in API 0.3 only segments could be incomplete (just ids with no tags, from or to attributes) and ways could be another kind of incomplete if they referenced incomplete segments.
But now we have to deal with incomplete ways, relations and also nodes. To the best of my knowledge, JOSM was never confronted with handling incomplete nodes (even though nodes had an incomplete attribute), so these are code paths that never got quite exercised. And it was precisely an incomplete node that you stumbled upon.
Fixed in r357.