Nullability refinements

See gh-32475
This commit is contained in:
Sébastien Deleuze 2024-03-19 13:30:46 +01:00
parent 71a117c0fd
commit aa0fb97ba5
4 changed files with 6 additions and 1 deletions

View File

@ -67,6 +67,7 @@ public class MockSpringFactoriesLoader extends SpringFactoriesLoader {
@Override
@Nullable
@SuppressWarnings("unchecked")
protected <T> T instantiateFactory(String implementationName, Class<T> type,
@Nullable ArgumentResolver argumentResolver, FailureHandler failureHandler) {

View File

@ -94,6 +94,7 @@ public abstract class ValueCodeGeneratorDelegates {
@Override
@SuppressWarnings("unchecked")
@Nullable
public CodeBlock generateCode(ValueCodeGenerator valueCodeGenerator, Object value) {
if (this.collectionType.isInstance(value)) {
T collection = (T) value;
@ -135,6 +136,7 @@ public abstract class ValueCodeGeneratorDelegates {
private static final CodeBlock EMPTY_RESULT = CodeBlock.of("$T.emptyMap()", Collections.class);
@Override
@Nullable
public CodeBlock generateCode(ValueCodeGenerator valueCodeGenerator, Object value) {
if (value instanceof Map<?, ?> map) {
if (map.isEmpty()) {

View File

@ -18,6 +18,7 @@ package org.springframework.aot.hint.support;
import org.springframework.aot.hint.RuntimeHints;
import org.springframework.aot.hint.RuntimeHintsRegistrar;
import org.springframework.lang.Nullable;
/**
* {@link RuntimeHintsRegistrar} to register hints for {@link org.springframework.core.SpringProperties}.
@ -28,7 +29,7 @@ import org.springframework.aot.hint.RuntimeHintsRegistrar;
class SpringPropertiesRuntimeHints implements RuntimeHintsRegistrar {
@Override
public void registerHints(RuntimeHints hints, ClassLoader classLoader) {
public void registerHints(RuntimeHints hints, @Nullable ClassLoader classLoader) {
hints.resources().registerPattern("spring.properties");
}
}

View File

@ -96,6 +96,7 @@ final class UnmodifiableMultiValueMap<K,V> implements MultiValueMap<K,V>, Serial
}
@Override
@Nullable
public V getFirst(K key) {
return this.delegate.getFirst(key);
}