Bug 318678 - Enhancement request: If I declare a field and only use that field inside one method, I would like a warning that this could be a local variable instead
Summary: Enhancement request: If I declare a field and only use that field inside one ...
Status: NEW
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.7   Edit
Hardware: PC Windows Server 2003
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-07-02 04:58 EDT by Lars Svensson CLA
Modified: 2010-07-04 18:30 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Lars Svensson CLA 2010-07-02 04:58:33 EDT
Build Identifier: 

This could be an optional setting under Compiler-> Errors/Warnings

Reproducible: Always
Comment 1 Stephan Herrmann CLA 2010-07-04 18:30:27 EDT
This warning would only be valid if the first access to the field
within the method is a write access. If state is preserved across 
method invocations it must stay as a field.

To me this sounds like a bit too much special-case analysis for the compiler.
My 2c.