Modify

Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#8635 closed defect (fixed)

NPE in measurement plugin

Reported by: rickmastfan67 Owned by: team
Priority: major Milestone:
Component: Plugin measurement Version: latest
Keywords: Cc:

Description

Steps to reproduce:

  1. Have the "reverter" plugin installed (if you don't, install and restart and then continue to Step 2).
  2. History > Revert Changeset
  3. Revert the following changeset: 9728028
  4. Once the changeset has been reverted (ignore the conflicts), hit "Ctrl-A" to select everything.

What happens:
The Measurement plugin crashes with a NPE.

What should happen:
No NPE.

Repository Root: http://josm.openstreetmap.de/svn
Build-Date: 2013-04-26 01:34:33
Last Changed Author: Don-vip
Revision: 5904
Repository UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b
URL: http://josm.openstreetmap.de/svn/trunk
Last Changed Date: 2013-04-26 00:35:45 +0200 (Fri, 26 Apr 2013)
Last Changed Rev: 5904

Identification: JOSM/1.5 (5904 en) Windows 7 64-Bit
Memory Usage: 182 MB / 2730 MB (141 MB allocated, but free)
Java version: 1.7.0_21, Oracle Corporation, Java HotSpot(TM) 64-Bit Server VM
VM arguments: [-Xmx3072M]
Dataset consistency test: No problems found

Plugin: ImageryCache (29484)
Plugin: OpeningHoursEditor (29435)
Plugin: buildings_tools (29435)
Plugin: mapdust (29525)
Plugin: measurement (29534)
Plugin: mirrored_download (29505)
Plugin: openstreetbugs (29435)
Plugin: osmarender (29435)
Plugin: reverter (29503)
Plugin: turnrestrictions (29435)
Plugin: undelete (29538)
Plugin: utilsplugin2 (29435)

java.lang.NullPointerException
	at org.openstreetmap.josm.data.coor.LatLon.greatCircleDistance(LatLon.java:231)
	at org.openstreetmap.josm.plugins.measurement.MeasurementDialog.selectionChanged(MeasurementDialog.java:139)
	at org.openstreetmap.josm.data.osm.DataSet.fireSelectionChanged(DataSet.java:430)
	at org.openstreetmap.josm.data.osm.DataSet.setSelected(DataSet.java:603)
	at org.openstreetmap.josm.data.osm.DataSet.setSelected(DataSet.java:614)
	at org.openstreetmap.josm.actions.SelectAllAction.actionPerformed(SelectAllAction.java:23)
	at javax.swing.SwingUtilities.notifyAction(Unknown Source)
	at javax.swing.JComponent.processKeyBinding(Unknown Source)
	at javax.swing.KeyboardManager.fireBinding(Unknown Source)
	at javax.swing.KeyboardManager.fireKeyboardAction(Unknown Source)
	at javax.swing.JComponent.processKeyBindingsForAllComponents(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.pumpEventsForHierarchy(Unknown Source)
	at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
	at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
	at java.awt.EventDispatchThread.run(Unknown Source)

Attachments (0)

Change History (7)

comment:1 Changed 6 years ago by Don-vip

Component: Plugin measurementCore

The underlying cause is in core because we allow to create nodes without coordinates that are seen as complete. Plugin code is correct by assuming complete nodes have non-null coordinates. The fix may break even more the reverter plugin, but maybe we'll finally fix it once for good.

comment:2 Changed 6 years ago by Don-vip

Resolution: fixed
Status: newclosed

In 5914/josm:

fix #8635 - Consider nodes without coordinates as incomplete

comment:3 in reply to:  1 Changed 6 years ago by rickmastfan67

Replying to Don-vip:

The underlying cause is in core because we allow to create nodes without coordinates that are seen as complete. Plugin code is correct by assuming complete nodes have non-null coordinates. The fix may break even more the reverter plugin, but maybe we'll finally fix it once for good.

Yeah, the fix did break the reverter plugin. :( I've just reported that separately as bug #8646.

comment:4 Changed 6 years ago by Don-vip

Component: CorePlugin measurement
Resolution: fixed
Status: closedreopened

Mmm it's not that simple, coordinates should be checked as well.

comment:5 Changed 6 years ago by Don-vip

In 5919/josm:

see #8635 - correct management of incomplete nodes

comment:6 Changed 6 years ago by Don-vip

Resolution: fixed
Status: reopenedclosed

Fixed in [o29545].

comment:7 Changed 6 years ago by Don-vip

Ticket #7404 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.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.