Community
Participate
Working Groups
code from HEAD If you happen to call ILaunchConfigurationWorkingCopy.rename(..) and ILaunchConfigurationWorkingCopy.setContaner(..) in a single save cycle the call to ILaunchConfigurationWorkingCopy.doSave() will result in two configurations. The problem is that the rename + container cause the config to be considered as moved, and during the save when we try to delete the original it fails because the backing IFile no longer exists. Here is a test that demonstrates the problem (from Drain W): public void testRenameAndSetContainer() throws CoreException { IProject project = getProject(); IFolder f1 = project.getFolder("f1"); IFolder f2 = project.getFolder("f2"); f1.create(false, true, null); f2.create(false, true, null); ILaunchConfigurationWorkingCopy wc = newConfiguration(f1, "start-here"); ILaunchConfiguration orig = wc.doSave(); wc.setContainer(f2); wc.rename("end-here"); ILaunchConfiguration next = wc.doSave(); assertFalse("Original should not exist", orig.exists()); assertTrue("Renamed and moved config should exist", next.exists()); }
The test was flawed... it passes as follows (get the new working copy after the original save). public void testRenameAndSetContainer() throws CoreException { IProject project = getProject(); IFolder f1 = project.getFolder("f1"); IFolder f2 = project.getFolder("f2"); f1.create(false, true, null); f2.create(false, true, null); ILaunchConfigurationWorkingCopy wc = newConfiguration(f1, "start-here"); ILaunchConfiguration orig = wc.doSave(); wc = orig.getWorkingCopy(); wc.setContainer(f2); wc.rename("end-here"); ILaunchConfiguration next = wc.doSave(); assertFalse("Original should not exist", orig.exists()); assertTrue("Renamed and moved config should exist", next.exists()); } However, a problem does occur when a project is renamed.
Steps to reproduce in the IDE 1. create a project and create an Ant build file 2. create a configuration for the build file and share it in the project 3. rename the project Expected: the config is renamed and all is well Happens: the config is renamed but now there will be two of them - one referencing the original project and one referencing the new project.
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant. If the bug is still relevant, please remove the "stalebug" whiteboard tag.