mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 07:14:30 +02:00
8274234: Remove unnecessary boxing via primitive wrapper valueOf(String) methods in java.sql.rowset
Reviewed-by: lancea, bpb
This commit is contained in:
parent
f36a2bbd15
commit
f214d6e873
2 changed files with 6 additions and 7 deletions
|
@ -1805,7 +1805,7 @@ public class CachedRowSetImpl extends BaseRowSet implements RowSet, RowSetIntern
|
|||
return (byte)0;
|
||||
}
|
||||
try {
|
||||
return ((Byte.valueOf(value.toString())).byteValue());
|
||||
return Byte.parseByte(value.toString());
|
||||
} catch (NumberFormatException ex) {
|
||||
throw new SQLException(MessageFormat.format(resBundle.handleGetObject("cachedrowsetimpl.bytefail").toString(),
|
||||
new Object[] {value.toString().trim(), columnIndex}));
|
||||
|
@ -1849,7 +1849,7 @@ public class CachedRowSetImpl extends BaseRowSet implements RowSet, RowSetIntern
|
|||
}
|
||||
|
||||
try {
|
||||
return ((Short.valueOf(value.toString().trim())).shortValue());
|
||||
return Short.parseShort(value.toString().trim());
|
||||
} catch (NumberFormatException ex) {
|
||||
throw new SQLException(MessageFormat.format(resBundle.handleGetObject("cachedrowsetimpl.shortfail").toString(),
|
||||
new Object[] {value.toString().trim(), columnIndex}));
|
||||
|
@ -1892,7 +1892,7 @@ public class CachedRowSetImpl extends BaseRowSet implements RowSet, RowSetIntern
|
|||
}
|
||||
|
||||
try {
|
||||
return ((Integer.valueOf(value.toString().trim())).intValue());
|
||||
return Integer.parseInt(value.toString().trim());
|
||||
} catch (NumberFormatException ex) {
|
||||
throw new SQLException(MessageFormat.format(resBundle.handleGetObject("cachedrowsetimpl.intfail").toString(),
|
||||
new Object[] {value.toString().trim(), columnIndex}));
|
||||
|
@ -1935,7 +1935,7 @@ public class CachedRowSetImpl extends BaseRowSet implements RowSet, RowSetIntern
|
|||
return (long)0;
|
||||
}
|
||||
try {
|
||||
return ((Long.valueOf(value.toString().trim())).longValue());
|
||||
return Long.parseLong(value.toString().trim());
|
||||
} catch (NumberFormatException ex) {
|
||||
throw new SQLException(MessageFormat.format(resBundle.handleGetObject("cachedrowsetimpl.longfail").toString(),
|
||||
new Object[] {value.toString().trim(), columnIndex}));
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2003, 2021, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
|
@ -982,8 +982,7 @@ public class XmlReaderContentHandler extends DefaultHandler {
|
|||
}
|
||||
|
||||
private boolean getBooleanValue(String s) {
|
||||
|
||||
return Boolean.valueOf(s).booleanValue();
|
||||
return Boolean.parseBoolean(s);
|
||||
}
|
||||
|
||||
private java.math.BigDecimal getBigDecimalValue(String s) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue