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

Bug 370754

Summary: Closing a Sapphire diagram editor would clear up the all the diagram rendering context cache
Product: z_Archived Reporter: Shenxue Zhou <shenxue.zhou>
Component: SapphireAssignee: Shenxue Zhou <shenxue.zhou>
Status: CLOSED FIXED QA Contact:
Severity: blocker    
Priority: P1 CC: konstantin, ling.hao
Version: unspecified   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:

Description Shenxue Zhou CLA 2012-02-06 13:56:07 EST
If there are multiple Sapphire based diagram editors open, closing one would clear up the cache of all the diagram rendering context including the ones that are cached for other editors. This will result in NPE when executing context menus in other editors.
Comment 1 Konstantin Komissarchik CLA 2012-02-07 06:41:16 EST
When you fix this issue, please make sure to include additional information about the problem and the resolution in order for this to be verifiable.
Comment 2 Shenxue Zhou CLA 2012-02-07 13:37:01 EST
Here are the repro steps:

1. Open two Sapphire Diagram based editors
2. Closing one of them, and try to launch context menu in the other
3. You'll get an NPE.

The root cause was all Sapphire diagram based editors shared a static cache of all the DiagramRenderingContext. When an editor is closed, it also cleared up the cache thus causing other editors to lose their cached DiagramRenderingContext.

The fix is not to share the static DiagramRenderingContext cache. Instead, every editor instance hold its own DiagramRenderingContext cache. The cache will be disposed when the editor is closed.
Comment 3 Ling Hao CLA 2012-05-17 19:37:38 EDT
Verified via repro steps.