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

Bug 119491

Summary: dangerous uses of "new GC(Display)"
Product: [Eclipse Project] JDT Reporter: Andre Weinand <andre_weinand>
Component: TextAssignee: JDT-Text-Inbox <jdt-text-inbox>
Status: VERIFIED FIXED QA Contact:
Severity: major    
Priority: P3    
Version: 3.2   
Target Milestone: 3.2 M4   
Hardware: All   
OS: All   
Whiteboard:

Description Andre Weinand CLA 2005-12-06 15:19:26 EST
a "new GC(Display)" is a very expensive operation on some platforms because it has to create an overlay window for the whole screen to allow for fullscreen drawing.

If the GC is not used for fullscreen drawing but only for getting some FontMetrics, it should be replaced by a "new GC(Shell)" or better by a "new GC(Control)".

See bug #38528 for details.

I've found this occurrence in JDT/UI:

CodeAssistConfigurationBlockInProgress.computeWidth(...)
Comment 1 Dani Megert CLA 2005-12-08 04:15:58 EST
Fixed in HEAD.
Comment 2 Tobias Widmer CLA 2005-12-13 06:04:28 EST
Verified using I20051213-0010