| Summary: | [ccp] Copying an empty folder and pasting onto self loops infinitely | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] Platform | Reporter: | Randy Hudson <hudsonr> | ||||||
| Component: | UI | Assignee: | Dani Megert <daniel_megert> | ||||||
| Status: | RESOLVED FIXED | QA Contact: | |||||||
| Severity: | major | ||||||||
| Priority: | P2 | CC: | cbmcgee, daniel_megert, jwkeck15, markus.kell.r, raksha.vasisht, remy.suen | ||||||
| Version: | 3.6.2 | ||||||||
| Target Milestone: | 3.8 M4 | ||||||||
| Hardware: | All | ||||||||
| OS: | All | ||||||||
| Whiteboard: | |||||||||
| Attachments: |
|
||||||||
|
Description
Randy Hudson
(In reply to comment #0) > The "New folder" wizard takes so many steps, I tried simply copying an empty > folder named "web" and pasting it onto itself, after which I would have renamed > it. > > But, the paste action ran recursively. I just tried this on 3.6.2 on Windows XP and I got an error dialog saying 'Cannot import 'web'. The source and destination are the same.'. Randy, what kind of project were you using? Do you get the same problem if you just make a generic project (non-Java/non-C/nothing)? Plug-in project. The path to my eclipse workspace includes uppercase characters. On Mac using either 3.6.2 or 3.8M1 I am getting "Cannot import 'web'. The source and destination are the same." error message. (Same for workspace with upper case characters.) BTW, the "New Folder" wizard has exactly one step unless you go into "Advanced" settings. Created attachment 203172 [details]
Eclipse about dialog
Created attachment 203173 [details]
Showing the problem
(In reply to comment #3) > On Mac using either 3.6.2 or 3.8M1 I am getting "Cannot import 'web'. "Cannot import"? Why would it say import when the action was "paste"? BTW, I was referring to the steps needed just to get to the New Folder wizard as well. (In reply to comment #6) > "Cannot import"? Why would it say import when the action was "paste"? I think this is an artefact of the action being from JDT. Both the 'Package Explorer' and 'Project Explorer' gave me the same error message, the 'Navigator' didn't let me execute the Ctrl+V. Randy, which view were you in when you got this problem? To be clear, this is what I did. 1. Make a new plug-in project. 2. Create a folder named 'web' in the root of this project. 3. Select this 'web' project in the 'Package Explorer'. 4. Ctrl+C 5. Ctrl+V 6. An error dialog appears preventing me from executing this operation. I was in the Package Explorer Raksha, please investigate. (In reply to comment #3) > On Mac using either 3.6.2 or 3.8M1 I am getting "Cannot import 'web'. The > source and destination are the same." error message. (Same for workspace with > upper case characters.) Same with Mac OSX 10.6.8 with 3.8 build I20111004-1128 and on windows 7 with build I20111021-0800. (In reply to comment #7) > (In reply to comment #6) > Both the 'Package Explorer' and 'Project Explorer' gave me the same error > message, the 'Navigator' didn't let me execute the Ctrl+V. Randy, which view > were you in when you got this problem? > > To be clear, this is what I did. > > 1. Make a new plug-in project. > 2. Create a folder named 'web' in the root of this project. > 3. Select this 'web' project in the 'Package Explorer'. > 4. Ctrl+C > 5. Ctrl+V > 6. An error dialog appears preventing me from executing this operation. Randy, could you pls provide steps if it differs from the above? Also, can you always reproduce it? Looks like this has been fixed during 3.7. (In reply to comment #11) > Looks like this has been fixed during 3.7. I quickly tried in 3.6.2 and it works there as well. (In reply to comment #12) > I quickly tried in 3.6.2 and it works there as well. Dani, I didn't understand your last comment ("works"). This bug was filed against 3.6.2. (In reply to comment #13) > (In reply to comment #12) > > I quickly tried in 3.6.2 and it works there as well. > > Dani, I didn't understand your last comment ("works"). This bug was filed > against 3.6.2. Yes that's why I tested it in 3.6.2 and I cannot reproduce it i.e. "works fine". Same as what Oleg already mentioned in comment 3. [in package explorer] 1) Inside a project, create nested folders "parent/child" 2) Select "parent" and copy 3) Select "child" and paste (In reply to comment #15) > [in package explorer] > > 1) Inside a project, create nested folders "parent/child" > 2) Select "parent" and copy > 3) Select "child" and paste OK, this I can reproduce (but not the copy onto itself as reported in comment 0). Also fails with Juno M2. Raksha, we should disable 'Paste' in this case (like the Navigator does). (In reply to comment #17) > Raksha, we should disable 'Paste' in this case (like the Navigator does). Navigator does not disable paste but shows a dialog with msg : "Destination cannot be a descendent of the source". We (JDT/UI) also detect such cases and return with an error msg in org.eclipse.jdt.internal.corext.refactoring.reorg.ReorgPolicyFactory.FilesFoldersAndCusReorgPolicy.verifyDestination(IResource) The fix has to go in org.eclipse.ui.actions.CopyFilesAndFoldersOperation.validateImportDestinationInternal(IContainer destination, IFileStore[] sourceStores) here: .... // work around bug 16202. replacement for // sourcePath.isPrefixOf(destinationPath) IFileStore destinationParent = destinationStore.getParent(); if (sourceStore.isParentOf(destinationParent)) { ..... There should also be a check for sourceStore.equals(destinationParent). Moving to Platform UI. > // work around bug 16202. replacement for
> // sourcePath.isPrefixOf(destinationPath)
> IFileStore destinationParent = destinationStore.getParent();
> if (sourceStore.isParentOf(destinationParent)) {
> .....
>
>
> There should also be a check for sourceStore.equals(destinationParent).
Nope, it should simply compare with the destinationStore.
Fixed in master: b24ba5418fc852ee518e5aad66e8e0bc93469a6c (In reply to comment #20) > Fixed in master: b24ba5418fc852ee518e5aad66e8e0bc93469a6c Sorry, of course it's in R3_development. (In reply to comment #21) > (In reply to comment #20) > > Fixed in master: b24ba5418fc852ee518e5aad66e8e0bc93469a6c > Sorry, of course it's in R3_development. Cherry-picked to master: 50356ff1cb6948a904a0eeeeee25141ad1295f92 *** Bug 371415 has been marked as a duplicate of this bug. *** *** Bug 372299 has been marked as a duplicate of this bug. *** |