Bug 510826 - getSectionGradientImage in FormImages always returns a new image although it already has one in the cache
Summary: getSectionGradientImage in FormImages always returns a new image although it ...
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.7   Edit
Hardware: PC Windows NT
: P3 normal (vote)
Target Milestone: 4.7 M6   Edit
Assignee: Ralf Petter CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 510228 510830
  Show dependency tree
 
Reported: 2017-01-22 05:34 EST by Ralf Petter CLA
Modified: 2017-02-01 05:33 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ralf Petter CLA 2017-01-22 05:34:35 EST
The getSectionGradientImage in org.eclipse.ui.internal.forms.widgets.FormImages has code to cache created gradient images, but this does not work because the equals method of the nested private class SimpleSectionImageDescriptor is not implemented properly. The method should check whether the parameter is instance of SimpleSectionImageDescriptor and not SimpleImageDescriptor. I think this is a copy&paste error.

I have written a JUnit test to check for this problem and provided a improved version of FormImages to correct this problem. This fix is also needed to fix Bug 510228
Comment 1 Ralf Petter CLA 2017-01-22 05:55:28 EST
I have made some performance tests and this patch improves the performance of resize operations on a simple shell with a form and a section by approximately 13%.
Comment 2 Ralf Petter CLA 2017-01-22 12:34:33 EST
New Gerrit change created: https://git.eclipse.org/r/89292/
Comment 4 Lars Vogel CLA 2017-02-01 05:29:38 EST
Thanks Ralf. Looks good to me, all Unit tests except FormColorsTests are green. FormColorsTests fails already before this patch.