Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 282640

Summary: WorkbenchColors should not be disposed
Product: [RT] RAP Reporter: Igor Pavlenko <dopperst>
Component: WorkbenchAssignee: Project Inbox <rap-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 1.2   
Target Milestone: 1.3 M1   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
Patch to fix the bug
none
patch none

Description Igor Pavlenko CLA 2009-07-07 05:12:50 EDT
Created attachment 140941 [details]
Patch to fix the bug

Look at the org.eclipse.ui.internal.WorkbenchColors. There is an error that sometimes causes NPE in my application.

There is a static array. It is used to store (for what?) some resources (of type Color).

This class should be reimplemented with some additional synchronization. Or, alternatively, it is possible not to dispose resources (and not to reassign array variable with null value).

I fix it with the second approach.
Comment 1 Benjamin Muskalla CLA 2009-07-21 12:07:44 EDT
Instead of synchronizing the access I think we should remove the whole story of reallocating colors. This makes no sense in RAP as we don't allocate real resources.
Comment 2 Benjamin Muskalla CLA 2009-08-07 17:51:30 EDT
Created attachment 143811 [details]
patch

As suggested, I'd rather go the path to remove the whole color-preallocation story as this is not needed in RAP (and will not even be needed in case of color constructors). This also simplifies and lightens the workbench startup instead of adding another case that needs proper synchronization.
Comment 3 Benjamin Muskalla CLA 2009-08-09 17:00:07 EDT
Applied patch from comment #2 to CVS HEAD and added a small comment.