Skip to content

Commit 7766ea5

Browse files
committed
Fix NullAway suppression in DataSourceHealthIndicator
See gh-46587
1 parent c211b88 commit 7766ea5

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

module/spring-boot-jdbc/src/main/java/org/springframework/boot/jdbc/health/DataSourceHealthIndicator.java

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -175,13 +175,9 @@ public Object mapRow(ResultSet rs, int rowNum) throws SQLException {
175175
if (columns != 1) {
176176
throw new IncorrectResultSetColumnCountException(1, columns);
177177
}
178-
return getResultSetValue(rs);
179-
}
180-
181-
// RowMapper.mapRow isn't defined as @Nullable return type
182-
@SuppressWarnings("NullAway")
183-
private Object getResultSetValue(ResultSet rs) throws SQLException {
184-
return JdbcUtils.getResultSetValue(rs, 1);
178+
Object result = JdbcUtils.getResultSetValue(rs, 1);
179+
Assert.state(result != null, "'result' must not be null");
180+
return result;
185181
}
186182

187183
}

0 commit comments

Comments
 (0)