Bug 296277

Summary: [search] SearchEngine#searchAllTypeNames(.., TypeNameMatchRequestor,..) should report access rules
Product: [Eclipse Project] JDT Reporter: Markus Keller <markus.kell.r>
Component: CoreAssignee: Frederic Fusier <frederic_fusier>
Status: VERIFIED FIXED QA Contact:
Severity: enhancement    
Priority: P3 CC: Olivier_Thomann, satyam.kandula
Version: 3.6   
Target Milestone: 3.6 M4   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Bug Depends on:    
Bug Blocks: 218487    
Attachments:
Description Flags
Proposed patch
markus.kell.r: review-
New proposed patch
none
Last proposed patch none

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.