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:
David Pursehouse
2015-03-13 14:32:41 +09:00
parent 6b498cdcb2
commit b4ea0fe5aa
2 changed files with 4 additions and 4 deletions

View File

@@ -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));