Community
Participate
Working Groups
HEAD The work on bug 61185 revealed some flaws with SearchEngine.createHierarchyScope(IType) and its encloses(IJavaElement) method. a.) When we use SearchEngine.searchAllTypeNames(..) (e.g. in FilteredTypesSelectionDialog.fillContentProvider(AbstractContentProvider, ItemsFilter, IProgressMonitor)), we also get types that are not in the chosen hierarchy, but are nested or enclosing types of the given type's hierarchy. => members of the type can be expected (see Javadoc of createHierarchyScope), but enclosing types are unexpected b.) When we test types against the scope using encloses(IJavaElement) (e.g. in TypeInfoFilter.matchesScope(TypeNameMatch)), neither enclosing nor nested types are found. => the encloses(..) method should return true if and only if searchAllTypeNames(..) finds the type Steps: - install patch from bug 61185 comment 14 - in runtime workbench, create a new Plug-in project, using template "Hello, World Command" - create public class Bla { public static class InnerHandler implements IHandler { // use quick fix to add missing methods } } - create "public class Inner {}" as inner class of SampleHandler - open plugin.xml > Extensions > o.e.ui.handlers > (handler) - click "Browse..." next to the 'class:' attribute => Depending on whether the type selection dialog uses the search engine or its cache (calling IJavaSearchScope.encloses(IJavaElement)), elements "Bla", "InnerHandler", and "Inner" appear in the list or not. - to use the cache: enter first character, wait until search is done, add another character - to use the search engine: enter pattern "z", wait until search is done, select "z" and paste prefix of what you want to to find
I guess bug 61185 comment 10 mentions the same problem and Stephan proposed attachment 86635 [details] in bug 61185 comment 13 as a fix.
For cross reference: bug 215139 comment 35 ff. might decide to leave the inconsistency in the core and leave it to clients to supply a requestor that filters unwanted menbers/enclosings using the same hierarchy scope.
Since both bug 215139 and bug 61185 have been resolved for M3, I gave it a try using I20091020-0931. No matter what I tried, I ALWAYS got InnerHandler and SampleHandler I NEVER got Bla nor Inner Looks good, so I suggest to close this issue.
Thanks Stephan for the feedback => close as WORKSFORME
Verified for 3.6M3 using build I20091028-0100.