Bug 64499 - Compiler reports unused var, but it is used
Summary: Compiler reports unused var, but it is used
Status: RESOLVED INVALID
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.0   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-05-28 03:48 EDT by Silenio Quarti CLA
Modified: 2004-10-27 06:45 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Silenio Quarti CLA 2004-05-28 03:48:07 EDT
build 200405272000 (but I have seen this in previous builds)

1) Enable warnings for "Unused local variables"
2) Load the org.eclipse.swt from CVS
3) rename .classpath_carbon to .classpath

There is a warning in org.eclipse.swt.graphics.TextLayout.getLineBounds(int) 
saying that the var "start" is not used, but the var is assigned inside the 
for loop.
Comment 1 Philipe Mulet CLA 2004-05-28 05:25:06 EDT
The setting is "Local variable is never read". 
So if this is the only access to the variable, then it is a dead assignment, 
and you could simply discard the variable altogether, it shouldn't make any 
difference (except if you need the intermediate variable for debug purpose - 
when suspended in debugger, and browsing existing variable values).

Ok to close ?
Comment 2 Silenio Quarti CLA 2004-05-28 11:19:00 EDT
Yeap, I should have look at the code closer.