﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
14410	[PATCH] AddPrimitivesCommand undo remove existing data	Tyndare	team	"
The [https://josm.openstreetmap.de/browser/josm/trunk/src/org/openstreetmap/josm/command/AddPrimitivesCommand.java AddPrimitivesCommand] is supposed to ignore existing data (there is a test for that: [https://josm.openstreetmap.de/browser/josm/trunk/test/unit/org/openstreetmap/josm/command/AddPrimitivesCommandTest.java testAddIgnoresExisting()])
But if we undo the command, the data that was already existing will be removed and not ignored, leaving an incoherent state.

This is causing major exception when we use ""undo"" with the Conflation plugin which rely on this command.

The attached patch save the state of pre existing data, and in case of undo restore their state instead of removing them from the DataSet.

I also took the liberty to try to simplify the code that handle selection (toSelect), feel free to ignore this part.

"	defect	closed	major	17.02	Core		fixed	AddPrimitivesCommand undo existing conflation	
