FindBugs的告诉我,我有以下错误:自动装箱错误
A primitive is boxed, and then immediately unboxed. This probably is due to a manual boxing in a place where an unboxed value is required, thus forcing the compiler to immediately undo the work of the boxing.
下面是相关代码:
...
String str= "10.0";
Double d = (str != null ? Double.valueOf(str) : new Double(0.0));
...
这是什么意思?我该如何解决呢?
您是否尝试将此行分割为多个,从而查看findbugs的哪一部分的确切含义? – ZeissS