Bug 40662 - Problem in detecting unused private fields
Summary: Problem in detecting unused private fields
Status: RESOLVED INVALID
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: 3.0 M3   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-07-23 12:10 EDT by Pascal Rapicault CLA
Modified: 2003-07-24 10:10 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 Pascal Rapicault CLA 2003-07-23 12:10:24 EDT
In the following case the field "i" is tagged has unused, whereas it is used in 
an assignment.

public class Foo {
	private int i;
	public bar(int i) {
		this.i = i;  
	} 
}
Comment 1 Philipe Mulet CLA 2003-07-23 17:24:58 EDT
It is never read from (which is what the warning tells you).
--> The private field Foo.i is never read locally

So you can discard all assignments to this field, and the field too.
Comment 2 Pascal Rapicault CLA 2003-07-24 10:10:35 EDT
There are days, where it's best to stay in bed.