Android findBugs
1.Bug:DM_BOXED_PRIMITIVE_FOR_PARSING
"Boxing/unboxing to parse a primitive", A boxed primitive is created from a String, just to extract the unboxed primitive value. It is more efficient to just call the static parseXXX method
原因:装箱和拆箱的问题,把一个字符串装箱,解析获取箱子中原始值。更有效率就是使用静态方法,parseXXX 方法。
原始代码:Integer.valueOf(okNums) == 0
修改后的代码:Integer.parseInt(okNums) == 0
直面挑战,躬身入局