Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 329813 - [Forms] Compiler warnings in N20101108-2000 build in ui.forms
Summary: [Forms] Compiler warnings in N20101108-2000 build in ui.forms
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: User Assistance (show other bugs)
Version: 3.7   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: 3.7 M4   Edit
Assignee: Chris Goldthorpe CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-11-09 10:22 EST by Olivier Thomann CLA
Modified: 2010-11-12 04:39 EST (History)
2 users (show)

See Also:


Attachments
Patch for TableWrapLayout (1.84 KB, patch)
2010-11-10 20:25 EST, Chris Goldthorpe CLA
no flags Details | Diff
Patch for Section (994 bytes, patch)
2010-11-11 13:25 EST, Chris Goldthorpe CLA
no flags Details | Diff
Patch for TextSection (1.04 KB, patch)
2010-11-11 13:31 EST, Chris Goldthorpe CLA
no flags Details | Diff

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