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

Bug 352399

Summary: SWTGraphics.checkPaint always applies line attributes
Product: [Tools] GEF Reporter: Peter Severin <peter>
Component: GEF-Legacy Draw2dAssignee: gef-inbox <gef-inbox>
Status: RESOLVED DUPLICATE QA Contact:
Severity: normal    
Priority: P3 CC: nyssen
Version: unspecified   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:

Description Peter Severin CLA 2011-07-18 20:41:23 EDT
Build Identifier: 

SWTGraphics.checkPaint uses the following optimization to prevent unnecessary GC calls:

		LineAttributes lineAttributes = currentState.lineAttributes;
		if (!appliedState.lineAttributes.equals(lineAttributes)) {

But since LineAttributes class does not have an equals method the condition always evaluates to true.

Reproducible: Always
Comment 1 Peter Severin CLA 2011-07-18 20:58:02 EDT
Forgot to mention that besides unnecessary calls to GC this bug also generates heap garbage by creating a new LineAttributes object on each call.
Comment 2 Alexander Nyßen CLA 2011-07-19 01:14:35 EDT
Peter, I came across this as well during 3.7 development. Therefore I filed bug #337263, so that in SWT 3.7, LineAttributes does now provide an equals() method.

*** This bug has been marked as a duplicate of bug 337263 ***