Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 267201 - Resource filters problems with aliases
Summary: Resource filters problems with aliases
Status: RESOLVED FIXED
Alias: None
Product: e4
Classification: Eclipse Project
Component: Resources (show other bugs)
Version: unspecified   Edit
Hardware: PC Linux-GTK
: P3 normal (vote)
Target Milestone: 0.9 M2   Edit
Assignee: Serge Beauchamp CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 266666 (view as bug list)
Depends on:
Blocks:
 
Reported: 2009-03-05 09:30 EST by James Blackburn CLA
Modified: 2009-03-16 08:54 EDT (History)
3 users (show)

See Also:


Attachments
Test1 (3.67 KB, patch)
2009-03-09 06:28 EDT, James Blackburn CLA
john.arthorne: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description James Blackburn CLA 2009-03-05 09:30:27 EST
Build ID: HEAD

Steps To Reproduce:
Resource filters appears to interact badly with aliases.

Steps:
1) Create two projects p1, p2
Create real folders & files:
p1/src/foo.c
p1/src/foo.h

Create group:
p2/g1

Create link:
p2/g1/src  -> p1/src


Problems:

1) Add a resource filter "Include Only Files: *.c" to p1/src
  (.h files disappear from p1 (and sometimes from p2 too...)
2) Add a resource filter "Include Only Files: *.h" to p2/g1/src

Having done (2) p1/src is now empty for me (or it contains foo.h file).  The apparent behaviour changes each time I go through these steps...  

Close & open p2, resource re-appear as you expect in both projects.

Delete the resource filter on p2/g1/src

Create file 'asdf' in p1/src. File appears in p1 even though it's filtering *.c, but doesn't appear in p2 even though it has no filter...

Given what I see when I do the above is inconsistent, this is really worrying.  If I close the project which has aliases, behaviour becomes predictable again...
Comment 1 Serge Beauchamp CLA 2009-03-05 18:11:11 EST
Thanks for reporting this issue James.

This is now fixed on the e4 resource CVS HEAD (org.eclipse.core.resources and org.eclipse.core.tests.resources).
Comment 2 Serge Beauchamp CLA 2009-03-05 18:12:56 EST
*** Bug 266666 has been marked as a duplicate of this bug. ***
Comment 3 James Blackburn CLA 2009-03-09 06:28:33 EDT
Created attachment 128007 [details]
Test1

Add #testCreateFilterLinkedFolderAndTarget2 test which tests that creating and modifying resources works as expected.  The resources are selectively included and filtered in two different linked folders as in your original test. The main difference between this test and yours is that the modification here is done in the workspace rather than externally.

If you uncomment the two #refreshLocal() calls, the aliases folders contain the resources you would expect and the test passes.  If you don't then too many resources hang around.
Comment 4 James Blackburn CLA 2009-03-09 06:29:03 EDT
Problems still occur, reopening
Comment 5 Serge Beauchamp CLA 2009-03-09 07:38:48 EDT
This is now fixed on the e4 CVS HEAD.  

The regression test listed in the attachment now passes without errors.

Note that there's still one case under which it's possible to create a
resource under a folder that would normally be excluded under a refreshLocal(),
and this is if the user explicitly creates a resource under that parent. 

For example, lets say that "P1/folder" excludes all "*.h" resources.  If the
user creates explicitly a resource named "foo.h" under "P1/folder" (and not
under any of its aliases), then the resource will show under that folder, until
the user manually do a refresh.

This is to avoid the very confusing case that would prevent the resource from
even being created if if was excluded by its parent.

This is by design.
Comment 6 James Blackburn CLA 2009-03-09 07:51:11 EDT
(In reply to comment #5)
> ...
> This is to avoid the very confusing case that would prevent the resource from
> even being created if if was excluded by its parent.
> 
> This is by design.

That's fine, and makes sense to me.