Skip to content

Commit

Permalink
dbeaver/pro#3407 Fix AbstractJdbcResultSet.getBigDecimal(int) to hand…
Browse files Browse the repository at this point in the history
…le empty strings

Ensure `getBigDecimal(int)` checks for empty strings before processing to avoid potential errors.
  • Loading branch information
Ivan Gagarkin authored and Ivan Gagarkin committed Oct 31, 2024
1 parent 13255a4 commit 3c2389e
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -619,7 +619,11 @@ public Reader getCharacterStream(int columnIndex) throws SQLException {
@Override

Check warning on line 619 in modules/com.dbeaver.jdbc.api/src/com/dbeaver/jdbc/model/AbstractJdbcResultSet.java

View workflow job for this annotation

GitHub Actions / Check / Lint

[checkstyle] reported by reviewdog 🐶 All overloaded methods should be placed next to each other. Previous overloaded method located at line '258'. Raw Output: /github/workspace/./modules/com.dbeaver.jdbc.api/src/com/dbeaver/jdbc/model/AbstractJdbcResultSet.java:619:5: warning: All overloaded methods should be placed next to each other. Previous overloaded method located at line '258'. (com.puppycrawl.tools.checkstyle.checks.coding.OverloadMethodsDeclarationOrderCheck)
public BigDecimal getBigDecimal(int columnIndex) throws SQLException {
final String value = getString(columnIndex);
return value != null ? new BigDecimal(value) : null;
if (value == null || value.trim().isEmpty()) {
return null;
}

return new BigDecimal(value);
}

@Override
Expand Down

0 comments on commit 3c2389e

Please sign in to comment.