Bug 28365 - [JFace] JFaceColors should reuse Colors
Summary: [JFace] JFaceColors should reuse Colors
Status: CLOSED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 2.1   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: 2.1 RC1   Edit
Assignee: Tod Creasey CLA
QA Contact:
URL:
Whiteboard:
Keywords: performance
: 28274 28275 (view as bug list)
Depends on:
Blocks:
 
Reported: 2002-12-16 07:03 EST by Adam Kiezun CLA
Modified: 2005-05-10 14:53 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Adam Kiezun CLA 2002-12-16 07:03:35 EST
20021213
JFaceColors allocates a new Color everytime i ask for the same thing

test case for the Sleak tool:
open a build.properties editor
close
SNAP
open again
close
DIFF

2 new Colors are allocated - both in JFaceColors
at org.eclipse.jface.resource.JFaceColors.getColorSetting(Unknown Source)
at org.eclipse.jface.resource.JFaceColors.getActiveHyperlinkText(Unknown Source)

and 
at org.eclipse.jface.resource.JFaceColors.getColorSetting(Unknown Source)
at org.eclipse.jface.resource.JFaceColors.getHyperlinkText(Unknown Source)

so i seems that everytime someone asks JFaceColors for any color they get a new 
instance. clients don't create them so they do not dispose them. it should be 
possible to reuse them.

why aren't they reused? - allocating them anew everytime is suboptimal
Comment 1 Tod Creasey CLA 2003-02-13 10:15:30 EST
*** Bug 28274 has been marked as a duplicate of this bug. ***
Comment 2 Tod Creasey CLA 2003-02-13 10:16:14 EST
*** Bug 28274 has been marked as a duplicate of this bug. ***
Comment 3 John Arthorne CLA 2003-02-13 10:51:44 EST
*** Bug 28275 has been marked as a duplicate of this bug. ***
Comment 4 Tod Creasey CLA 2003-02-13 12:10:36 EST
Caching was there but the lookup was wrong. Also fixed an update in 
PreferenceConvertor.

Fixed in build >20030213
Comment 5 Tod Creasey CLA 2005-05-10 14:53:59 EDT
Marking as closed.