﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
12225	Uninstalling ImproveOSM Plugin cause NPE	mdk	jBeata	"==== What steps will reproduce the problem?
1. Install ImproveOSM plugin (actual version 18) and restart (as required)
2. Download any area (see the 3 new layers for this plugin)
3. Uninstall ImproveOSM plugin and try to restart (as required)

==== What is the expected result?
JOSM restarts

==== What happens instead?
NullPointerException (see below)

==== Please provide any additional information below. Attach a screenshot if possible.
In the terminal after pressing restart and the NPE I get:
{{{
INFO: Registered toolbar action save_as-session overwritten: org.openstreetmap.josm.actions.SessionSaveAsAction gets org.openstreetmap.josm.gui.io.SaveLayersDialog$SaveSessionAction
[INFO] ElementEventQueue - Element event queue destroyed: org.apache.commons.jcs.engine.control.event.ElementEventQueue@1bafb20
[INFO] CompositeCache - In DISPOSE, [TMS] fromRemote [false]
[INFO] CompositeCache - In DISPOSE, [TMS] auxiliary [TMS]
[INFO] CompositeCache - In DISPOSE, [TMS] put 0 into auxiliary TMS
[INFO] AbstractDiskCache - No longer waiting for event queue to finish: Cache Event Queue
Working = true
Alive = false
Empty = true
Size = 0
[INFO] AbstractDiskCache - In dispose, destroying event queue.
[INFO] CacheEventQueue - Destroy was called after queue was destroyed.  Doing nothing.  Stats =  Cache Event Queue
Working = true
Alive = false
Empty = true
Size = 0
[INFO] BlockDiskKeyStore - Region [TMS] Saving keys to [/home/michael/.josm-latest/cache/tiles/TMS.key], key count [50]
[INFO] BlockDiskKeyStore - Region [TMS] Finished saving keys. It took 4ms. to store 50 keys.  Key file length [4838]
[INFO] BlockDiskCache - Region [TMS] Shutdown complete.
[INFO] CompositeCache - In DISPOSE, [TMS] disposing of memory cache.
[INFO] AbstractMemoryCache - Memory Cache dispose called.
[INFO] CompositeCache - In DISPOSE, [mapillary] fromRemote [false]
[INFO] CompositeCache - In DISPOSE, [mapillary] auxiliary [mapillary]
[INFO] CompositeCache - In DISPOSE, [mapillary] put 0 into auxiliary mapillary
[INFO] AbstractDiskCache - No longer waiting for event queue to finish: Cache Event Queue
Working = true
Alive = false
Empty = true
Size = 0
[INFO] AbstractDiskCache - In dispose, destroying event queue.
[INFO] CacheEventQueue - Destroy was called after queue was destroyed.  Doing nothing.  Stats =  Cache Event Queue
Working = true
Alive = false
Empty = true
Size = 0
[INFO] BlockDiskKeyStore - Region [mapillary] Saving keys to [/home/michael/.josm-latest/plugins/Mapillary/cache/mapillary.key], key count [0]
[INFO] BlockDiskKeyStore - Region [mapillary] Finished saving keys. It took 1ms. to store 0 keys.  Key file length [4]
[INFO] BlockDiskCache - Region [mapillary] Shutdown complete.
[INFO] CompositeCache - In DISPOSE, [mapillary] disposing of memory cache.
[INFO] AbstractMemoryCache - Memory Cache dispose called.
ERROR: java.lang.NullPointerException
java.lang.NullPointerException
	at org.openstreetmap.josm.plugins.improveosm.ImproveOsmPlugin.layerRemoved(ImproveOsmPlugin.java:157)

}}}

BTW: Missing component ""Plugin improveOSM"" in ticket system.

