Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 317824 - [Filters] Renaming a project that contains resource filters fails.
Summary: [Filters] Renaming a project that contains resource filters fails.
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Resources (show other bugs)
Version: 3.6   Edit
Hardware: PC All
: P3 major (vote)
Target Milestone: 3.7 M2   Edit
Assignee: Serge Beauchamp CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 335843
  Show dependency tree
 
Reported: 2010-06-24 10:10 EDT by Serge Beauchamp CLA
Modified: 2011-01-31 08:54 EST (History)
3 users (show)

See Also:
john.arthorne: review+


Attachments
Fix (3.55 KB, patch)
2010-08-02 10:38 EDT, Serge Beauchamp CLA
no flags Details | Diff
Fix (6.60 KB, patch)
2010-08-05 17:30 EDT, Serge Beauchamp CLA
no flags Details | Diff
Alternate fix (same tests) (6.09 KB, patch)
2010-08-07 23:44 EDT, John Arthorne CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Serge Beauchamp CLA 2010-06-24 10:10:26 EDT
(from vkrevs@yahoo.com)

Build Identifier:  20100617-1415

My project has the following folder structure:

<project_root>/
   dir1/
      linux_debug/
           built .o and final target files for a debug build
      linux_release/
           built .o and final target files for a debug build
      source files

Create a new resource filter:

Filter type: "Exclude All", Applies to: "Files and Folders" + "All
children(recursive)", "Name" "matches" "linux_*"

Attempt to rename the project.

Once a project has a resource filter defined, it
can no longer be renamed as Eclipse claims is's out of sync with the
filesystem. Removing the resource filter makes the project renameable again.

Reproducible: Always
Comment 1 Szymon Brandys CLA 2010-06-28 08:12:37 EDT
Serge, it looks like a pretty serious limitation. Have you had a chance to verify that?
Comment 2 Szymon Brandys CLA 2010-06-29 05:38:13 EDT
I experience similar problem when renaming projects with filters.
Comment 3 Szymon Brandys CLA 2010-08-02 09:42:30 EDT
Serge, is it still M1?
Comment 4 Serge Beauchamp CLA 2010-08-02 10:38:04 EDT
Created attachment 175718 [details]
Fix

Yes, this is the patch for this bug.  It turned out to be a bug in the core.resources plugin.

Can you review it please?  Thanks,
Comment 5 Szymon Brandys CLA 2010-08-03 11:53:54 EDT
I think that the problem is more complicated. Try to copy a project with some filters defined. Filters are lost in the destination project. It seems that the root cause of the problem is similar, i.e. we save the project description in a wrong place.
Comment 6 Tomasz Zarna CLA 2010-08-05 06:56:15 EDT
Moving to M2.
Comment 7 Serge Beauchamp CLA 2010-08-05 17:30:06 EDT
Created attachment 175984 [details]
Fix

Fix.  Now also address the disappearing of resource filters when the project is copied.

Note that copying a project that contains resource filters will not copy the resources that are filtered out.  This may or may not be what the user expects.

Copying filtered out resources would require removing resource filters on the project, which could cause unexpected performance and scalability problems that the resource filters were addressing in the first place.
Comment 8 Serge Beauchamp CLA 2010-08-06 12:49:35 EDT
Since Szymon is in vacation, John, can you review the latest fix please?  Thanks,
Comment 9 John Arthorne CLA 2010-08-07 23:44:56 EDT
Created attachment 176100 [details]
Alternate fix (same tests)

For the move bug, maybe I am misunderstanding but it looks like Serge's patch could leave the .project file unwritten in some cases. This patch has a simpler fix that just sets the "overwrite" flag when copying the metadata for .project. That way, if the earlier code had to write the .project, this will simply overwrite the metadata in the tree and not fail.

For the copy bug, the fix looks good. The problem is that when copying we create a new description by cloning the old one. Cloning loses data such as filters, links, etc. Links get recreated anyway during the copy, but filters are never copied. My patch just adds a comment about this next to the fix.
Comment 10 Serge Beauchamp CLA 2010-08-09 06:18:10 EDT
Ok, that looks good to be, this is now fixed on head.
Comment 11 Malgorzata Janczarska CLA 2010-09-15 04:46:18 EDT
Verified on I20100912-2000. Project can be renamed even if the given filter exists.