Bug 102819 - non correct advice for "field is never used locally"
Summary: non correct advice for "field is never used locally"
Status: RESOLVED WONTFIX
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.1   Edit
Hardware: PC All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-07-06 05:16 EDT by Igor Galchevsky CLA
Modified: 2005-07-06 10:52 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 Igor Galchevsky CLA 2005-07-06 05:16:57 EDT
public class Bug_NeverReadLocally {

	private String s;
        //             ^ eclipse says : "field s is never used locally"
	public Bug_NeverReadLocally(String s) {
		this.s = s;
	}

	public static void main(String[] args) {
		new Bug_NeverReadLocally("some string");
	}
}
Comment 1 Philipe Mulet CLA 2005-07-06 09:33:51 EDT
The diagnostic is for read accesses; i.e. in Eclipse 3.1, the message reads:
"The field X.s is never read locally".

Considering write accesses would lower the relevance of this diagnostic; i.e.
what's the value of the field if never read from ?


Comment 2 Igor Galchevsky CLA 2005-07-06 10:29:02 EDT
Hey, you are totally right :)
Comment 3 Philipe Mulet CLA 2005-07-06 10:52:02 EDT
Thanks for confirming it !