Bug 29374 - Excluded folder on project not returned by Java Model
Summary: Excluded folder on project not returned by Java Model
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 2.1   Edit
Hardware: PC Windows 2000
: P3 major (vote)
Target Milestone: 2.1 M5   Edit
Assignee: Jerome Lanneluc CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-01-13 06:31 EST by Dani Megert CLA
Modified: 2003-02-06 11:53 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dani Megert CLA 2003-01-13 06:31:15 EST
Build 20030107

1. Create J project 'Test'
2. Add folder 'doc'
3. On the build path properties page set the exclusion filter for the project to
'doc/'
==> doc is not visible in the Package Explorer or any other Java based view

Note: Same scenario works if the source folder is not the project itself.
Comment 1 Olivier Thomann CLA 2003-01-13 11:48:42 EST
Update title.
Comment 2 Kent Johnson CLA 2003-01-13 14:56:56 EST
Isn't that the whole point of setting an exclusion filter?

If the folder was visible, should all of its children be visible too?

How is a user to know the folder is excluded if it & its children are visible?
Comment 3 Dani Megert CLA 2003-01-14 02:55:06 EST
If the behavior you describe (filtered stuff is not returned by Java Model) is
the desired one that's OK for me - the reason why I filed the PR was then maybe
another bug I noticed:
I recently run into the case where I had:
Project P with Test/src, Test/src/tests and set the build path to be 
Test/src excluding tests/
Test/src/tests
and in the Package Explorer I saw
Test
  + src (as pkg fragment root)
     + tests (as normal folder)
  + tests (as pkg fragment root)

I can't reproduce this scenario (maybe it was in a previous build). That was the
reason why I reported this bug.

If the exclusion filter is really meant to remove it from the model then this is
OK for me and makes sense.
Comment 4 Philipe Mulet CLA 2003-01-14 05:02:45 EST
Exclusion filters are precisely used for pruning some branches in the 
JavaModel. Note that, excluded resources are listed amongst the collection of 
non-java resources (and one can figure they got excluded using 
IJavaProject#isOnClasspath(IResource)).

The last issue you noticed is likely an early bug which we resolved since then 
(see bug 28115).

Comment 5 Philipe Mulet CLA 2003-01-14 05:03:18 EST
Closing, working as designed.
Comment 6 Dani Megert CLA 2003-01-14 05:51:10 EST
Now I'm confused. You write:
>Note that, excluded resources are listed amongst the collection of 
>non-java resources (and one can figure they got excluded using 
>IJavaProject#isOnClasspath(IResource)).

Wouldn't this mean that Test.getNonJavaResources() must return 'doc'? And hence
'doc' being displayed in the Package Explorer? And hence my PR being correct?
Comment 7 Dani Megert CLA 2003-01-14 06:00:35 EST
Is there some doc which describes what gets returned from the Java Model in
relation to exclusion filters? E.g. if I have
Project P with Test/src, Test/src/tests and set the build path to be 
Test/src excluding tests/
Test/src/tests

What is expected to be seen in the Package Explorer?
Comment 8 Philipe Mulet CLA 2003-01-14 08:28:37 EST
Exactly, 'doc/' should be listed as a non-java resource. 
I could reproduce it. Reopening.

In the nested scenario, the inner source folder isn't listed as a non-java rsc 
of the outer one. We need to clarify the documentation on this front.
Comment 9 Jerome Lanneluc CLA 2003-01-14 10:12:10 EST
Fixed JavaProjectElementInfo.computeNonJavaResources() to include folders that 
are excluded when src=prj.

Clarified doc of IJavaProject.getNonJavaResources() and 
IPackageFragmentRoot.getNonJavaResources().

Added ExclusionPatternTests.testAddExclusionOnFolderUnderProject()
Comment 10 David Audel CLA 2003-02-06 11:53:42 EST
Verified.