Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8274234: Remove unnecessary boxing via primitive wrapper valueOf(String) methods in java.sql.rowset

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
@@ -1805,7 +1805,7 @@ public byte getByte(int columnIndex) throws SQLException {
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 short getShort(int columnIndex) throws SQLException {
}

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 int getInt(int columnIndex) throws SQLException {
}

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 long getLong(int columnIndex) throws SQLException {
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 @@ private int getIntegerValue(String s) {
}

private boolean getBooleanValue(String s) {

return Boolean.valueOf(s).booleanValue();
return Boolean.parseBoolean(s);
}

private java.math.BigDecimal getBigDecimalValue(String s) {