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

Bug 329813

Summary: [Forms] Compiler warnings in N20101108-2000 build in ui.forms
Product: [Eclipse Project] Platform Reporter: Olivier Thomann <Olivier_Thomann>
Component: User AssistanceAssignee: Chris Goldthorpe <cgold>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: daniel_megert, pwebster
Version: 3.7   
Target Milestone: 3.7 M4   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Attachments:
Description Flags
Patch for TableWrapLayout
none
Patch for Section
none
Patch for TextSection none

Description Olivier Thomann CLA 2010-11-09 10:22:04 EST
1. WARNING in /src/org/eclipse/ui/forms/widgets/Section.java
 (at line 367)
int twidth = bounds.width - marginWidth - marginWidth;
The value of the local variable twidth is not used

1. WARNING in /src/org/eclipse/ui/forms/widgets/TableWrapLayout.java
 (at line 254)
int colSpace = tableWidth - leftMargin - rightMargin;
The value of the local variable colSpace is not used

1. WARNING in /src/org/eclipse/ui/internal/forms/widgets/TextSegment.java
 (at line 665)
int lineWidth = locator.x + lineExtent.x;
The value of the local variable lineWidth is not used
Comment 1 Chris Goldthorpe CLA 2010-11-10 20:25:36 EST
Created attachment 182864 [details]
Patch for TableWrapLayout

colSpace was unused. It seems that the intention was to have a line

int colSpace = parentWidth - maxWidth;

instead of

int extra = parentWidth - maxWidth;

however if I do that the columns get narrower than they should be. As the code is the widths are correct when the path goes through this code. Deleting the lines which set colSpace.
Comment 2 Chris Goldthorpe CLA 2010-11-11 13:25:09 EST
Created attachment 182927 [details]
Patch for Section

twidth has been unused since at least Eclipse 3.3. I have removed twidth and its assignments.
Comment 3 Chris Goldthorpe CLA 2010-11-11 13:31:43 EST
Created attachment 182929 [details]
Patch for TextSection

The unused variable lineWidth is calculated in much the same way as lastWidth which is used. Removing lineWidth.
Comment 4 Chris Goldthorpe CLA 2010-11-11 13:32:39 EST
The three patches have been committed to HEAD, Fixed.
Comment 5 Dani Megert CLA 2010-11-12 04:39:45 EST
Verified in N20101111-2000.