Modify

Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#8945 closed defect (fixed)

[patch] OSM link paste in JOSM download map does not work anymore (NPE)

Reported by: maarten Owned by: team
Priority: major Milestone:
Component: Core Version: latest
Keywords: Cc:

Description

OSM has changed the way links from the map look. They now look like http://www.openstreetmap.org/#map=11/51.9413/5.5632
JOSM does not recognize that format when you paste it on the slippy map in the download screen.

Attachments (3)

osmURLtoBoundsPatch.diff (1.8 KB ) - added by peter.wendorff@… 11 years ago.
patch dazu
8945-test.patch (5.0 KB ) - added by AlfonZ 11 years ago.
Unit test for OsmUrlToBounds.parse()
8945-note.patch (7.2 KB ) - added by AlfonZ 11 years ago.
Fix with (updated) test

Download all attachments as: .zip

Change History (15)

comment:1 by Don-vip, 11 years ago

Type: defectenhancement

by peter.wendorff@…, 11 years ago

Attachment: osmURLtoBoundsPatch.diff added

patch dazu

comment:2 by framm, 11 years ago

Resolution: fixed
Status: newclosed

In 6118/josm:

apply patch by Peter Wendorff. closes #8945

comment:3 by bastiK, 11 years ago

The URL given in the description causes a NPE.

@framm: Please note that we are in the hot phase of the release process. If you must commit something now, you should be confident, that it doesn't beak anything...

comment:4 by SammysHP, 11 years ago

There's also a debug print in line 89.

comment:5 by anonymous, 11 years ago

Fixed the bug, and the debug print, in r6119

comment:6 by rickmastfan67, 11 years ago

Priority: normalcritical
Resolution: fixed
Status: closedreopened
Summary: OSM link paste in JOSM download map does not work anymoreOSM link paste in JOSM download map does not work anymore (NPE)
Type: enhancementdefect
Version: testedlatest

The NPE is still there. Just notice this when I tried to download an area. The NPE doesn't pop up an error message, only noticed it via the command line window.

This happened when using an URL that had a "note" in it.
http://www.openstreetmap.org/?note=26325#map=18/40.86215/-75.75020&layers=N

java.lang.NullPointerException
        at sun.misc.FloatingDecimal.readJavaFormatString(Unknown Source)
        at java.lang.Double.parseDouble(Unknown Source)
        at org.openstreetmap.josm.tools.OsmUrlToBounds.parseDouble(OsmUrlToBounds.java:108)
        at org.openstreetmap.josm.tools.OsmUrlToBounds.parse(OsmUrlToBounds.java:64)
        at org.openstreetmap.josm.gui.download.BoundingBoxSelection.parseURL(BoundingBoxSelection.java:153)
        at org.openstreetmap.josm.gui.download.BoundingBoxSelection.access$200(BoundingBoxSelection.java:42)
        at org.openstreetmap.josm.gui.download.BoundingBoxSelection$OsmUrlRefresher.insertUpdate(BoundingBoxSelection.java:271)
        at javax.swing.text.AbstractDocument.fireInsertUpdate(Unknown Source)
        at javax.swing.text.AbstractDocument.handleInsertString(Unknown Source)
        at javax.swing.text.AbstractDocument.insertString(Unknown Source)
        at javax.swing.text.PlainDocument.insertString(Unknown Source)
        at javax.swing.text.AbstractDocument.replace(Unknown Source)
        at javax.swing.text.JTextComponent.replaceSelection(Unknown Source)
        at javax.swing.plaf.basic.BasicTextUI$TextTransferHandler.handleReaderImport(Unknown Source)
        at javax.swing.plaf.basic.BasicTextUI$TextTransferHandler.importData(Unknown Source)
        at javax.swing.TransferHandler.importData(Unknown Source)
        at javax.swing.plaf.basic.BasicTextUI$TextTransferHandler.importData(Unknown Source)
        at javax.swing.TransferHandler$TransferAction.actionPerformedImpl(Unknown Source)
        at javax.swing.TransferHandler$TransferAction.access$700(Unknown Source)
        at javax.swing.TransferHandler$TransferAction$1.run(Unknown Source)
        at javax.swing.TransferHandler$TransferAction$1.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
        at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
        at javax.swing.TransferHandler$TransferAction$2.run(Unknown Source)
        at javax.swing.TransferHandler$TransferAction$2.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
        at javax.swing.TransferHandler$TransferAction.actionPerformed(Unknown Source)
        at javax.swing.text.JTextComponent.invokeAction(Unknown Source)
        at javax.swing.text.JTextComponent.paste(Unknown Source)
        at javax.swing.text.DefaultEditorKit$PasteAction.actionPerformed(Unknown Source)
        at javax.swing.SwingUtilities.notifyAction(Unknown Source)
        at javax.swing.JComponent.processKeyBinding(Unknown Source)
        at javax.swing.JComponent.processKeyBindings(Unknown Source)
        at javax.swing.JComponent.processKeyEvent(Unknown Source)
        at java.awt.Component.processEvent(Unknown Source)
        at java.awt.Container.processEvent(Unknown Source)
        at java.awt.Component.dispatchEventImpl(Unknown Source)
        at java.awt.Container.dispatchEventImpl(Unknown Source)
        at java.awt.Component.dispatchEvent(Unknown Source)
        at java.awt.KeyboardFocusManager.redispatchEvent(Unknown Source)
        at java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(Unknown Source)
        at java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(Unknown Source)
        at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(Unknown Source)
        at java.awt.DefaultKeyboardFocusManager.dispatchEvent(Unknown Source)
        at java.awt.Component.dispatchEventImpl(Unknown Source)
        at java.awt.Container.dispatchEventImpl(Unknown Source)
        at java.awt.Window.dispatchEventImpl(Unknown Source)
        at java.awt.Component.dispatchEvent(Unknown Source)
        at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
        at java.awt.EventQueue.access$200(Unknown Source)
        at java.awt.EventQueue$3.run(Unknown Source)
        at java.awt.EventQueue$3.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
        at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
        at java.awt.EventQueue$4.run(Unknown Source)
        at java.awt.EventQueue$4.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
        at java.awt.EventQueue.dispatchEvent(Unknown Source)
        at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
        at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
        at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
        at java.awt.WaitDispatchSupport$2.run(Unknown Source)
        at java.awt.WaitDispatchSupport$4.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.awt.WaitDispatchSupport.enter(Unknown Source)
        at java.awt.Dialog.show(Unknown Source)
        at java.awt.Component.show(Unknown Source)
        at java.awt.Component.setVisible(Unknown Source)
        at java.awt.Window.setVisible(Unknown Source)
        at java.awt.Dialog.setVisible(Unknown Source)
        at org.openstreetmap.josm.gui.download.DownloadDialog.setVisible(DownloadDialog.java:374)
        at org.openstreetmap.josm.actions.DownloadAction.actionPerformed(DownloadAction.java:38)
        at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
        at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
        at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
        at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
        at javax.swing.AbstractButton.doClick(Unknown Source)
        at javax.swing.plaf.basic.BasicMenuItemUI.doClick(Unknown Source)
        at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(Unknown Source)
        at java.awt.AWTEventMulticaster.mouseReleased(Unknown Source)
        at java.awt.Component.processMouseEvent(Unknown Source)
        at javax.swing.JComponent.processMouseEvent(Unknown Source)
        at java.awt.Component.processEvent(Unknown Source)
        at java.awt.Container.processEvent(Unknown Source)
        at java.awt.Component.dispatchEventImpl(Unknown Source)
        at java.awt.Container.dispatchEventImpl(Unknown Source)
        at java.awt.Component.dispatchEvent(Unknown Source)
        at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
        at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
        at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
        at java.awt.Container.dispatchEventImpl(Unknown Source)
        at java.awt.Window.dispatchEventImpl(Unknown Source)
        at java.awt.Component.dispatchEvent(Unknown Source)
        at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
        at java.awt.EventQueue.access$200(Unknown Source)
        at java.awt.EventQueue$3.run(Unknown Source)
        at java.awt.EventQueue$3.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
        at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
        at java.awt.EventQueue$4.run(Unknown Source)
        at java.awt.EventQueue$4.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
        at java.awt.EventQueue.dispatchEvent(Unknown Source)
        at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
        at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
        at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
        at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
        at java.awt.EventDispatchThread.run(Unknown Source)
