Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 352399 - SWTGraphics.checkPaint always applies line attributes
Summary: SWTGraphics.checkPaint always applies line attributes
Status: RESOLVED DUPLICATE of bug 337263
Alias: None
Product: GEF
Classification: Tools
Component: GEF-Legacy Draw2d (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: gef-inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-07-18 20:41 EDT by Peter Severin CLA
Modified: 2011-07-19 01:14 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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 ***