Bug 18496 Launch config: getting asked to save changes when there where no changes
1) execute Run As>JUnit test on a test case 2) open the launch config dialog -> the newly created config is selected 3) click on another config ->you get prompted whether you want to save changes Verified that the same attributes are set. What is special about the JUnit launch config is that the tab group initializes the default run perspective to "null", i.e. no change. However, when doing the compare only values supplied by the tabs are taken into consideration. See LaunchConfigurationDialog.updateWorkingCopyFromPages(); The defaults set by the tabgroup itself are not considered. Hence there is a difference. The launch configs compared are (without the qualifcation) MAIN_TYPE=junit.samples.VectorTest, PROJECT_ATTR=JUnit, KEEPRUNNING_ATTR=false, source_locator_id=org.eclipse.jdt.debug.ui.javaSourceLocator, target_debug_perspective=perspective_default} MAIN_TYPE=junit.samples.VectorTest, KEEPRUNNING_ATTR=false, PROJECT_ATTR=JUnit, target_run_perspective=perspective_none, source_locator_id=org.eclipse.jdt.debug.ui.javaSourceLocator, target_debug_perspective=perspective_default As you can see the run perspective is missing in one config.
org.eclipse.jdt.junit/src/org/eclipse/jdt/internal/junit/launcher/JUnitBaseLaunchConfiguration.java
import org.eclipse.jdt.core.JavaCore;
import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jdt.core.Signature;
import org.eclipse.jdt.internal.junit.ui.JUnitMessages;
import org.eclipse.jdt.internal.junit.ui.JUnitPlugin;
import org.eclipse.jdt.internal.junit.util.SocketUtil;
import org.eclipse.jdt.launching.AbstractJavaLaunchConfigurationDelegate;
import org.eclipse.jdt.launching.ExecutionArguments;
import org.eclipse.jdt.launching.IJavaLaunchConfigurationConstants;
import org.eclipse.jdt.launching.IVMInstall;
import org.eclipse.jdt.launching.IVMInstallType;
import org.eclipse.jdt.launching.IVMRunner;
import org.eclipse.jdt.launching.VMRunnerConfiguration;
import org.eclipse.jdt.launching.sourcelookup.JavaSourceLocator;
/**
 * Abstract launch configuration delegate for a JUnit test.
 */
public abstract class JUnitBaseLaunchConfiguration extends AbstractJavaLaunchConfigurationDelegate {
	public static final String PORT_ATTR= JUnitPlugin.PLUGIN_ID+".PORT"; 
	public static final String TESTTYPE_ATTR= JUnitPlugin.PLUGIN_ID+".TESTTYPE"; 
	public static final String ATTR_KEEPRUNNING = JUnitPlugin.PLUGIN_ID+ ".KEEPRUNNING_ATTR"; 
	/**
	 * @see ILaunchConfigurationDelegate#launch(ILaunchConfiguration, String)
	 */
	
	public void launch(ILaunchConfiguration configuration, String mode, ILaunch launch, IProgressMonitor pm) throws CoreException {		
		IJavaProject javaProject= getJavaProject(configuration);
		if ((javaProject == null) || !javaProject.exists()) {
			abort(JUnitMessages.getString("JUnitBaseLaunchConfiguration.error.invalidproject"), null, IJavaLaunchConfigurationConstants.ERR_NOT_A_JAVA_PROJECT); 
		}