﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
12932	[Patch] Error if gpxedit start the second time	anonymous	michael2402	"==== What steps will reproduce the problem?
1. Start JOSM
2. Start gpxedit - the first time it will work
3. Save the new gpx file
4. Start gpxedit again then it will produce this failure

==== What is the expected result?

==== What happens instead?

==== Please provide any additional information below. Attach a screenshot if possible.
I can reproduce this error on 2 different JOSM/Windows installationens 

{{{
URL:http://josm.openstreetmap.de/svn/trunk
Repository:UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b
Last:Changed Date: 2016-06-04 17:28:58 +0200 (Sat, 04 Jun 2016)
Build-Date:2016-06-04 15:31:27
Revision:10327
Relative:URL: ^/trunk

Identification: JOSM/1.5 (10327 de) Windows 7 64-Bit
Memory Usage: 119 MB / 247 MB (53 MB allocated, but free)
Java version: 1.8.0_91-b14, Oracle Corporation, Java HotSpot(TM) Client VM
VM arguments: [-Djava.security.manager, -Djava.security.policy=file:<java.home>\lib\security\javaws.policy, -DtrustProxy=true, -Djnlpx.home=<java.home>\bin, -Djnlpx.origFilenameArg=%UserProfile%\AppData\LocalLow\Sun\Java\Deployment\cache\6.0\56\1ee8cfb8-302c7a1a, -Djnlpx.remove=false, -Djava.util.Arrays.useLegacyMergeSort=true, -Djnlpx.splashport=50666, -Djnlp.application.href=https://josm.openstreetmap.de/download/josm.jnlp, -Djnlpx.jvm=<java.home>\bin\javaw.exe, -Djnlpx.vmargs=LURqYXZhLnV0aWwuQXJyYXlzLnVzZUxlZ2FjeU1lcmdlU29ydD10cnVlAC1Eam5scC5hcHBsaWNhdGlvbi5ocmVmPWh0dHBzOi8vam9zbS5vcGVuc3RyZWV0bWFwLmRlL2Rvd25sb2FkL2pvc20uam5scAA=]
Dataset consistency test: No problems found

Plugins:
- DirectUpload (32158)
- InfoMode (32158)
- editgpx (32158)
- gpsblam (32158)
- gpxfilter (31923)
- turnrestrictions (32158)

Last errors/warnings:
- E: java.lang.IllegalArgumentException: Listener already registered.

java.lang.IllegalArgumentException: Listener already registered.
	at org.openstreetmap.josm.gui.layer.LayerManager.addLayerChangeListener(LayerManager.java:287)
	at org.openstreetmap.josm.gui.MapView.addLayerChangeListener(MapView.java:397)
	at org.openstreetmap.josm.gui.MapView.addLayerChangeListener(MapView.java:378)
	at org.openstreetmap.josm.plugins.editgpx.EditGpxMode.enterMode(EditGpxMode.java:47)
	at org.openstreetmap.josm.gui.MapFrame.selectMapMode(MapFrame.java:440)
	at org.openstreetmap.josm.gui.MapFrame.selectMapMode(MapFrame.java:419)
	at org.openstreetmap.josm.actions.mapmode.MapMode.actionPerformed(MapMode.java:99)
	at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
	at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
	at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
	at javax.swing.JToggleButton$ToggleButtonModel.setPressed(Unknown Source)
	at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
	at java.awt.AWTEventMulticaster.mouseReleased(Unknown Source)
	at java.awt.Component.processMouseEvent(Unknown Source)
	at javax.swing.JComponent.processMouseEvent(Unknown Source)
	at java.awt.Component.processEvent(Unknown Source)
	at java.awt.Container.processEvent(Unknown Source)
	at java.awt.Component.dispatchEventImpl(Unknown Source)
	at java.awt.Container.dispatchEventImpl(Unknown Source)
	at java.awt.Component.dispatchEvent(Unknown Source)
	at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
	at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
	at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
	at java.awt.Container.dispatchEventImpl(Unknown Source)
	at java.awt.Window.dispatchEventImpl(Unknown Source)
	at java.awt.Component.dispatchEvent(Unknown Source)
	at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
	at java.awt.EventQueue.access$500(Unknown Source)
	at java.awt.EventQueue$3.run(Unknown Source)
	at java.awt.EventQueue$3.run(Unknown Source)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
	at java.awt.EventQueue$4.run(Unknown Source)
	at java.awt.EventQueue$4.run(Unknown Source)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
	at java.awt.EventQueue.dispatchEvent(Unknown Source)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
	at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
	at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
	at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
	at java.awt.EventDispatchThread.run(Unknown Source)
}}}
"	defect	closed	normal		Plugin editgpx	tested	fixed	template_report gsoc-core	
