Project: JDT
Bug 176017 [open type] FilteredTypesSelectionDialog mixes 2 versions of SearchPattern
Reported: 2007-03-01 08:38:21 | Status: verified fixed

I20070228-0930 Platform/UI has copied most of org.eclipse.jdt.core.search.SearchPattern to org.eclipse.ui.dialogs.SearchPattern. FilteredItemsSelectionDialog.ItemsFilter uses the ui.dialogs.SearchPattern, and so does FilteredTypesSelectionDialog.TypeItemsFilter. But FilteredTypesSelectionDialog.fillContentProvider(..) passes TypeItemsFilter#getPackageFlags() and #getMatchRule() to SearchEngine.searchAllTypeNames(..), which expects flags from the jdt.core.search.SearchPattern. This mix-up is incorrect and will inevitably lead to subtle problems. Either the 2 versions of SearchPattern are unified in a common upstream plug-in, or FilteredTypesSelectionDialog needs to completely override the ui.dialogs-dependent parts of TypeItemsFilter by delegating to the jdt.core version of SearchPattern.

Files changed in fix:
org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/util/TypeInfoFilter.java org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/dialogs/FilteredTypesSelectionDialog.java