Skip to content

Commit

Permalink
Nullability refinements
Browse files Browse the repository at this point in the history
  • Loading branch information
sdeleuze committed Mar 19, 2024
1 parent 71a117c commit aa0fb97
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ protected MockSpringFactoriesLoader(@Nullable ClassLoader classLoader,


@Override
@Nullable
@SuppressWarnings("unchecked")
protected <T> T instantiateFactory(String implementationName, Class<T> type,
@Nullable ArgumentResolver argumentResolver, FailureHandler failureHandler) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ protected CollectionDelegate(Class<?> collectionType, CodeBlock emptyResult) {

@Override
@SuppressWarnings("unchecked")
@Nullable
public CodeBlock generateCode(ValueCodeGenerator valueCodeGenerator, Object value) {
if (this.collectionType.isInstance(value)) {
T collection = (T) value;
Expand Down Expand Up @@ -135,6 +136,7 @@ public static class MapDelegate implements Delegate {
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()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

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}.
Expand All @@ -28,7 +29,7 @@
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");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ public List<V> get(Object key) {
}

@Override
@Nullable
public V getFirst(K key) {
return this.delegate.getFirst(key);
}
Expand Down

0 comments on commit aa0fb97

Please sign in to comment.