Bug 22618

Summary: incorrect warning about unread vars
Product: [Eclipse Project] JDT Reporter: Adam Kiezun <akiezun>
Component: CoreAssignee: Philipe Mulet <philippe_mulet>
Status: RESOLVED WONTFIX QA Contact:
Severity: minor    
Priority: P3    
Version: 2.0   
Target Milestone: 2.1 M2   
Hardware: PC   
OS: Windows 2000   
Whiteboard:

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.