Modify

Opened 16 years ago

Closed 16 years ago

#3407 closed defect (fixed)

NPE in ConflictDialog when using OpenStreetBug plugin

Reported by: Dennis Owned by: team
Priority: normal Milestone:
Component: Plugin Version: latest
Keywords: osb core Cc:

Description

Wenn JOSM einen Openstreetbug geladen hat und ich diesen rechts in der Liste anklicke, kommt folgendender Programmfehler:

Path: trunk
URL: http://josm.openstreetmap.de/svn/trunk
Repository Root: http://josm.openstreetmap.de/svn
Repository UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b
Revision: 2052
Node Kind: directory
Last Changed Author: stoecker
Last Changed Rev: 2052
Last Changed Date: 2009-09-04 17:30:13 +0200 (Fri, 04 Sep 2009)

Memory Usage: 101 MB / 1016 MB (39 MB allocated, but free)
Java version: 1.6.0_15

Plugins: DirectUploadeditgpxgraphviewopenstreetbugsplastic_lafremotecontrolutilspluginvalidator
Plugin plastic_laf Version: 14016
Plugin DirectUpload Version: 17401
Plugin editgpx Version: 17369
Plugin graphview Version: 17371
Plugin openstreetbugs Version: 17404
Plugin remotecontrol Version: 16836
Plugin utilsplugin Version: 17437
Plugin validator Version: 17352

java.lang.NullPointerException

at org.openstreetmap.josm.plugins.osb.gui.OsbDialog.valueChanged(OsbDialog.java:224)
at javax.swing.JList.fireSelectionValueChanged(Unknown Source)
at javax.swing.JList$ListSelectionHandler.valueChanged(Unknown Source)
at javax.swing.DefaultListSelectionModel.fireValueChanged(Unknown Source)
at javax.swing.DefaultListSelectionModel.fireValueChanged(Unknown Source)
at javax.swing.DefaultListSelectionModel.setValueIsAdjusting(Unknown Source)
at javax.swing.JList.setValueIsAdjusting(Unknown Source)
at javax.swing.plaf.basic.BasicListUI$Handler.mouseReleased(Unknown Source)
at java.awt.AWTEventMulticaster.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.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 (2)

osb_npe_and_warnings.patch (5.0 KB ) - added by xeen 16 years ago.
osb_npe_and_warnings.2.patch (5.4 KB ) - added by xeen 16 years ago.
Now with less useless whitespace

Download all attachments as: .zip

Change History (11)

by xeen, 16 years ago

Attachment: osb_npe_and_warnings.patch added

comment:1 by xeen, 16 years ago

Summary: Plugin Openstreetpugs - Programmfehler[PATCH] Plugin Openstreetpugs - Programmfehler
  • Fix NPE
  • Remove deprecated calls
  • Fix selection border not drawn exactly around the icon

by xeen, 16 years ago

Now with less useless whitespace

comment:2 by stoecker, 16 years ago

Resolution: fixed
Status: newclosed

In [o17520].

comment:3 by anonymous, 16 years ago

Resolution: fixed
Status: closedreopened

Der Fehler ist in der Version 2094 von heute wieder da...

Path: trunk
URL: http://josm.openstreetmap.de/svn/trunk
Repository Root: http://josm.openstreetmap.de/svn
Repository UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b
Revision: 2094
Node Kind: directory
Last Changed Author: Gubaer
Last Changed Rev: 2094
Last Changed Date: 2009-09-11 10:24:41 +0200 (Fri, 11 Sep 2009)

Memory Usage: 113 MB / 1016 MB (18 MB allocated, but free)
Java version: 1.6.0_15

Plugins: DirectUpload
editgpx
graphview
openstreetbugs
plastic_laf
remotecontrol
slippymap
utilsplugin
validator
wmsplugin
Plugin plastic_laf Version: 14016
Plugin DirectUpload Version: 17532
Plugin editgpx Version: 17530
Plugin graphview Version: 17538
Plugin openstreetbugs Version: 17534
Plugin remotecontrol Version: 17457
Plugin slippymap Version: 17433
Plugin utilsplugin Version: 17550
Plugin validator Version: 17540
Plugin wmsplugin Version: 17556

java.lang.NullPointerException

at org.openstreetmap.josm.gui.dialogs.ConflictDialog.selectionChanged(ConflictDialog.java:254)
at org.openstreetmap.josm.data.osm.DataSet.fireSelectionChanged(DataSet.java:245)
at org.openstreetmap.josm.data.osm.DataSet.setSelected(DataSet.java:193)
at org.openstreetmap.josm.plugins.osb.gui.OsbDialog.valueChanged(OsbDialog.java:230)
at javax.swing.JList.fireSelectionValueChanged(Unknown Source)
at javax.swing.JList$ListSelectionHandler.valueChanged(Unknown Source)
at javax.swing.DefaultListSelectionModel.fireValueChanged(Unknown Source)
at javax.swing.DefaultListSelectionModel.fireValueChanged(Unknown Source)
at javax.swing.DefaultListSelectionModel.fireValueChanged(Unknown Source)
at javax.swing.DefaultListSelectionModel.changeSelection(Unknown Source)
at javax.swing.DefaultListSelectionModel.changeSelection(Unknown Source)
at javax.swing.DefaultListSelectionModel.setSelectionInterval(Unknown Source)
at javax.swing.JList.setSelectionInterval(Unknown Source)
at javax.swing.plaf.basic.BasicListUI$Handler.adjustSelection(Unknown Source)
at javax.swing.plaf.basic.BasicListUI$Handler.mousePressed(Unknown Source)
at java.awt.AWTEventMulticaster.mousePressed(Unknown Source)
at java.awt.AWTEventMulticaster.mousePressed(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.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)

comment:4 by Gubaer, 16 years ago

Keywords: osb core added
Summary: [PATCH] Plugin Openstreetpugs - ProgrammfehlerNPE in ConflictDialog when using OpenStreetBug plugin
Version: latest

Ist zwar wieder eine NPE, sieht vom Stacktrace her aber eher nach einem neuen Fehler aus.

comment:5 by xeen, 16 years ago

How to reproduce? I can surely fix it by a nullcheck, but finding the source would be better.

comment:6 by anonymous, 16 years ago

The offending lines would be:

        DataSet ds = Main.main.getCurrentDataSet();
        if (fireSelectionChanged) {
            if(ds == null)
                ds = new DataSet();
            ds.setSelected(selected);
        }

I have no idea why I placed the getCurrentDataSet outside the if, but it seems to me that an empty ds will cause the ConflictDialog to NPE. You can test that when the OSB layer is the only one and there is no data layer.

Offending code there is:

if (conflicts.hasConflictForMy(osm)) {

whereas osm is a member of the <selected> from above, so it's probably not null, and even if shouldn't cause any problems. Gubaer, you're more familiar with conflict-code, when is the <conflict> variable created…? It seems to me it has never been initialized…

comment:7 by anonymous, 16 years ago

You can test that when the OSB layer is the only one and there is no data layer.

Tatsache, wenn ich nur nen GPX-File lade dann tritt der Fehler auf.

Habe ich nen Datenlayer tritt der Fehler nicht mehr auf.

comment:8 by Gubaer, 16 years ago

(In [2131]) see #3407: NPE in ConflictDialog when using OpenStreetBug plugin

comment:9 by Gubaer, 16 years ago

Resolution: fixed
Status: reopenedclosed

It's initialized when the active layer changes to an OsmDataLayer.

I've fixed the NPE you reported - and another one which might have popped up in the future.

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.