Bug 296277 - [search] SearchEngine#searchAllTypeNames(.., TypeNameMatchRequestor,..) should report access rules
Summary: [search] SearchEngine#searchAllTypeNames(.., TypeNameMatchRequestor,..) shoul...
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.6   Edit
Hardware: PC Windows XP
: P3 enhancement (vote)
Target Milestone: 3.6 M4   Edit
Assignee: Frederic Fusier CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 218487
  Show dependency tree
 
Reported: 2009-11-26 13:32 EST by Markus Keller CLA
Modified: 2009-12-08 11:07 EST (History)
2 users (show)

See Also:


Attachments
Proposed patch (5.11 KB, patch)
2009-11-27 07:44 EST, Frederic Fusier CLA
markus.kell.r: review-
Details | Diff
New proposed patch (5.54 KB, patch)
2009-12-01 06:28 EST, Frederic Fusier CLA
no flags Details | Diff
Last proposed patch (6.74 KB, patch)
2009-12-04 04:03 EST, 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 Markus Keller CLA 2009-11-26 13:32:10 EST
I20091124-0800

For bug 218487, OrganizeImportsOperation would like to get access restrictions from SearchEngine#searchAllTypeNames(.., TypeNameMatchRequestor,..).

The API could be similar to what we already have in org.eclipse.jdt.core.CompletionProposal#getAccessibility(), e.g.: TypeNameMatchRequestor#getAccessibility()

It looks like most of this is already there, but TypeNameMatchRequestorWrapper#acceptType(..) drops the access restriction in the last second.
Comment 1 Frederic Fusier CLA 2009-11-27 07:44:45 EST
Created attachment 153231 [details]
Proposed patch

Implementation copied from CompletionProposal and InternalCompletionProposal. Note that the accessibility setter needs to be public in this case as the TypeNameMatchRequestorWrapper does not inherit from TypeNameMatchRequestor...
Comment 2 Markus Keller CLA 2009-11-30 10:50:54 EST
Comment on attachment 153231 [details]
Proposed patch

> TypeNameMatchRequestor#getAccessibility()

Oops, sorry, that was a Copy/Paste error. I actually meant TypeNameMatch#getAccessibility(). 

The TypeNameMatchRequestor should not be touched.
Comment 3 Frederic Fusier CLA 2009-12-01 06:28:39 EST
Created attachment 153444 [details]
New proposed patch
Comment 4 Markus Keller CLA 2009-12-01 12:07:30 EST
(In reply to comment #3)
Looks good. TypeNameMatch#getAccessibility() could also be abstract since its default value is never used (and clients must not subclass).
Comment 5 Frederic Fusier CLA 2009-12-04 04:03:54 EST
Created attachment 153806 [details]
Last proposed patch

I've set the getAccessibility() method abstract on TypeNameMatch and also replaced the 'This class is not intended to be overridden by clients.' comment by the @noextend javadoc tag on this class...
Comment 6 Frederic Fusier CLA 2009-12-04 04:09:18 EST
Released for 3.6M4 in HEAD stream.
Comment 7 Satyam Kandula CLA 2009-12-08 06:56:05 EST
Verified for 3.6M4 using Build id: I20091207-1800
Comment 8 Olivier Thomann CLA 2009-12-08 11:07:05 EST
Verified.