{{{
URL:http://josm.openstreetmap.de/svn/trunk
Repository:UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b
Last:Changed Date: 2015-12-19 23:49:39 +0100 (Sat, 19 Dec 2015)
Build-Date:2015-12-20 02:32:30
Revision:9140
Relative:URL: ^/trunk

Identification: JOSM/1.5 (9140 en) Linux Ubuntu 15.10
Memory Usage: 392 MB / 876 MB (223 MB allocated, but free)
Java version: 1.7.0_91, Oracle Corporation, OpenJDK Server VM
Java package: openjdk-7-jre:i386-7u91-2.6.3-0ubuntu0.15.10.1
VM arguments: [-Djosm.restart=true, -Djosm.home=/home/michael/.josm-latest, -Djava.net.useSystemProxies=true]

Plugins:
- ColumbusCSV (31772)
- FastDraw (31772)
- HouseNumberTaggingTool (31772)
- ImproveOsm (18)
- Mapillary (31802)
- OpeningHoursEditor (31772)
- RoadSigns (31772)
- SimplifyArea (31772)
- apache-commons (31772)
- apache-http (31772)
- buildings_tools (31772)
- contourmerge (1014)
- imagery-xml-bounds (31772)
- imagery_offset_db (31772)
- pbf (31772)
- poly (31772)
- public_transport (31772)
- reltoolbox (31772)
- reverter (31772)
- terracer (31772)
- turnrestrictions (31772)
- utilsplugin2 (31772)

Last errors/warnings:
- E: java.lang.NullPointerException

java.lang.NullPointerException
	at org.openstreetmap.josm.plugins.improveosm.ImproveOsmPlugin.layerRemoved(ImproveOsmPlugin.java:157)
	at org.openstreetmap.josm.gui.MapView.fireLayerRemoved(MapView.java:216)
	at org.openstreetmap.josm.gui.MapView.removeLayer(MapView.java:519)
	at org.openstreetmap.josm.Main.removeLayer(Main.java:531)
	at org.openstreetmap.josm.Main.exitJosm(Main.java:1087)
	at org.openstreetmap.josm.actions.RestartAction.actionPerformed(RestartAction.java:59)
	at org.openstreetmap.josm.gui.preferences.PreferenceTabbedPane$PluginDownloadAfterTask.run(PreferenceTabbedPane.java:128)
	at org.openstreetmap.josm.gui.preferences.PreferenceTabbedPane.savePreferences(PreferenceTabbedPane.java:448)
	at org.openstreetmap.josm.gui.preferences.PreferenceDialog$OKAction.actionPerformed(PreferenceDialog.java:174)
	at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2018)
	at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2341)
	at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)
	at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)
	at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:252)
	at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:289)
	at java.awt.Component.processMouseEvent(Component.java:6516)
	at javax.swing.JComponent.processMouseEvent(JComponent.java:3312)
	at java.awt.Component.processEvent(Component.java:6281)
	at java.awt.Container.processEvent(Container.java:2229)
	at java.awt.Component.dispatchEventImpl(Component.java:4872)
	at java.awt.Container.dispatchEventImpl(Container.java:2287)
	at java.awt.Component.dispatchEvent(Component.java:4698)
	at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4832)
	at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4492)
	at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4422)
	at java.awt.Container.dispatchEventImpl(Container.java:2273)
	at java.awt.Window.dispatchEventImpl(Window.java:2719)
	at java.awt.Component.dispatchEvent(Component.java:4698)
	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:747)
	at java.awt.EventQueue.access$300(EventQueue.java:103)
	at java.awt.EventQueue$3.run(EventQueue.java:706)
	at java.awt.EventQueue$3.run(EventQueue.java:704)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:77)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:87)
	at java.awt.EventQueue$4.run(EventQueue.java:720)
	at java.awt.EventQueue$4.run(EventQueue.java:718)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:77)
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:717)
	at org.GNOME.Accessibility.AtkWrapper$5.dispatchEvent(AtkWrapper.java:697)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242)
	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161)
	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:154)
	at java.awt.WaitDispatchSupport$2.run(WaitDispatchSupport.java:182)
	at java.awt.WaitDispatchSupport$4.run(WaitDispatchSupport.java:221)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.awt.WaitDispatchSupport.enter(WaitDispatchSupport.java:219)
	at java.awt.Dialog.show(Dialog.java:1082)
	at java.awt.Component.show(Component.java:1655)
	at java.awt.Component.setVisible(Component.java:1607)
	at java.awt.Window.setVisible(Window.java:1014)
	at java.awt.Dialog.setVisible(Dialog.java:1005)
	at org.openstreetmap.josm.gui.preferences.PreferenceDialog.setVisible(PreferenceDialog.java:126)
	at org.openstreetmap.josm.actions.PreferencesAction.run(PreferencesAction.java:112)
	at org.openstreetmap.josm.actions.PreferencesAction.actionPerformed(PreferencesAction.java:101)
	at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2018)
	at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2341)
	at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)
	at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)
	at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:252)
	at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:289)
	at java.awt.Component.processMouseEvent(Component.java:6516)
	at javax.swing.JComponent.processMouseEvent(JComponent.java:3312)
	at java.awt.Component.processEvent(Component.java:6281)
	at java.awt.Container.processEvent(Container.java:2229)
...<snip>...

}}}
"	defect	closed	normal		Plugin ImproveOsm	latest	fixed	template_report	
