Bug 96950 - [search] Code assist proposes non accessible types into completion
Summary: [search] Code assist proposes non accessible types into completion
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.1 RC3   Edit
Assignee: Frederic Fusier CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-05-27 07:11 EDT by Maxime Daniel CLA
Modified: 2005-06-16 11:13 EDT (History)
1 user (show)

See Also:


Attachments
Patch to fix this issue (1.54 KB, patch)
2005-06-13 07:59 EDT, Frederic Fusier CLA
no flags Details | Diff
Test cases added to CompletionTests2 (3.71 KB, patch)
2005-06-13 08:09 EDT, Frederic Fusier CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.