Looks like a bug in FindBugs for me. If you compile this code and then run javap -c , it never calls doubleValue() , which is usually used for unpacking.
Admittedly, you can use a cached Double for zero, rather than allocating it every time this is done, but other than that, it looks reasonable to me ...
I suggest you inform the FindBugs team about this.
EDIT: Before reporting this to the FindBugs team, I update your question with a short but complete program that demonstrates the problem. I took your word for the fact that the code that you showed us is the code referenced by FindBugs. If this is not the case, all bets are disabled :)
source share