Bug 22618 - incorrect warning about unread vars
Summary: incorrect warning about unread vars
Status: RESOLVED WONTFIX
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows 2000
: P3 minor (vote)
Target Milestone: 2.1 M2   Edit
Assignee: Philipe Mulet CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-08-21 04:56 EDT by Adam Kiezun CLA
Modified: 2002-09-23 06:00 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 Adam Kiezun CLA 2002-08-21 04:56:10 EDT
void f(String par){
    	String var;
    	if ((var= par).length() == 0){}
    }

you get a warning that var is not read. 
it is, however, first assigned to and then read.
Comment 1 Philipe Mulet CLA 2002-09-23 06:00:37 EDT
No, technically, it is assigned and not read from (the stored value is dup'ed 
and left on the stack - this is a bytecode optimization).

An assignment is only an assignment.

Closing, working as expected.