Summary: | ObjectContributions call toString() | ||
---|---|---|---|
Product: | [Eclipse Project] Platform | Reporter: | Erich Gamma <erich_gamma> |
Component: | UI | Assignee: | Nick Edgar <n.a.edgar> |
Status: | RESOLVED FIXED | QA Contact: | |
Severity: | major | ||
Priority: | P2 | CC: | akiezun |
Version: | 2.0 | Keywords: | performance |
Target Milestone: | 2.0 F3 | ||
Hardware: | PC | ||
OS: | Windows 2000 | ||
Whiteboard: |
Description
Erich Gamma
2002-06-05 09:05:59 EDT
problem looks like an oversight. toString is always called first even when the element implements the WorkbenchAdapter. private boolean testName(Object object) { String nameFilter = config.getAttribute(ATT_NAME_FILTER); if (nameFilter == null) return true; String objectName = object.toString(); if (object instanceof IAdaptable) { We'll fix it. *** Bug 19115 has been marked as a duplicate of this bug. *** Made the following change. Old code: private boolean testName(Object object) { String nameFilter = config.getAttribute(ATT_NAME_FILTER); if (nameFilter == null) return true; String objectName = object.toString(); if (object instanceof IAdaptable) { IAdaptable element = (IAdaptable) object; IWorkbenchAdapter de = (IWorkbenchAdapter)element.getAdapter (IWorkbenchAdapter.class); if (de != null) objectName = de.getLabel(element); } return SelectionEnabler.verifyNameMatch(objectName, nameFilter); } New code: private boolean testName(Object object) { String nameFilter = config.getAttribute(ATT_NAME_FILTER); if (nameFilter == null) return true; String objectName = null; if (object instanceof IAdaptable) { IAdaptable element = (IAdaptable) object; IWorkbenchAdapter de = (IWorkbenchAdapter)element.getAdapter (IWorkbenchAdapter.class); if (de != null) objectName = de.getLabel(element); } if (objectName == null) { objectName = object.toString(); } return SelectionEnabler.verifyNameMatch(objectName, nameFilter); } Fixed in I-20020607. |