Add a lint warning for variables that are only ever written and never read. |
||||||
Issue descriptionWith https://codereview.chromium.org/2493543002/ we want to remove the proguard optimization that removes write-only variables (because that optimization can remove static variables - which developers assume will remain in a program throughout the program's lifetime). If possible/feasible, we should add a lint warning for variables that are never read.
,
Nov 9 2016
Had a quick look, and found that ecj (eclipse compiler) has this warning, but javac does not. I don't think this would really be a replacement for proguard's optimization pass since proguard removes dead code, which in turn make more fields become write-only.
,
Nov 10 2016
Yeah, now that I thought about this more it seems less likely to be valuable than I thought as you said, because probably very few of them are actually write-only in the source (though some might be). If there's a reasonably achievable way to do this (in findbugs or something) then it wouldn't be a bad idea to enable it, since it might well catch bugs, but I'm not sure it's worth any significant effort to actually implement. Feel free to just wontfix if you don't think this is likely ;)
,
Nov 10 2017
This issue has been Available for over a year. If it's no longer important or seems unlikely to be fixed, please consider closing it out. If it is important, please re-triage the issue. Sorry for the inconvenience if the bug really should have been left as Available. If you change it back, also remove the "Hotlist-Recharge-Cold" label. For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
,
Feb 14 2018
,
Feb 15 2018
Not an infra issue.
,
Jan 14
|
||||||
►
Sign in to add a comment |
||||||
Comment 1 by gsennton@chromium.org
, Nov 9 2016