﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
13402	[Patch] Shift+P (make parallel ways copy) causes crash	GerdP	team	"==== What steps will reproduce the problem?
1. start JOSM
2. press Strg+N for a new layer
3. press Shift+P for ""parallel ways""

==== What is the expected result?
Cursor should change to show the symbol for parallel ways
==== What happens instead?
Crash report
==== Please provide any additional information below. Attach a screenshot if possible.
Problem was probably introduced with 10824. 
The old code for `addPreferenceChangeListener(PreferenceChangedListener listener)`in Preferences.java used
`addIfAbsent(listener);` 
the new codes uses `ensureNotInList(listener);` and complains when the listener was already added. No idea why this was changed.

{{{
URL:http://josm.openstreetmap.de/svn/trunk
Repository:UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b
Last:Changed Date: 2016-08-21 03:15:12 +0200 (Sun, 21 Aug 2016)
Build-Date:2016-08-21 01:38:47
Revision:10865
Relative:URL: ^/trunk

Identification: JOSM/1.5 (10865 en) Windows 10 64-Bit
Memory Usage: 1671 MB / 5461 MB (1549 MB allocated, but free)
Java version: 1.8.0_102-b14, Oracle Corporation, Java HotSpot(TM) 64-Bit Server VM
VM arguments: [-XX:StartFlightRecording=name=MyRecording2,settings=d:\dbg\gerd.jfc, -XX:FlightRecorderOptions=defaultrecording=true,dumponexit=true,dumponexitpath=e:\ld\perf_20160821_144212.jfr, -Dsun.java2d.opengl=true]
Dataset consistency test: No problems found

Plugins:
+ apache-commons (32699)
+ buildings_tools (32796)
+ ejml (32680)
+ geotools (32813)
+ jts (32699)
+ o5m (32857)
+ opendata (32811)
+ pbf (32699)
+ poly (32699)
+ reverter (32796)
+ utilsplugin2 (32815)


=== REPORTED CRASH DATA ===
BugReportExceptionHandler#handleException:
No data collected.

Warning issued by: BugReportExceptionHandler#handleException

=== STACK TRACE ===
Thread: AWT-EventQueue-0 (22) of main
java.lang.IllegalArgumentException: Listener org.openstreetmap.josm.actions.mapmode.ParallelWayAction@3119e0b2 (instance of org.openstreetmap.josm.actions.mapmode.ParallelWayAction) was already registered.
	at org.openstreetmap.josm.tools.ListenerList.failAdd(ListenerList.java:108)
	at org.openstreetmap.josm.tools.ListenerList.ensureNotInList(ListenerList.java:102)
	at org.openstreetmap.josm.tools.ListenerList.addListener(ListenerList.java:95)
	at org.openstreetmap.josm.data.Preferences.addPreferenceChangeListener(Preferences.java:231)
	at org.openstreetmap.josm.actions.mapmode.MapMode.enterMode(MapMode.java:67)
	at org.openstreetmap.josm.actions.mapmode.ParallelWayAction.enterMode(ParallelWayAction.java:150)
	at org.openstreetmap.josm.gui.MapFrame.selectMapMode(MapFrame.java:453)
	at org.openstreetmap.josm.gui.MapFrame.selectMapMode(MapFrame.java:432)
	at org.openstreetmap.josm.actions.mapmode.MapMode.actionPerformed(MapMode.java:99)
	at javax.swing.SwingUtilities.notifyAction(Unknown Source)
	at javax.swing.JComponent.processKeyBinding(Unknown Source)
	at javax.swing.KeyboardManager.fireBinding(Unknown Source)
	at javax.swing.KeyboardManager.fireKeyboardAction(Unknown Source)
	at javax.swing.JComponent.processKeyBindingsForAllComponents(Unknown Source)
	at javax.swing.JComponent.processKeyBindings(Unknown Source)
	at javax.swing.JComponent.processKeyEvent(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.KeyboardFocusManager.redispatchEvent(Unknown Source)
	at java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(Unknown Source)
	at java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(Unknown Source)
	at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(Unknown Source)
	at java.awt.DefaultKeyboardFocusManager.dispatchEvent(Unknown Source)
	at java.awt.Component.dispatchEventImpl(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	16.08	Core		fixed	template_report regression gsoc-core	michael2402
