Perform NullAway build-time checks in more modules

This commit enables null-safety build-time checks in:
 - spring-jdbc
 - spring-r2dbc
 - spring-orm
 - spring-beans
 - spring-aop

See gh-32475
This commit is contained in:
Sébastien Deleuze
2024-03-26 09:55:41 +01:00
parent 3b4f8dbb8e
commit 5b660da52d
46 changed files with 78 additions and 12 deletions

View File

@@ -142,6 +142,7 @@ public abstract class AbstractRoutingConnectionFactory implements ConnectionFact
* @see #setTargetConnectionFactories(Map)
* @see #setDefaultTargetConnectionFactory(Object)
*/
@SuppressWarnings("NullAway")
public void initialize() {
Assert.notNull(this.targetConnectionFactories, "Property 'targetConnectionFactories' must not be null");
@@ -220,6 +221,7 @@ public abstract class AbstractRoutingConnectionFactory implements ConnectionFact
* per {@link #determineCurrentLookupKey()}
* @see #determineCurrentLookupKey()
*/
@SuppressWarnings("NullAway")
protected Mono<ConnectionFactory> determineTargetConnectionFactory() {
Assert.state(this.resolvedConnectionFactories != null, "ConnectionFactory router not initialized");

View File

@@ -383,6 +383,7 @@ final class DefaultDatabaseClient implements DatabaseClient {
return fetch().rowsUpdated().then();
}
@SuppressWarnings("NullAway")
private ResultFunction getResultFunction(Supplier<String> sqlSupplier) {
BiFunction<Connection, String, Statement> statementFunction = (connection, sql) -> {
if (logger.isDebugEnabled()) {

View File

@@ -75,6 +75,7 @@ class MapBindParameterSource implements BindParameterSource {
}
@Override
@SuppressWarnings("NullAway")
public Parameter getValue(String paramName) throws IllegalArgumentException {
if (!hasValue(paramName)) {
throw new IllegalArgumentException("No value registered for key '" + paramName + "'");