Getting below bug in findbug:
A boxed value is unboxed and then immediately reboxed Below is the statement:
deliveryCost = new Double(cost);
where cost
is float type.
Kindly suggest.
Getting below bug in findbug:
A boxed value is unboxed and then immediately reboxed Below is the statement:
deliveryCost = new Double(cost);
where cost
is float type.
Kindly suggest.
That message is a little odd. I'm not sure exactly why you're getting it. But one thing you should change is this:
deliveryCost = Double.valueOf(cost);
See if the message goes away when you do that. When you say new Double(...)
it's like telling java, "please, allocate a brand new object for me, even if you can reuse one and get the same effect". It's usually not necessary to do.