Modify

Opened 13 months ago

Last modified 12 months ago

#7701 new defect

Warning in styles pref dialog for changing "Enable built-in icon defaults" (was: NPE)

Reported by: stoecker Owned by: team
Priority: normal Component: Core
Version: Keywords:
Cc:

Description

When attached prefs are used and data is downloaded an NPE is the result

Repository Root: http://josm.openstreetmap.de/svn
Build-Date: 2012-05-02 01:31:00
Last Changed Author: stoecker
Revision: 5210
Repository UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b
URL: http://josm.openstreetmap.de/svn/trunk
Last Changed Date: 2012-05-01 16:42:42 +0200 (Tue, 01 May 2012)
Last Changed Rev: 5210

Identification: JOSM/1.5 (5210 de)
Memory Usage: 109 MB / 910 MB (36 MB allocated, but free)
Java version: 1.6.0_24, Sun Microsystems Inc., OpenJDK 64-Bit Server VM
Operating system: Linux
Dataset consistency test: No problems found

Plugin: buildings_tools (27984)
Plugin: touchscreenhelper (27354)
Plugin: turnlanes (27927)

java.lang.NullPointerException
	at org.openstreetmap.josm.gui.mappaint.MapImage$1.finished(MapImage.java:67)
	at org.openstreetmap.josm.tools.ImageProvider.getInBackground(ImageProvider.java:287)
	at org.openstreetmap.josm.gui.mappaint.MapImage.getImage(MapImage.java:55)
	at org.openstreetmap.josm.gui.mappaint.NodeElemStyle.paintPrimitive(NodeElemStyle.java:237)
	at org.openstreetmap.josm.data.osm.visitor.paint.StyledMapRenderer$StyleCollector.drawAll(StyledMapRenderer.java:140)
	at org.openstreetmap.josm.data.osm.visitor.paint.StyledMapRenderer.render(StyledMapRenderer.java:233)
	at org.openstreetmap.josm.gui.layer.OsmDataLayer.paint(OsmDataLayer.java:280)
	at org.openstreetmap.josm.gui.MapView.paintLayer(MapView.java:455)
	at org.openstreetmap.josm.gui.MapView.paint(MapView.java:509)
	at javax.swing.JComponent.paintChildren(JComponent.java:866)
	at javax.swing.JComponent.paint(JComponent.java:1038)
	at javax.swing.JComponent.paintToOffscreen(JComponent.java:5138)
	at javax.swing.BufferStrategyPaintManager.paint(BufferStrategyPaintManager.java:302)
	at javax.swing.RepaintManager.paint(RepaintManager.java:1188)
	at javax.swing.JComponent._paintImmediately(JComponent.java:5086)
	at javax.swing.JComponent.paintImmediately(JComponent.java:4896)
	at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:783)
	at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:735)
	at javax.swing.RepaintManager.prePaintDirtyRegions(RepaintManager.java:677)
	at javax.swing.RepaintManager.access$700(RepaintManager.java:58)
	at javax.swing.RepaintManager$ProcessingRunnable.run(RepaintManager.java:1593)
	at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:226)
	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:647)
	at java.awt.EventQueue.access$000(EventQueue.java:96)
	at java.awt.EventQueue$1.run(EventQueue.java:608)
	at java.awt.EventQueue$1.run(EventQueue.java:606)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:105)
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:617)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:275)
	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:200)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:190)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:185)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:177)
	at java.awt.EventDispatchThread.run(EventDispatchThread.java:138)

Attachments (2)

preferences.xml (3.3 KB) - added by stoecker 13 months ago.
7701.patch (1.7 KB) - added by simon04 13 months ago.

Download all attachments as: .zip

Change History (11)

Changed 13 months ago by stoecker

comment:1 Changed 13 months ago by simon04

NPE is relatively easy to avoid, but I do not understand the problem:

Failed to locate image 'misc/landmark/power/tower_small.png' from dirs [], subdir '', zip 'null'
Failed to locate image 'misc/no_icon.png' from dirs [], subdir '', zip 'null'

Changed 13 months ago by simon04

comment:2 Changed 13 months ago by simon04

  • Summary changed from NPE to [Patch] NPE

comment:3 Changed 13 months ago by stoecker

Is mappaint.icon.enable-defaults=false the reason? In this case maybe we should at least print a warning, when a user disables that in preferences (and fix the NPE).

comment:4 Changed 13 months ago by simon04

With mappaint.icon.enable-defaults=true, it works nicely and loads tower_small.png as expected. What is the idea of disabling the default icons?

comment:5 Changed 13 months ago by stoecker

When you want to replace icons or completely choose another style this is necessary.

I think fix should be checked in and we should add a warning in prefs when this option is changed to false (must be somewhere in styles prefs tab).

comment:6 Changed 13 months ago by simon04

In 5257/josm:

see #7701 - NPE in MapImage

comment:7 follow-up: Changed 13 months ago by bastiK

  • Summary changed from [Patch] NPE to NPE

Why not closed?

comment:8 in reply to: ↑ 7 Changed 13 months ago by simon04

Replying to bastiK:

Why not closed?

The warning message in the pref dialog is not yet implemented.

comment:9 Changed 12 months ago by simon04

  • Summary changed from NPE to Warning in styles pref dialog for changing "Enable built-in icon defaults" (was: NPE)

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as new .
as The resolution will be set. Next status will be 'closed'.
to The owner will be changed from team. Next status will be 'new'.
Next status will be 'needinfo'.The owner will change to stoecker
as duplicate The resolution will be set to duplicate. Next status will be 'closed'.The specified ticket will be cross-referenced with this ticket
The owner will be changed from team to anonymous. Next status will be 'assigned'.
Author


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

 
Note: See TracTickets for help on using tickets.