Skip to content

Commit

Permalink
chore: suppress deprecations from implementing deprecated ResultSet a…
Browse files Browse the repository at this point in the history
…nd Statement methods
  • Loading branch information
vlsi committed Mar 11, 2023
1 parent 4b29078 commit ca25d10
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,7 @@ public double getDouble(@Positive int parameterIndex) throws SQLException {
return (Double) result;
}

@SuppressWarnings("deprecation")
public @Nullable BigDecimal getBigDecimal(@Positive int parameterIndex, int scale) throws SQLException {
Object result = checkIndex(parameterIndex, Types.NUMERIC, "BigDecimal");
return (@Nullable BigDecimal) result;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -472,6 +472,7 @@ public void setAsciiStream(@Positive int parameterIndex, @Nullable InputStream x
setCharacterStreamPost71(parameterIndex, x, length, "ASCII");
}

@SuppressWarnings("deprecation")
public void setUnicodeStream(@Positive int parameterIndex, @Nullable InputStream x,
@NonNegative int length) throws SQLException {
checkClosed();
Expand Down
5 changes: 5 additions & 0 deletions pgjdbc/src/main/java/org/postgresql/jdbc/PgResultSet.java
Original file line number Diff line number Diff line change
Expand Up @@ -2150,6 +2150,7 @@ public BaseStatement getPGStatement() {

private @Nullable String refCursorName;

@SuppressWarnings("deprecation")
public @Nullable String getRefCursor() {
// Can't check this because the PGRefCursorResultSet
// interface doesn't allow throwing a SQLException
Expand Down Expand Up @@ -2722,6 +2723,7 @@ public double getDouble(@Positive int columnIndex) throws SQLException {
return toDouble(getFixedString(columnIndex));
}

@SuppressWarnings("deprecation")
public @Nullable BigDecimal getBigDecimal(
int columnIndex, int scale) throws SQLException {
connection.getLogger().log(Level.FINEST, " getBigDecimal columnIndex: {0}", columnIndex);
Expand Down Expand Up @@ -2842,6 +2844,7 @@ public double getDouble(@Positive int columnIndex) throws SQLException {
}

@Pure
@SuppressWarnings("deprecation")
public @Nullable InputStream getUnicodeStream(@Positive int columnIndex) throws SQLException {
connection.getLogger().log(Level.FINEST, " getUnicodeStream columnIndex: {0}", columnIndex);
byte[] value = getRawValue(columnIndex);
Expand Down Expand Up @@ -2922,6 +2925,7 @@ public double getDouble(String columnName) throws SQLException {
}

@Pure
@SuppressWarnings("deprecation")
public @Nullable BigDecimal getBigDecimal(String columnName, int scale) throws SQLException {
return getBigDecimal(findColumn(columnName), scale);
}
Expand Down Expand Up @@ -2952,6 +2956,7 @@ public double getDouble(String columnName) throws SQLException {
}

@Pure
@SuppressWarnings("deprecation")
public @Nullable InputStream getUnicodeStream(String columnName) throws SQLException {
return getUnicodeStream(findColumn(columnName));
}
Expand Down

0 comments on commit ca25d10

Please sign in to comment.