Bug 569876

Summary: Unnecessary conversion to Array within DecoratorManager#getDecoratorsFor(Object element)
Product: [Eclipse Project] Platform Reporter: Markus Wittig <wittigmarkus>
Component: UIAssignee: Platform-UI-Inbox <Platform-UI-Inbox>
Status: NEW --- QA Contact:
Severity: major    
Priority: P3 CC: Lars.Vogel
Version: 4.15   
Target Milestone: ---   
Hardware: PC   
OS: Windows 10   
Whiteboard:

Description Markus Wittig CLA 2020-12-22 10:12:30 EST
The refresh of an "org.eclipse.jface.viewers.ViewerColumn" is done by an instance of the "DecoratingStyledCellLabelProvider" (for example the "Project Explorer View"). It uses the "org.eclipse.ui.internal.decorators.DecoratorManager" to retrieve the "FullDecoratorDefinition"s used for the text and images of the tree items. For that the Method "FullDecoratorDefinition[] getDecoratorsFor(Object element)" is used which creates a new array instead of just returning the Collection that is already retrieved by calling "getDecoratorsFor(Object element, DecoratorDefinition[] enabledDefinitions)". If there are many tree items it is a downer for the performance because it is done multiple times for each tree item and every time a new array is created with no benefit. It should return the already retrieved Collection and should not create a new array.
Comment 1 Lars Vogel CLA 2020-12-22 11:26:25 EST
Can you provide a Gerrit?