Community
Participate
Working Groups
3.1 RC3 Saved types are found when using case-sensitive names but this does not work for not yet saved new types. Example: 1. enter class AC {} and save 2. enter calss BC {} and do not save 3. open type ==> "AC" finds AC but "BC" does not find BC. However, typing just lowercase letters "bc" finds BC. Same is true for types named like "MiXeDClass".
Have to investigate if this is the dialog or search engine.
I tested it with the following case: package p; public class P { } class DoBr {} - class DoBr added but not yet in the index since the file hasn't been saved. Searching for DoBr makes the following call to searchAllTypeNames: packagePattern:= null pattern:= DoBr* flags:= 2 (== SearchPattern.R_PATTERN_MATCH) elementKind:= 0 scope:= workspace IJavaSearchConstants.WAIT_UNTIL_READY_TO_SEARCH This finds zero matches allthough such a class exists in the wortking copy of P Searching for dobr makes the following call to searchAllTypeNames: packagePattern:= null pattern:= dobr* flags:= 2 (== SearchPattern.R_PATTERN_MATCH) elementKind:= 0 scope:= workspace IJavaSearchConstants.WAIT_UNTIL_READY_TO_SEARCH This correctly finds one match. So this seems to be a problem of the all types search method correctly handling elements in working copies. Moving to JDT/Core. Philippe, can you please investigate since this "hides" types in the open type dialog.
Frederic - pls investigate. If fix is available, will candidate for RC3
Created attachment 23132 [details] Patch to fix this issue Pattern type name provided to searchAllTypeNames is not lowercased as it should be. See javadoc comment of CharOperation.match(char(],int,int,char[],int,int,boolean) method: * When not case sensitive, the pattern is assumed to already be lowercased, the * name will be lowercased character per character as comparing.
Philippe, please vote for this as fix is really simple and should not have any impact...
Note that all JDT tests (core + ui) pass using build N20050615-0010
+1 for RC3. Dani - pls cast your vote.
+1 for 3.1 RC3
Fixed and released in HEAD. [jdt-core internal] Test case added in WorkingCopySearchTests
Verified using build N20050616-0010 + JDT Core HEAD.