| Summary: | 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 | ||
|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Lars Svensson <oxvalley> |
| Component: | Core | Assignee: | JDT-Core-Inbox <jdt-core-inbox> |
| Status: | NEW --- | QA Contact: | |
| Severity: | enhancement | ||
| Priority: | P3 | CC: | remy.suen, stephan.herrmann |
| Version: | 3.7 | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Windows Server 2003 | ||
| Whiteboard: | |||
|
Description
Lars Svensson
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. |