Community
Participate
Working Groups
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.
Update title.
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?
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.
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).
Closing, working as designed.
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?
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?
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.
Fixed JavaProjectElementInfo.computeNonJavaResources() to include folders that are excluded when src=prj. Clarified doc of IJavaProject.getNonJavaResources() and IPackageFragmentRoot.getNonJavaResources(). Added ExclusionPatternTests.testAddExclusionOnFolderUnderProject()
Verified.