-
Notifications
You must be signed in to change notification settings - Fork 186
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
False Positive on "Dls dead local store" #63
Comments
Hello! Which version of FindBugs are you using? How do you launch it (Eclipse plugin? IDEA plugin? Hudson? Jenkins? Maven? Ant? Manually?). If possible, please attach the minimal source file which produces false positive. Also please paste exact FindBugs warning report (if possible, an excerpt from findbugs XML file). I cannot say for sure, but from your description it looks like you are looking on the old results. For example, you are using FindBugs in Eclipse IDE and did not switch on the automatic FindBugs launch on save, so it just shows you the message which was actual before you did some changes in the code. |
Here is the info you requested: |
I tried to reproduce it on my system, added missing classes see this gist: I see no findbugs reports (except the hardcoded filename) in this file. Can you reproduce it on your system with this file? If not, could you please provide a class file for your original code (ProfilePictureServiceImpl.class) which triggers the findbugs error? Thanks. |
@amaembo The official documentation for DLS_DEAD_LOCAL_STORE claims that "Sun's javac compiler often generates dead stores for final local variables. Because FindBugs is a bytecode-based tool, there is no easy way to eliminate these false positives." Maybe the version/brand of javac compiler matters when trying to reproduce this problem? (For the record, I cannot reproduce it with Oracle Java 1.8.0_101). |
This project continues development in a new home: https://github.com/spotbugs/spotbugs/ Please do not open new issues here anymore! |
Hi there! It appears i have a false positive on this warning. In my Android project, I try to make a file where i'm going to store some profile pictures. I'm doing this on a
singleton
service, inside astatic
method:The warning says I have a
dead local store
oncameraPhotoName
. I tried deleting the variable and just put it directly in thereturn
, like this:But it would point out that i have a
dead local store
intimeStamp
. Its seems that it doesnt like local variables! Thank you very much! CheersThe text was updated successfully, but these errors were encountered: