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

Bug 279781

Summary: [Import/Export] Recursive addition problem in Import > Existing projects into workspace
Product: [Eclipse Project] Platform Reporter: mkaditya <amadduri>
Component: IDEAssignee: Prakash Rangaraj <prakash>
Status: VERIFIED FIXED QA Contact: Prakash Rangaraj <prakash>
Severity: major    
Priority: P3 CC: daniel_megert, freidin.alex, glasskarma, john-michael.au, prakash.narayana, remy.suen
Version: 3.4.2   
Target Milestone: 3.7 M4   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Import dialog
none
Checks for overlapping workspace/project location none

Description mkaditya CLA 2009-06-10 07:14:26 EDT
Build ID: M20090211-1700

Steps To Reproduce:
1. Create Workspace ws1
2. Create project p1.
3. Create Workspace ws1/p1
4. One Import > Existing projects into workspace
5. Select ws1/p1 and check the option "Copy projects into workspace".
6. Click finish button.
7. Observe that p1 is recursively added.


More information:
In ideal case we should check for recursive addition and avoid it.
Comment 1 Paul Webster CLA 2009-06-10 08:55:34 EDT
(In reply to comment #0)
> Build ID: M20090211-1700
> 
> Steps To Reproduce:
> 1. Create Workspace ws1
> 2. Create project p1.

do you exit here and then restart eclipse with ws1/p1?

> 3. Create Workspace ws1/p1
> 4. One Import > Existing projects into workspace
> 5. Select ws1/p1 and check the option "Copy projects into workspace".

Which file location do you select to import from?  ws1?

PW
Comment 2 mkaditya CLA 2009-06-10 10:17:20 EDT
(In reply to comment #1)
> (In reply to comment #0)
> > Build ID: M20090211-1700
> > 
> > Steps To Reproduce:
> > 1. Create Workspace ws1
> > 2. Create project p1.
> 
> do you exit here and then restart eclipse with ws1/p1?
  Yes.

> 
> > 3. Create Workspace ws1/p1
> > 4. One Import > Existing projects into workspace
> > 5. Select ws1/p1 and check the option "Copy projects into workspace".
> 
> Which file location do you select to import from?  ws1?
   I will import ws1/p1 (project). 
> 
> PW
> 

Comment 3 Paul Webster CLA 2009-06-10 10:35:26 EDT
(In reply to comment #2)
> > Which file location do you select to import from?  ws1?
>    I will import ws1/p1 (project). 

When I open File>Import>Existing... it asks for a Root location ... what is it?

PW
Comment 4 mkaditya CLA 2009-06-10 10:39:19 EDT
(In reply to comment #3)
> (In reply to comment #2)
> > > Which file location do you select to import from?  ws1?
> >    I will import ws1/p1 (project). 
> 
> When I open File>Import>Existing... it asks for a Root location ... what is it?
   It should be ws1/p1. (please note that p1 is project as well as the present workspace).
> 
> PW
> 

Comment 5 Paul Webster CLA 2009-06-10 10:44:47 EDT
Created attachment 138801 [details]
Import dialog

I cannot reproduce.  If I select as shown here, clicking OK opens an error dialog complaining about overlapping workspace locations.

This is on an RC build I20090603-2000 for 3.5.

PW
Comment 6 Paul Webster CLA 2009-06-10 10:45:17 EDT
This might have been fixed by work in 3.5
PW
Comment 7 mkaditya CLA 2009-06-10 11:52:13 EDT
(In reply to comment #6)
> This might have been fixed by work in 3.5
> PW
> 
I checked in 3.5 RC4 and I found that problem is still there. Following are the exact steps I have done.

1) Create a workspace D:\rws.
2) Create a java project p1.
3) Close the workspace.
4) Now launch the eclipse with workspace as D:\rws\p1.
5) Right click in the package explorer and select the import option.
6) Choose 'Existing Projects into Workspace' option from the Import wizard.
7) In select root directory choose D:\rws\p1
8) Check the option 'Copy projects into workspace'.
9) Click finish and find the recursive problem.
Comment 8 Dani Megert CLA 2009-06-10 12:25:15 EDT
Same on 3.5 RC4.

Paul, the key is to change the change workspace location in step 3. Which in my opinion is not a very common scenario.

Fix is to check the URL using ResourcesPlugin.getWorkspace().validateProjectLocationURI(project, locationURI);

in line 1368 of WizardProjectsImportPage.createExistingProject(ProjectRecord, IProgressMonitor)
Comment 9 Alex Freidin CLA 2009-11-12 05:46:28 EST
The problem still reproducible in 3.5 release. It is important to mark the 'Copy projects into workspace' checkbox. The attached screenshot has it unmarked.
Comment 10 Alex Freidin CLA 2010-05-09 03:14:26 EDT
This bug is still there in 3.6 M6. I made a patch based on comment 8. Hopefully, we get this closed before 3.6 release.
Comment 11 Alex Freidin CLA 2010-05-09 03:15:56 EDT
Created attachment 167617 [details]
Checks for overlapping workspace/project location
Comment 12 Andrew Gvozdev CLA 2010-08-09 15:04:16 EDT
*** Bug 314617 has been marked as a duplicate of this bug. ***
Comment 13 Prakash Rangaraj CLA 2010-11-09 03:37:53 EST
Patch released to HEAD.

Thanks Alex
Comment 14 Prakash Rangaraj CLA 2010-11-09 03:38:36 EST
*** Bug 227443 has been marked as a duplicate of this bug. ***
Comment 15 Prakash Rangaraj CLA 2010-12-08 03:39:39 EST
Verified in I20101206-1800
Comment 16 Dani Megert CLA 2011-06-02 04:25:01 EDT
*** Bug 348037 has been marked as a duplicate of this bug. ***