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

Bug 297223

Summary: Shape#getLineStyle() overrides LineAttributes
Product: [Tools] GEF Reporter: Falko Schumann <falko.schumann>
Component: GEF-Legacy Draw2dAssignee: Alexander Nyßen <nyssen>
Status: RESOLVED FIXED QA Contact:
Severity: major    
Priority: P3 CC: nyssen
Version: unspecified   
Target Milestone: 3.7.1 (Indigo) M5   
Hardware: All   
OS: All   
Whiteboard:

Description Falko Schumann CLA 2009-12-08 11:03:52 EST
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.9.1.5) Gecko/20091102 Firefox/3.5.5
Build Identifier: 20090920-1017

The method Shape#getLineStyle() overrides LineAttributes set by Shape#setLineAttributes(LineAttributes).

The similar method Shape#getLineWidth() knows last state and works properly.

Reproducible: Always

Steps to Reproduce:
1. create LineAttributes with lineStyle other than solid
2. set LineAttributes with Shape#setLineAttributes(LineAttributes)
3. Shape#getLineStyle() return solid
Comment 1 Alexander Nyßen CLA 2011-01-16 17:08:54 EST
Introduced a private lastLineStyle field to keep track of changes to the protected lineStyle field, and implemented similar mechanism as for lineWidth based on it. Deprecated lineWidth and lineStyle fields, because clients should rather use the setters or access the line attributes. Added a test case to assert the line style no longer gets overwritten.

Changes committed to cvs HEAD (3.7). Resolving as fixed.