Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 398819

Summary: [Import/Export] Can't import and overwrite existing projects into workspace code broken
Product: [Eclipse Project] Platform Reporter: David <d.n.gonzales21>
Component: IDEAssignee: Platform-UI-Inbox <Platform-UI-Inbox>
Status: CLOSED WONTFIX QA Contact:
Severity: normal    
Priority: P3    
Version: 4.2   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard: stalebug

Description David CLA 2013-01-22 13:01:49 EST
see 163601 regarding a long standing problem with importing existing projects into workspace.

In Juno 3.8 & 4.2 the following code was added in an attempt to address projects that were under the workspace folder, but not open within eclipse not getting overwritten:

public ProjectRecord[] getProjectRecords() {
    List projectRecords = new ArrayList();
    for (int i = 0; i < selectedProjects.length; i++) {
        if ( (isProjectInWorkspacePath(selectedProjects[i].getProjectName()) && copyFiles)|| isProjectInWorkspace(selectedProjects[i].getProjectName())) {
            selectedProjects[i].hasConflicts = true;
	}
	projectRecords.add(selectedProjects[i]);
	}
	return (ProjectRecord[]) projectRecords.toArray(new ProjectRecord[projectRecords.size()]);
	}

The problem is with the if statement, if one were to do the following steps:

1) Select the root directory option.
2) Uncheck the copy projects into workspace.
3) Select the archive radio button.

This will allow the exsiting project to be re-imported.

The if statement fails as the copyFiles value is now set to false, because the dialog has remembered the state of the radio button via the restoreWidgetValues and no event has been fired to update the boolean. I would suggest that the boolean is re-checked in the code above or allow projects not open in the workspace to be overwritten and an appropriate warning displyed.
Comment 1 Eclipse Genie CLA 2020-03-14 01:48:30 EDT
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. As such, we're closing this bug.

If you have further information on the current state of the bug, please add it and reopen this bug. 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.

--
The automated Eclipse Genie.