Bug 96950

Summary: [search] Code assist proposes non accessible types into completion
Product: [Eclipse Project] JDT Reporter: Maxime Daniel <maxime_daniel>
Component: CoreAssignee: Frederic Fusier <frederic_fusier>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: daniel_megert
Version: 3.1   
Target Milestone: 3.1 RC3   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Patch to fix this issue
none
Test cases added to CompletionTests2 none

Description Maxime Daniel CLA 2005-05-27 07:11:03 EDT
Build I20050527-0010.
One project P1 with class Taratata in src, default package.
A second project P2 which has P1 on its buildpath with access rule that forbids
access to all.
A class in P2 that reads as follows (| figures the insertion point when invoking
code assist):
public class BreakRules {
	Tara|
}
Code assist suggests type Taratata.
Comment 1 David Audel CLA 2005-05-27 07:13:17 EDT
The problem occurs only if Taratata is inside the default package
Comment 2 David Audel CLA 2005-05-27 07:29:35 EDT
The problem is inside BasisSearchEngine#searchAllTypeNames().

The path computed inside the IndexQueryRequestor seems incorrect when
record.pkg.length is 0. It is "/Taratata" and should be "Taratata".
Comment 3 Frederic Fusier CLA 2005-06-13 07:59:15 EDT
Created attachment 22903 [details]
Patch to fix this issue

When package pattern is not null but empty, IndexQueryRequestor wrongly adds a
'/' before document path...
Comment 4 Frederic Fusier CLA 2005-06-13 08:09:10 EDT
Created attachment 22907 [details]
Test cases added to CompletionTests2
Comment 5 Philipe Mulet CLA 2005-06-13 12:05:35 EDT
+1 for RC3.

Dani - would you pls vote for this one ?
Comment 6 Dani Megert CLA 2005-06-13 12:08:28 EDT
+1 for 3.1 RC3. Improving code assist is always welcome ;-)
Comment 7 Frederic Fusier CLA 2005-06-14 12:35:07 EDT
Fixed and released in HEAD.
Comment 8 Maxime Daniel CLA 2005-06-16 10:31:33 EDT
Verified using build N20050616-0010 + JDT Core HEAD.