Opened 10 years ago

Closed 10 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:


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

	at org.openstreetmap.josm.gui.preferences.ColorPreference.setColorModel(
	at org.openstreetmap.josm.gui.preferences.ColorPreference.addGui(
	at org.openstreetmap.josm.gui.preferences.PreferenceDialog.<init>(
	at org.openstreetmap.josm.actions.PreferencesAction.actionPerformed(
	at javax.swing.AbstractButton.fireActionPerformed(
	at javax.swing.AbstractButton$Handler.actionPerformed(
	at javax.swing.DefaultButtonModel.fireActionPerformed(
	at javax.swing.DefaultButtonModel.setPressed(
	at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(
	at java.awt.AWTEventMulticaster.mouseReleased(
	at java.awt.Component.processMouseEvent(
	at javax.swing.JComponent.processMouseEvent(
	at java.awt.Component.processEvent(
	at java.awt.Container.processEvent(
	at java.awt.Component.dispatchEventImpl(
	at java.awt.Container.dispatchEventImpl(
	at java.awt.Component.dispatchEvent(
	at java.awt.LightweightDispatcher.retargetMouseEvent(
	at java.awt.LightweightDispatcher.processMouseEvent(
	at java.awt.LightweightDispatcher.dispatchEvent(
	at java.awt.Container.dispatchEventImpl(
	at java.awt.Window.dispatchEventImpl(
	at java.awt.Component.dispatchEvent(
	at java.awt.EventQueue.dispatchEvent(
	at java.awt.EventDispatchThread.pumpOneEventForFilters(
	at java.awt.EventDispatchThread.pumpEventsForFilter(
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(
	at java.awt.EventDispatchThread.pumpEvents(
	at java.awt.EventDispatchThread.pumpEvents(

Attachments (0)

Change History (3)

comment:1 Changed 10 years ago by anonymous

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 Changed 10 years ago by anonymous

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 Changed 10 years ago by anonymous

Resolution: fixed
Status: newclosed

Should be fixed in r1224.

Modify Ticket

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