New issue
Advanced search Search tips

Issue 663833 link

Starred by 1 user

Issue metadata

Status: Archived
Owner: ----
Closed: Jan 14
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 3
Type: Bug



Sign in to add a comment

Add a lint warning for variables that are only ever written and never read.

Project Member Reported by gsennton@chromium.org, Nov 9 2016

Issue description

With 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.
 
Cc: agrieve@chromium.org
Hey Andrew, I have no idea whether this is feasible, any thoughts? :P
Status: Available (was: Untriaged)
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.

Comment 3 by torne@chromium.org, 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 ;)
Project Member

Comment 4 by sheriffbot@chromium.org, Nov 10 2017

Labels: Hotlist-Recharge-Cold
Status: Untriaged (was: Available)
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

Comment 5 by cmasso@google.com, Feb 14 2018

Components: Build Infra
Components: -Infra
Not an infra issue.
Status: Archived (was: Untriaged)

Sign in to add a comment