Modify

Opened 16 years ago

Closed 16 years ago

#1998 closed defect (fixed)

New color code gives NPE when preference dialog button is pressed

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

Description

r1223 has broken color preferences handling. The following error occurs
when trying to pop up the preferences dialog.

Manifest-Version: 1.0
Ant-Version: Apache Ant 1.7.0
Created-By: 10.0-b23 (Sun Microsystems Inc.)
Main-class: JOSM
Main-Version: 1223 SVN
Main-Date: 2009-01-09T10:43:50.381413Z

Plugins: DirectUpload;namefinder;openvisible;slippy_map_chooser;utilsplugin;validator;waypoints;wmsplugin
Plugin DirectUpload Version: 12601
Plugin namefinder Version: 12598
Plugin openvisible Version: 12588
Plugin slippy_map_chooser Version: 12598
Plugin utilsplugin Version: 12677
Plugin validator Version: 12780
Plugin waypoints Version: 12598
Plugin wmsplugin Version: 12609

java.lang.NullPointerException
	at org.openstreetmap.josm.tools.ColorHelper.html2color(ColorHelper.java:12)
	at org.openstreetmap.josm.gui.preferences.ColorPreference.setColorModel(ColorPreference.java:76)
	at org.openstreetmap.josm.gui.preferences.ColorPreference.addGui(ColorPreference.java:102)
	at org.openstreetmap.josm.gui.preferences.PreferenceDialog.<init>(PreferenceDialog.java:111)
	at org.openstreetmap.josm.actions.PreferencesAction.actionPerformed(PreferencesAction.java:39)
	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.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236)
	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 (0)

Change History (3)

comment:1 by anonymous, 16 years ago

More info - this problem appears to occur when I have loaded a gpx file that
contains tracks and way points. If I don't load this file, the prefs dialog
will pop up OK. After I have loaded the gpx file, pressing the prefs button
gives the NPE.

comment:2 by anonymous, 16 years ago

More info - setColorModel() is being passed a map that contains an entry with a key
of "layer Markers from gps.gpx" (where gps.gpx is the name of the gpx file that was loaded) and a value of null. Here's some diagnostic output from within setColorModel():

colorMap[background] = #FFFFFF
colorMap[conflict] = #808080
colorMap[gps marker] = #808080
colorMap[gps point] = #808080
colorMap[inactive] = #404040
colorMap[incomplete way] = #000060
colorMap[layer Markers from gps.gpx] = null

comment:3 by anonymous, 16 years ago

Resolution: fixed
Status: newclosed

Should be fixed in r1224.

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.