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

posted @ 2016-08-15 11:15  熠然  阅读(2741)  评论(0编辑  收藏  举报