Modify

Opened 16 years ago

Closed 16 years ago

#1532 closed defect (fixed)

JOSM NullPointerException on GPX import in r943

Reported by: anonymous Owned by: framm
Priority: major Milestone:
Component: unspecified Version:
Keywords: Cc:

Description

  1. Start JOSM
  2. Open a GPX file, I tried several but I've attached one that produces the error for completeness
  3. Get NullPointerException error

Development version. Unknown revision.
java.lang.NullPointerException

at org.openstreetmap.josm.gui.layer.markerlayer.MarkerLayer.<init>(MarkerLayer.java:85)
at org.openstreetmap.josm.actions.OpenAction.openFileAsGpx(OpenAction.java:97)
at org.openstreetmap.josm.actions.OpenAction.openFile(OpenAction.java:58)
at org.openstreetmap.josm.actions.OpenAction.actionPerformed(OpenAction.java:49)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
at javax.swing.AbstractButton.doClick(AbstractButton.java:357)
at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:1220)
at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:1261)
at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:272)
at java.awt.Component.processMouseEvent(Component.java:6041)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3265)
at java.awt.Component.processEvent(Component.java:5806)
at java.awt.Container.processEvent(Container.java:2058)
at java.awt.Component.dispatchEventImpl(Component.java:4413)
at java.awt.Container.dispatchEventImpl(Container.java:2116)
at java.awt.Component.dispatchEvent(Component.java:4243)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4322)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3986)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3916)
at java.awt.Container.dispatchEventImpl(Container.java:2102)
at java.awt.Window.dispatchEventImpl(Window.java:2440)
at java.awt.Component.dispatchEvent(Component.java:4243)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)

Attachments (3)

waypoint.gpx (213.8 KB ) - added by anonymous 16 years ago.
MarkerLayer.java.patch (1.3 KB ) - added by avarab@… 16 years ago.
Check whether wpt.attr.containsKey("link") before iterating over the wpt.attr.get("link") Collection
MarkerLayer.java.2.patch (1.2 KB ) - added by avarab@… 16 years ago.
FIXED PATCH: Check whether wpt.attr.containsKey("link") before iterating over the wpt.attr.get("link") Collection

Download all attachments as: .zip

Change History (6)

by anonymous, 16 years ago

Attachment: waypoint.gpx added

comment:1 by avarab@…, 16 years ago

This also has the effect of GPX waypoints not being displayed in the UI, the revision that broke it is r941:942 and the problem is that there was code added that presumes that all GPX waypoints contain a <link> element

The following patch fixes it:

by avarab@…, 16 years ago

Attachment: MarkerLayer.java.patch added

Check whether wpt.attr.containsKey("link") before iterating over the wpt.attr.get("link") Collection

by avarab@…, 16 years ago

Attachment: MarkerLayer.java.2.patch added

FIXED PATCH: Check whether wpt.attr.containsKey("link") before iterating over the wpt.attr.get("link") Collection

comment:2 by avarab@…, 16 years ago

The first patch I submitted was a broken work in progress, the second one works.

comment:3 by anonymous, 16 years ago

Resolution: fixed
Status: newclosed

Fixed in r944.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain framm.
as The resolution will be set.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.