Modify

Opened 17 years ago

Closed 17 years ago

#392 closed defect (fixed)

NPE when merging

Reported by: Gabriel Ebner <ge@…> Owned by: framm
Priority: major Milestone:
Component: Core Version:
Keywords: Cc:

Description

I was downloading one bbox, then one overlapping with it and got an NPE. The nodes from the new bbox were merged, but some ways were missing afterwards. (Unfortunately I can't reproduce it anymore.)

download: http://www.openstreetmap.org/api/0.5/map?bbox=16.300458551651065,48.19654985374259,16.304897063136416,48.19915047919847
got return: 200
java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
        at org.openstreetmap.josm.gui.PleaseWaitRunnable.closeDialog(PleaseWaitRunnable.java:146)
        at org.openstreetmap.josm.gui.PleaseWaitRunnable.run(PleaseWaitRunnable.java:95)
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
        at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.reflect.InvocationTargetException
        at java.awt.EventQueue.invokeAndWait(EventQueue.java:997)
        at org.openstreetmap.josm.gui.PleaseWaitRunnable.closeDialog(PleaseWaitRunnable.java:142)
        ... 4 more
Caused by: java.lang.NullPointerException
        at java.util.regex.Matcher.getTextLength(Matcher.java:1140)
        at java.util.regex.Matcher.reset(Matcher.java:291)
        at java.util.regex.Matcher.<init>(Matcher.java:211)
        at java.util.regex.Pattern.matcher(Pattern.java:888)
        at org.openstreetmap.josm.tools.DateParser.parse(DateParser.java:35)
        at org.openstreetmap.josm.data.osm.OsmPrimitive.getTimestamp(OsmPrimitive.java:127)
        at org.openstreetmap.josm.data.osm.visitor.MergeVisitor.mergeAfterId(MergeVisitor.java:311)
        at org.openstreetmap.josm.data.osm.visitor.MergeVisitor.visit(MergeVisitor.java:91)
        at org.openstreetmap.josm.data.osm.Way.visit(Way.java:23)
        at org.openstreetmap.josm.gui.layer.OsmDataLayer.mergeFrom(OsmDataLayer.java:174)
        at org.openstreetmap.josm.actions.downloadtasks.DownloadOsmTask$Task.finish(DownloadOsmTask.java:49)
        at org.openstreetmap.josm.gui.PleaseWaitRunnable$4.run(PleaseWaitRunnable.java:128)
        at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:199)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
        at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
        at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
        at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:177)
        at java.awt.Dialog$1.run(Dialog.java:1039)
        at java.awt.Dialog$3.run(Dialog.java:1091)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.awt.Dialog.show(Dialog.java:1089)
        at java.awt.Component.show(Component.java:1419)
        at java.awt.Component.setVisible(Component.java:1372)
        at java.awt.Window.setVisible(Window.java:801)
        at java.awt.Dialog.setVisible(Dialog.java:979)
        at org.openstreetmap.josm.gui.PleaseWaitRunnable$3.run(PleaseWaitRunnable.java:78)
        at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
        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 (2)

tmp.osm (23.4 KB ) - added by Gabriel Ebner <ge@…> 17 years ago.
tmp.osm
tmp2.osm (48.6 KB ) - added by Gabriel Ebner <ge@…> 17 years ago.
tmp2.osm

Download all attachments as: .zip

Change History (6)

comment:1 by Gabriel Ebner <ge@…>, 17 years ago

Okay, I can reproduce this now. Loading tmp2.osm and tmp.osm, and then merging them triggers the NPE.

by Gabriel Ebner <ge@…>, 17 years ago

Attachment: tmp.osm added

tmp.osm

by Gabriel Ebner <ge@…>, 17 years ago

Attachment: tmp2.osm added

tmp2.osm

comment:2 by Gabriel Ebner <ge@…>, 17 years ago

Resolution: fixed
Status: newclosed

Arrgh. Why did I ever even think about removing code handling incomplete segments?

This is the second of these bugs (the first one was #385) that bites us because JOSM doesn't handle incomplete objects properly. I guess these bugs will be with us for a while. I'd better get used to it.

comment:3 by Gabriel Ebner <ge@…>, 17 years ago

Resolution: fixed
Status: closedreopened

Yeah, that wasn't the whole story. It still doesn't work. It just doesn't throw an NPE. Now we get an empty way...

I'll go to bed now. Fix will probably arrive tomorrow when I understand what the MergeVisitor is actually doing.

comment:4 by Gabriel Ebner <ge@…>, 17 years ago

Resolution: fixed
Status: reopenedclosed

I think I have fixed this now in r370.

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.