Use Integer.parseInt instead of Integer.valueOf
As reported by FindBugs: "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." Change-Id: Ide32b9fd1432c9f0956dcb13971cf31c0b11e3aa
This commit is contained in:
@@ -164,8 +164,8 @@ public class QueryBuilder {
|
||||
try {
|
||||
// Can't use IntPredicate because it and IndexPredicate are different
|
||||
// subclasses of OperatorPredicate.
|
||||
value = Integer.valueOf(p.getValue());
|
||||
} catch (IllegalArgumentException e) {
|
||||
value = Integer.parseInt(p.getValue());
|
||||
} catch (NumberFormatException e) {
|
||||
throw new QueryParseException("not an integer: " + p.getValue());
|
||||
}
|
||||
return new TermQuery(intTerm(p.getField().getName(), value));
|
||||
|
Reference in New Issue
Block a user