Modify

Opened 7 years ago

Closed 5 years ago

#7701 closed defect (fixed)

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

Reported by: stoecker Owned by: team
Priority: normal Milestone:
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 7 years ago.
7701.patch (1.7 KB) - added by simon04 7 years ago.

Download all attachments as: .zip

Change History (13)

Changed 7 years ago by stoecker

Attachment: preferences.xml added

comment:1 Changed 7 years 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 7 years ago by simon04

Attachment: 7701.patch added

comment:2 Changed 7 years ago by simon04

Summary: NPE[Patch] NPE

comment:3 Changed 7 years 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 7 years 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 7 years 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 7 years ago by simon04

In 5257/josm:

see #7701 - NPE in MapImage

comment:7 Changed 7 years ago by bastiK

Summary: [Patch] NPENPE

Why not closed?

comment:8 in reply to:  7 Changed 7 years ago by simon04

Replying to bastiK:

Why not closed?

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

comment:9 Changed 7 years ago by simon04

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

comment:10 Changed 6 years ago by Don-vip

This option should also only be displayed in Expert mode.

comment:11 Changed 5 years ago by stoecker

Resolution: fixed
Status: newclosed

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.