﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
17534	[PATCH] junctionchecking may try to add itself two or more times to the activelayerchangelisteners	taylor.smock	joerg	"==== What steps will reproduce the problem?
1. Start JOSM
2. Download/Open an area (see the attached file for what I was looking at if not reproducible otherwise)
3. Create the ChannelDiGraphLayer
4. Delete the ChannelDiGraphLayer
5. Crash occurs

==== What is the expected result?
No crash

==== What happens instead?
Crash

==== Please provide any additional information below. Attach a screenshot if possible.

{{{
Relative:URL: ^/trunk
Repository:UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b
Last:Changed Date: 2019-03-03 00:16:03 +0100 (Sun, 03 Mar 2019)
Revision:14824
Build-Date:2019-03-02 23:16:53
URL:https://josm.openstreetmap.de/svn/trunk

Identification: JOSM/1.5 (14824 en) Mac OS X 10.14.4
OS Build number: Mac OS X 10.14.4 (18E226)
Memory Usage: 368 MB / 2048 MB (143 MB allocated, but free)
Java version: 11.0.1+13, Oracle Corporation, OpenJDK 64-Bit Server VM
Screen: Display 188945226 1920x1080, Display 69978068 2048x1152
Maximum Screen Size: 2048x1152
VM arguments: [-Djosm.pref=./tmp]
Dataset consistency test: No problems found

Plugins:
+ junctionchecking (34678)

Last errors/warnings:
- E: java.io.IOException: java.util.concurrent.ExecutionException: [security, find-certificate, -c, Government Root Certification Authority, -p, /System/Library/Keychains/SystemRootCertificates.keychain]. Cause: java.util.concurrent.ExecutionException: [security, find-certificate, -c, Government Root Certification Authority, -p, /System/Library/Keychains/SystemRootCertificates.keychain]
- W: Update plugins - org.openstreetmap.josm.plugins.PluginHandler$UpdatePluginsMessagePanel[,0,0,0x0,invalid,layout=java.awt.GridBagLayout,alignmentX=0.0,alignmentY=0.0,border=,flags=9,maximumSize=,minimumSize=,preferredSize=]
- W: No configuration settings found.  Using hardcoded default values for all pools.
- E: Thread main-worker-0 raised ReportedException [thread=Thread[main-worker-0,5,main], exception=java.lang.reflect.InvocationTargetException, methodWarningFrom=null]
- E: Handled by bug report queue: java.lang.IllegalArgumentException: Attempted to add listener that was already in list: org.openstreetmap.josm.plugins.JunctionChecker.JunctionCheckerMapMode@400f8d4d


=== REPORTED CRASH DATA ===
BugReportExceptionHandler#handleException:
No data collected.

Warning issued by: BugReportExceptionHandler#handleException

=== STACK TRACE ===
Thread: AWT-EventQueue-0 (19) of main
java.lang.IllegalArgumentException: Attempted to add listener that was already in list: org.openstreetmap.josm.plugins.JunctionChecker.JunctionCheckerMapMode@400f8d4d
	at org.openstreetmap.josm.gui.layer.MainLayerManager.addActiveLayerChangeListener(MainLayerManager.java:177)
	at org.openstreetmap.josm.plugins.JunctionChecker.JunctionCheckerMapMode.enterMode(JunctionCheckerMapMode.java:44)
	at org.openstreetmap.josm.gui.MapFrame.activeOrEditLayerChanged(MapFrame.java:846)
	at org.openstreetmap.josm.gui.layer.MainLayerManager.fireActiveLayerChange(MainLayerManager.java:271)
	at org.openstreetmap.josm.gui.layer.MainLayerManager.setActiveLayer(MainLayerManager.java:264)
	at org.openstreetmap.josm.gui.layer.MainLayerManager.realRemoveSingleLayer(MainLayerManager.java:304)
	at org.openstreetmap.josm.gui.layer.LayerManager.realRemoveLayer(LayerManager.java:266)
	at org.openstreetmap.josm.gui.layer.LayerManager.lambda$removeLayer$1(LayerManager.java:248)
	at org.openstreetmap.josm.gui.util.GuiHelper.runInEDTAndWaitWithException(GuiHelper.java:238)
	at org.openstreetmap.josm.gui.layer.LayerManager.removeLayer(LayerManager.java:248)
	at org.openstreetmap.josm.gui.dialogs.layer.DeleteLayerAction.actionPerformed(DeleteLayerAction.java:52)
	at java.desktop/javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1967)
	at java.desktop/javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2308)
	at java.desktop/javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:405)
	at java.desktop/javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:262)
	at java.desktop/javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:279)
	at java.desktop/java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:297)
	at java.desktop/java.awt.Component.processMouseEvent(Component.java:6632)
	at java.desktop/javax.swing.JComponent.processMouseEvent(JComponent.java:3342)
	at java.desktop/java.awt.Component.processEvent(Component.java:6397)
	at java.desktop/java.awt.Container.processEvent(Container.java:2263)
	at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:5008)
	at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2321)
	at java.desktop/java.awt.Component.dispatchEvent(Component.java:4840)
	at java.desktop/java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4918)
	at java.desktop/java.awt.LightweightDispatcher.processMouseEvent(Container.java:4547)
	at java.desktop/java.awt.LightweightDispatcher.dispatchEvent(Container.java:4488)
	at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2307)
	at java.desktop/java.awt.Window.dispatchEventImpl(Window.java:2772)
	at java.desktop/java.awt.Component.dispatchEvent(Component.java:4840)
	at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:772)
	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:715)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:95)
	at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:745)
	at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:743)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
	at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:742)
	at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
	at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)
}}}
"	defect	closed	normal		Plugin junctionchecking		fixed	template_report	
