Bug 65795

Summary: source inclusion mechanism breaks type lookups
Product: [Eclipse Project] JDT Reporter: Gabrio Verratti <gabrioverratti>
Component: CoreAssignee: Jerome Lanneluc <jerome_lanneluc>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 3.0   
Target Milestone: 3.0 RC2   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Proposed patch
none
Regression tests none

Description Gabrio Verratti CLA 2004-06-04 15:58:12 EDT
At least two seperate type lookups break if I use the source inclusion 
mechanism.  

I have a project with a lot of files that I cannot build (due to various 
unrelated reasons).  Prior to my upgrade to M9, I set up exclusion patterns 
associated to my source folder so that these files would be ignored.  Once the 
inclusion mechanism was introduced (M9?), I was able to simplify things quite 
a lot by specifying the couple of packages that I was interested in.  

Now that I specify the source folder contents explicitly via inclusion 
mechanism, the "Open Type" dialog lookup and the content assist associated 
with the "Move" refactoring operation no longer pickup any of my types.  I can 
still build, run and debug my sources.
Comment 1 Jerome Lanneluc CLA 2004-06-05 13:49:27 EDT
Would you have steps to reproduce this problem ?
Comment 2 Gabrio Verratti CLA 2004-06-07 15:18:35 EDT
Reproducing this is really all too simple.
1. add a class to any package anywhere in a java project
2. build & verify said class can be found by way of Open Type dialog (Navigate-
> Open Type)
3. open the build properties for the project, add the new class to the 
inclusion filter of the source folder containing the new class (I usually only 
add packages via the "Add Multiple..." command, so I'm not sure if actually 
adding just the new class by itself has the same behaviour)
4. repeat step 2
Comment 3 Jerome Lanneluc CLA 2004-06-08 06:48:54 EDT
The key step is : add packages via the "Add Multiple...". If you add 
individual files this will work.
Comment 4 Jerome Lanneluc CLA 2004-06-08 06:51:42 EDT
Created attachment 11698 [details]
Proposed patch

Changed IndexAllProject and AddFolderToIndex to visit a folder even if it is
not included as it can contain included children.
Comment 5 Jerome Lanneluc CLA 2004-06-08 06:55:17 EDT
Created attachment 11699 [details]
Regression tests

Added regression tests InclusionPatternTests#testSearchWithIncludedPackage1()
and testSearchWithIncludedPackage2(0
Comment 6 Jerome Lanneluc CLA 2004-06-08 11:11:42 EDT
Released patch and tests
Comment 7 Olivier Thomann CLA 2004-06-11 11:02:03 EDT
Verified in 200406110010