Repository Root: http://josm.openstreetmap.de/svn
Build-Date: 2013-08-15 01:35:02
Last Changed Author: bastiK
Revision: 6150
Repository UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b
URL: http://josm.openstreetmap.de/svn/trunk
Last Changed Date: 2013-08-14 16:23:33 +0200 (Wed, 14 Aug 2013)
Last Changed Rev: 6150

Identification: JOSM/1.5 (6150 en) Windows 7 64-Bit
Memory Usage: 218 MB / 1820 MB (174 MB allocated, but free)
Java version: 1.7.0_25, Oracle Corporation, Java HotSpot(TM) 64-Bit Server VM
VM arguments: [-Xmx2048M]

Plugin: ImageryCache (29690)
Plugin: OpeningHoursEditor (29778)
Plugin: buildings_tools (29778)
Plugin: mapdust (29525)
Plugin: measurement (29750)
Plugin: mirrored_download (29753)
Plugin: openstreetbugs (29435)
Plugin: osmarender (29639)
Plugin: reverter (29771)
Plugin: turnrestrictions (29435)
Plugin: undelete (29555)
Plugin: utilsplugin2 (29771)
Last edited 11 years ago by rickmastfan67 (previous) (diff)

comment:7 by rickmastfan67, 11 years ago

Priority: criticalmajor

by AlfonZ, 11 years ago

Attachment: 8945-test.patch added

Unit test for OsmUrlToBounds.parse()

comment:8 by AlfonZ, 11 years ago

Unit test for this.
OsmUrlToBounds.positionToBounds was throwing HeadlessException when run from ant, due to java.awt.headless being set to true. This is just a quick fix, it may need a proper one.
List of supported URLs may need enhancing.

comment:9 by AlfonZ, 11 years ago

Summary: OSM link paste in JOSM download map does not work anymore (NPE)[patch] OSM link paste in JOSM download map does not work anymore (NPE)

patch attached.

by AlfonZ, 11 years ago

Attachment: 8945-note.patch added

Fix with (updated) test

comment:10 by bastiK, 11 years ago

Resolution: fixed
Status: reopenedclosed

In 6155/josm:

fixed #8945 - another NPE + unit test (patch by AlfonZ)

comment:11 by bastiK, 11 years ago

Thanks!

comment:12 by AlfonZ, 11 years ago

Ticket #8988 has been marked as a duplicate of this ticket.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain team.
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.