Summary: | Suggesting new compiler warning: This method will always return null (false); | ||
---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | Lars Svensson <oxvalley> |
Component: | Core | Assignee: | JDT-Core-Inbox <jdt-core-inbox> |
Status: | VERIFIED WONTFIX | QA Contact: | |
Severity: | normal | ||
Priority: | P3 | CC: | daniel_megert, markus.kell.r, Olivier_Thomann, remy.suen |
Version: | 3.7 | ||
Target Milestone: | 3.7 M1 | ||
Hardware: | All | ||
OS: | All | ||
Whiteboard: |
Description
Lars Svensson
2010-07-07 06:48:24 EDT
"return null;" is also often exactly what is intended. This warning would yield so many false positives that it would be useless. If you really want to see all these places, you can perform a simple text search. A solution for you could be to avoid generating such default return statements in the first place: On "Preferences > Java > Code Style > Templates", remove ${body_statement} from the "Method body" template. I think a check with not too much false positives could be to report a problem if the method has a single 'return null;' along with other statements. Verified. |