Bug 177144 - API problems in FilteredItemsSelectionDialog (2)
Summary: API problems in FilteredItemsSelectionDialog (2)
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.3   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.3 M6   Edit
Assignee: Krzysztof Michalski CLA
QA Contact:
URL:
Whiteboard:
Keywords: api, contributed
Depends on:
Blocks:
 
Reported: 2007-03-13 10:24 EDT by Markus Keller CLA
Modified: 2007-06-22 07:22 EDT (History)
4 users (show)

See Also:


Attachments
Patch respond for Markus usggestions (9.48 KB, patch)
2007-03-14 10:12 EDT, Krzysztof Michalski 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 2007-03-13 10:24:08 EDT
Unresolved issues from bug 175524:

I skimmed over FilteredItemsSelectionDialog 1.20 and these API problems jumped
into my eyes:

- Field contentProvider is protected but undocumented. Why is it not private?

- createFilter() says: "Can be <code>null</code>,
*         no filtering will be applied then, causing no item to be shown in
*         the list."
=> That wouldn't make much sense, a dialog without any items. If the
implementation really supports null, then I guess it should mean that all items
are shown.

- SelectionHistory's Javadoc says: "The list is bounded at size
<code>MAX_HISTORY_SIZE</code>". API Javadoc should not refer to private
constants. If you don't want to add API to change the size, the Javadoc should
just say "The list is bounded at a certain size".

- There are two methods ItemsFilter#matchesRawNamePattern(..). The variant with
the String parameter is never called (and should probably be removed). The
javadoc of the remaining variant should tell when it is called and what it is
used for.

- Javadoc: unnecessary <p> tags in ItemsFilter#equalsFilter and ItemsFilter#isSubFilter
Comment 1 Krzysztof Michalski CLA 2007-03-14 10:12:41 EDT
Created attachment 60803 [details]
Patch respond for Markus usggestions

I resolved all Markus issues without proposition of change searching implementation. Now we don't start searching if filter is null. I will try change it in the next patch.
Comment 2 Tod Creasey CLA 2007-03-14 10:28:24 EDT
API REQUEST

In FilteredItemsSelectionDialog.

Remove the overloaded method ItemsFilter#matchesRawNamePattern(String) and make the ContentProvider for the dialog private.

ItemsFilter#matchesRawNamePattern(Object) is the only one called in the implementation and the overloaded version is superfluous.

The internal ContentProvider should never have been protected as it is only meant to be accessed by FilteredItemsSelectionDialog.

RISKS
None. No one is currently calling these methods.

Comment 3 Mike Wilson CLA 2007-03-14 11:27:30 EDT
+1
Comment 4 Markus Keller CLA 2007-04-18 05:50:52 EDT
Fix has been released on 2007-03-14 and is in M6.