Skip to content

Commit 8b51b36

Browse files
committed
Perform NullAway build-time checks in more modules
This commit enables null-safety build-time checks in all remaining modules except spring-test. See spring-projectsgh-32475
1 parent 2fea3d7 commit 8b51b36

File tree

53 files changed

+93
-31
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+93
-31
lines changed

gradle/spring-module.gradle

+3-4
Original file line numberDiff line numberDiff line change
@@ -117,12 +117,11 @@ tasks.withType(JavaCompile).configureEach {
117117
options.errorprone {
118118
disableAllChecks = true
119119
option("NullAway:CustomContractAnnotations", "org.springframework.lang.Contract")
120-
option("NullAway:AnnotatedPackages", "org.springframework.core,org.springframework.expression," +
121-
"org.springframework.web,org.springframework.jms,org.springframework.messaging,org.springframework.jdbc," +
122-
"org.springframework.r2dbc,org.springframework.orm,org.springframework.beans,org.springframework.aop")
120+
option("NullAway:AnnotatedPackages", "org.springframework")
123121
option("NullAway:UnannotatedSubPackages", "org.springframework.instrument,org.springframework.context.index," +
124122
"org.springframework.asm,org.springframework.cglib,org.springframework.objenesis," +
125-
"org.springframework.javapoet,org.springframework.aot.nativex.substitution,org.springframework.aot.nativex.feature")
123+
"org.springframework.javapoet,org.springframework.aot.nativex.substitution,org.springframework.aot.nativex.feature," +
124+
"org.springframework.test,org.springframework.mock")
126125
}
127126
}
128127
tasks.compileJava {

spring-context-support/src/main/java/org/springframework/cache/jcache/interceptor/CacheResultInterceptor.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ protected void cacheException(@Nullable Cache exceptionCache, ExceptionTypeFilte
101101
private Cache resolveExceptionCache(CacheOperationInvocationContext<CacheResultOperation> context) {
102102
CacheResolver exceptionCacheResolver = context.getOperation().getExceptionCacheResolver();
103103
if (exceptionCacheResolver != null) {
104-
return extractFrom(context.getOperation().getExceptionCacheResolver().resolveCaches(context));
104+
return extractFrom(exceptionCacheResolver.resolveCaches(context));
105105
}
106106
return null;
107107
}

spring-context-support/src/main/java/org/springframework/cache/jcache/interceptor/DefaultJCacheOperationSource.java

+3
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,7 @@ protected <T> T getBean(Class<T> type) {
188188
}
189189
}
190190

191+
@SuppressWarnings("NullAway")
191192
protected CacheManager getDefaultCacheManager() {
192193
if (getCacheManager() == null) {
193194
Assert.state(this.beanFactory != null, "BeanFactory required for default CacheManager resolution");
@@ -207,6 +208,7 @@ protected CacheManager getDefaultCacheManager() {
207208
}
208209

209210
@Override
211+
@SuppressWarnings("NullAway")
210212
protected CacheResolver getDefaultCacheResolver() {
211213
if (getCacheResolver() == null) {
212214
this.cacheResolver = SingletonSupplier.of(new SimpleCacheResolver(getDefaultCacheManager()));
@@ -215,6 +217,7 @@ protected CacheResolver getDefaultCacheResolver() {
215217
}
216218

217219
@Override
220+
@SuppressWarnings("NullAway")
218221
protected CacheResolver getDefaultExceptionCacheResolver() {
219222
if (getExceptionCacheResolver() == null) {
220223
this.exceptionCacheResolver = SingletonSupplier.of(new LazyCacheResolver());

spring-context-support/src/main/java/org/springframework/scheduling/quartz/LocalDataSourceJobStore.java

+1
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ public class LocalDataSourceJobStore extends JobStoreCMT {
9090

9191

9292
@Override
93+
@SuppressWarnings("NullAway")
9394
public void initialize(ClassLoadHelper loadHelper, SchedulerSignaler signaler) throws SchedulerConfigException {
9495
// Absolutely needs thread-bound DataSource to initialize.
9596
this.dataSource = SchedulerFactoryBean.getConfigTimeDataSource();

spring-context-support/src/main/java/org/springframework/scheduling/quartz/SchedulerAccessor.java

+1
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,7 @@ public void setResourceLoader(ResourceLoader resourceLoader) {
203203
/**
204204
* Register jobs and triggers (within a transaction, if possible).
205205
*/
206+
@SuppressWarnings("NullAway")
206207
protected void registerJobsAndTriggers() throws SchedulerException {
207208
TransactionStatus transactionStatus = null;
208209
if (this.transactionManager != null) {

spring-context-support/src/main/java/org/springframework/scheduling/quartz/SchedulerFactoryBean.java

+1
Original file line numberDiff line numberDiff line change
@@ -661,6 +661,7 @@ private Scheduler prepareScheduler(SchedulerFactory schedulerFactory) throws Sch
661661
* @see #afterPropertiesSet
662662
* @see org.quartz.SchedulerFactory#getScheduler
663663
*/
664+
@SuppressWarnings("NullAway")
664665
protected Scheduler createScheduler(SchedulerFactory schedulerFactory, @Nullable String schedulerName)
665666
throws SchedulerException {
666667

spring-context/src/main/java/org/springframework/context/annotation/BeanMethod.java

+1
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ final class BeanMethod extends ConfigurationMethod {
4343

4444

4545
@Override
46+
@SuppressWarnings("NullAway")
4647
public void validate(ProblemReporter problemReporter) {
4748
if ("void".equals(getMetadata().getReturnTypeName())) {
4849
// declared as void: potential misuse of @Bean, maybe meant as init method instead?

spring-context/src/main/java/org/springframework/context/annotation/ComponentScanBeanDefinitionParser.java

+10-3
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
import org.springframework.core.type.filter.RegexPatternTypeFilter;
4141
import org.springframework.core.type.filter.TypeFilter;
4242
import org.springframework.lang.Nullable;
43+
import org.springframework.util.Assert;
4344
import org.springframework.util.ClassUtils;
4445
import org.springframework.util.ReflectionUtils;
4546
import org.springframework.util.StringUtils;
@@ -112,14 +113,18 @@ protected ClassPathBeanDefinitionScanner configureScanner(ParserContext parserCo
112113
parseBeanNameGenerator(element, scanner);
113114
}
114115
catch (Exception ex) {
115-
parserContext.getReaderContext().error(ex.getMessage(), parserContext.extractSource(element), ex.getCause());
116+
String message = ex.getMessage();
117+
Assert.state(message != null, "Exception message must not be null");
118+
parserContext.getReaderContext().error(message, parserContext.extractSource(element), ex.getCause());
116119
}
117120

118121
try {
119122
parseScope(element, scanner);
120123
}
121124
catch (Exception ex) {
122-
parserContext.getReaderContext().error(ex.getMessage(), parserContext.extractSource(element), ex.getCause());
125+
String message = ex.getMessage();
126+
Assert.state(message != null, "Exception message must not be null");
127+
parserContext.getReaderContext().error(message, parserContext.extractSource(element), ex.getCause());
123128
}
124129

125130
parseTypeFilters(element, scanner, parserContext);
@@ -214,8 +219,10 @@ else if (EXCLUDE_FILTER_ELEMENT.equals(localName)) {
214219
"Ignoring non-present type filter class: " + ex, parserContext.extractSource(element));
215220
}
216221
catch (Exception ex) {
222+
String message = ex.getMessage();
223+
Assert.state(message != null, "Exception message must not be null");
217224
parserContext.getReaderContext().error(
218-
ex.getMessage(), parserContext.extractSource(element), ex.getCause());
225+
message, parserContext.extractSource(element), ex.getCause());
219226
}
220227
}
221228
}

spring-context/src/main/java/org/springframework/context/annotation/ConfigurationClass.java

+1
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,7 @@ Map<ImportBeanDefinitionRegistrar, AnnotationMetadata> getImportBeanDefinitionRe
219219
return this.importBeanDefinitionRegistrars;
220220
}
221221

222+
@SuppressWarnings("NullAway")
222223
void validate(ProblemReporter problemReporter) {
223224
Map<String, Object> attributes = this.metadata.getAnnotationAttributes(Configuration.class.getName());
224225

spring-context/src/main/java/org/springframework/context/annotation/ConfigurationClassParser.java

+1
Original file line numberDiff line numberDiff line change
@@ -819,6 +819,7 @@ void register(DeferredImportSelectorHolder deferredImport) {
819819
deferredImport.getConfigurationClass());
820820
}
821821

822+
@SuppressWarnings("NullAway")
822823
void processGroupImports() {
823824
for (DeferredImportSelectorGrouping grouping : this.groupings.values()) {
824825
Predicate<String> filter = grouping.getCandidateFilter();

spring-context/src/main/java/org/springframework/context/annotation/ConfigurationClassPostProcessor.java

+2
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,7 @@ public BeanRegistrationAotContribution processAheadOfTime(RegisteredBean registe
325325

326326
@Override
327327
@Nullable
328+
@SuppressWarnings("NullAway")
328329
public BeanFactoryInitializationAotContribution processAheadOfTime(ConfigurableListableBeanFactory beanFactory) {
329330
boolean hasPropertySourceDescriptors = !CollectionUtils.isEmpty(this.propertySourceDescriptors);
330331
boolean hasImportRegistry = beanFactory.containsBean(IMPORT_REGISTRY_BEAN_NAME);
@@ -556,6 +557,7 @@ public ImportAwareBeanPostProcessor(BeanFactory beanFactory) {
556557
}
557558

558559
@Override
560+
@Nullable
559561
public PropertyValues postProcessProperties(@Nullable PropertyValues pvs, Object bean, String beanName) {
560562
// Inject the BeanFactory before AutowiredAnnotationBeanPostProcessor's
561563
// postProcessProperties method attempts to autowire other configuration beans.

spring-context/src/main/java/org/springframework/context/annotation/ContextAnnotationAutowireCandidateResolver.java

+1
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ public Class<?> getTargetClass() {
9898
return descriptor.getDependencyType();
9999
}
100100
@Override
101+
@SuppressWarnings("NullAway")
101102
public Object getTarget() {
102103
Set<String> autowiredBeanNames = (beanName != null ? new LinkedHashSet<>(1) : null);
103104
Object target = dlbf.doResolveDependency(descriptor, beanName, autowiredBeanNames, null);

spring-context/src/main/java/org/springframework/context/annotation/ProfileCondition.java

+1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
class ProfileCondition implements Condition {
3232

3333
@Override
34+
@SuppressWarnings("NullAway")
3435
public boolean matches(ConditionContext context, AnnotatedTypeMetadata metadata) {
3536
MultiValueMap<String, Object> attrs = metadata.getAllAnnotationAttributes(Profile.class.getName());
3637
if (attrs != null) {

spring-context/src/main/java/org/springframework/context/event/AbstractApplicationEventMulticaster.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
import org.springframework.lang.Nullable;
4141
import org.springframework.util.Assert;
4242
import org.springframework.util.ClassUtils;
43+
import org.springframework.util.CollectionUtils;
4344
import org.springframework.util.ObjectUtils;
4445

4546
/**
@@ -229,6 +230,7 @@ protected Collection<ApplicationListener<?>> getApplicationListeners(
229230
* @param retriever the ListenerRetriever, if supposed to populate one (for caching purposes)
230231
* @return the pre-filtered list of application listeners for the given event and source type
231232
*/
233+
@SuppressWarnings("NullAway")
232234
private Collection<ApplicationListener<?>> retrieveApplicationListeners(
233235
ResolvableType eventType, @Nullable Class<?> sourceType, @Nullable CachedListenerRetriever retriever) {
234236

@@ -313,7 +315,7 @@ private Collection<ApplicationListener<?>> retrieveApplicationListeners(
313315

314316
AnnotationAwareOrderComparator.sort(allListeners);
315317
if (retriever != null) {
316-
if (filteredListenerBeans.isEmpty()) {
318+
if (CollectionUtils.isEmpty(filteredListenerBeans)) {
317319
retriever.applicationListeners = new LinkedHashSet<>(allListeners);
318320
retriever.applicationListenerBeans = filteredListenerBeans;
319321
}

spring-context/src/main/java/org/springframework/context/event/ApplicationListenerMethodAdapter.java

+1
Original file line numberDiff line numberDiff line change
@@ -460,6 +460,7 @@ private void assertTargetBean(Method method, Object targetBean, @Nullable Object
460460
}
461461
}
462462

463+
@SuppressWarnings("NullAway")
463464
private String getInvocationErrorMessage(Object bean, @Nullable String message, @Nullable Object[] resolvedArgs) {
464465
StringBuilder sb = new StringBuilder(getDetailedErrorMessage(bean, message));
465466
sb.append("Resolved arguments: \n");

spring-context/src/main/java/org/springframework/context/event/EventListenerMethodProcessor.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory)
111111
@Override
112112
public void afterSingletonsInstantiated() {
113113
ConfigurableListableBeanFactory beanFactory = this.beanFactory;
114-
Assert.state(this.beanFactory != null, "No ConfigurableListableBeanFactory set");
114+
Assert.state(beanFactory != null, "No ConfigurableListableBeanFactory set");
115115
String[] beanNames = beanFactory.getBeanNamesForType(Object.class);
116116
for (String beanName : beanNames) {
117117
if (!ScopedProxyUtils.isScopedTarget(beanName)) {

spring-context/src/main/java/org/springframework/context/i18n/LocaleContextThreadLocalAccessor.java

+3
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818

1919
import io.micrometer.context.ThreadLocalAccessor;
2020

21+
import org.springframework.lang.Nullable;
22+
2123
/**
2224
* Adapt {@link LocaleContextHolder} to the {@link ThreadLocalAccessor} contract
2325
* to assist the Micrometer Context Propagation library with {@link LocaleContext}
@@ -40,6 +42,7 @@ public Object key() {
4042
}
4143

4244
@Override
45+
@Nullable
4346
public LocaleContext getValue() {
4447
return LocaleContextHolder.getLocaleContext();
4548
}

spring-context/src/main/java/org/springframework/format/datetime/standard/DateTimeFormatterRegistrar.java

+1
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@
5151
* @see org.springframework.format.FormatterRegistrar#registerFormatters
5252
* @see org.springframework.format.datetime.DateFormatterRegistrar
5353
*/
54+
@SuppressWarnings("NullAway")
5455
public class DateTimeFormatterRegistrar implements FormatterRegistrar {
5556

5657
private enum Type {DATE, TIME, DATE_TIME}

spring-context/src/main/java/org/springframework/jmx/export/MBeanExporter.java

+1
Original file line numberDiff line numberDiff line change
@@ -993,6 +993,7 @@ private void registerNotificationListeners() throws MBeanExportException {
993993
* Unregister the configured {@link NotificationListener NotificationListeners}
994994
* from the {@link MBeanServer}.
995995
*/
996+
@SuppressWarnings("NullAway")
996997
private void unregisterNotificationListeners() {
997998
if (this.server != null) {
998999
this.registeredNotificationListeners.forEach((bean, mappedObjectNames) -> {

spring-context/src/main/java/org/springframework/jmx/export/annotation/AnnotationJmxAttributeSource.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
import org.springframework.jmx.export.metadata.InvalidMetadataException;
4444
import org.springframework.jmx.export.metadata.JmxAttributeSource;
4545
import org.springframework.lang.Nullable;
46+
import org.springframework.util.StringUtils;
4647
import org.springframework.util.StringValueResolver;
4748

4849
/**
@@ -117,7 +118,7 @@ public org.springframework.jmx.export.metadata.ManagedAttribute getManagedAttrib
117118
pvs.removePropertyValue("defaultValue");
118119
PropertyAccessorFactory.forBeanPropertyAccess(bean).setPropertyValues(pvs);
119120
String defaultValue = (String) map.get("defaultValue");
120-
if (!defaultValue.isEmpty()) {
121+
if (StringUtils.hasLength(defaultValue)) {
121122
bean.setDefaultValue(defaultValue);
122123
}
123124
return bean;

spring-context/src/main/java/org/springframework/validation/DataBinder.java

+4-1
Original file line numberDiff line numberDiff line change
@@ -682,7 +682,8 @@ public void setValidator(@Nullable Validator validator) {
682682
}
683683
}
684684

685-
private void assertValidators(Validator... validators) {
685+
@SuppressWarnings("NullAway")
686+
private void assertValidators(@Nullable Validator... validators) {
686687
Object target = getTarget();
687688
for (Validator validator : validators) {
688689
if (validator != null && (target != null && !validator.supports(target.getClass()))) {
@@ -741,6 +742,7 @@ public List<Validator> getValidators() {
741742
* {@link #setExcludedValidators(Predicate) exclude predicate}.
742743
* @since 6.1
743744
*/
745+
@SuppressWarnings("NullAway")
744746
public List<Validator> getValidatorsToApply() {
745747
return (this.excludedValidators != null ?
746748
this.validators.stream().filter(validator -> !this.excludedValidators.test(validator)).toList() :
@@ -1168,6 +1170,7 @@ protected boolean isAllowed(String field) {
11681170
* @see #getBindingErrorProcessor
11691171
* @see BindingErrorProcessor#processMissingFieldError
11701172
*/
1173+
@SuppressWarnings("NullAway")
11711174
protected void checkRequiredFields(MutablePropertyValues mpvs) {
11721175
String[] requiredFields = getRequiredFields();
11731176
if (!ObjectUtils.isEmpty(requiredFields)) {

spring-context/src/main/java/org/springframework/validation/DefaultMessageCodesResolver.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,8 @@ public String format(String errorCode, @Nullable String objectName, @Nullable St
242242
* {@link DefaultMessageCodesResolver#CODE_SEPARATOR}, skipping zero-length or
243243
* null elements altogether.
244244
*/
245-
public static String toDelimitedString(String... elements) {
245+
@SuppressWarnings("NullAway")
246+
public static String toDelimitedString(@Nullable String... elements) {
246247
StringJoiner rtn = new StringJoiner(CODE_SEPARATOR);
247248
for (String element : elements) {
248249
if (StringUtils.hasLength(element)) {

spring-context/src/main/java/org/springframework/validation/FieldError.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,7 @@ public boolean equals(@Nullable Object other) {
107107
if (!super.equals(other)) {
108108
return false;
109109
}
110-
FieldError otherError = (FieldError) other;
111-
return (getField().equals(otherError.getField()) &&
110+
return (other instanceof FieldError otherError && getField().equals(otherError.getField()) &&
112111
ObjectUtils.nullSafeEquals(getRejectedValue(), otherError.getRejectedValue()) &&
113112
isBindingFailure() == otherError.isBindingFailure());
114113
}

spring-context/src/main/java/org/springframework/validation/method/ParameterValidationResult.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -173,8 +173,8 @@ public boolean equals(@Nullable Object other) {
173173
if (!super.equals(other)) {
174174
return false;
175175
}
176-
ParameterValidationResult otherResult = (ParameterValidationResult) other;
177-
return (getMethodParameter().equals(otherResult.getMethodParameter()) &&
176+
return (other instanceof ParameterValidationResult otherResult &&
177+
getMethodParameter().equals(otherResult.getMethodParameter()) &&
178178
ObjectUtils.nullSafeEquals(getArgument(), otherResult.getArgument()) &&
179179
ObjectUtils.nullSafeEquals(getContainerIndex(), otherResult.getContainerIndex()) &&
180180
ObjectUtils.nullSafeEquals(getContainerKey(), otherResult.getContainerKey()));

spring-core/src/main/java/org/springframework/aot/hint/BindingReflectionHintsRegistrar.java

+1
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ public class BindingReflectionHintsRegistrar {
6363
* @param hints the hints instance to use
6464
* @param types the types to register
6565
*/
66+
@SuppressWarnings("NullAway")
6667
public void registerReflectionHints(ReflectionHints hints, @Nullable Type... types) {
6768
Set<Type> seen = new HashSet<>();
6869
for (Type type : types) {

spring-core/src/main/java/org/springframework/core/CoroutinesUtils.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ public static Publisher<?> invokeSuspendingFunction(Method method, Object target
108108
* @throws IllegalArgumentException if {@code method} is not a suspending function
109109
* @since 6.0
110110
*/
111-
@SuppressWarnings({"deprecation", "DataFlowIssue"})
111+
@SuppressWarnings({"deprecation", "DataFlowIssue", "NullAway"})
112112
public static Publisher<?> invokeSuspendingFunction(
113113
CoroutineContext context, Method method, @Nullable Object target, @Nullable Object... args) {
114114

spring-core/src/main/java/org/springframework/util/PlaceholderParser.java

+2
Original file line numberDiff line numberDiff line change
@@ -322,6 +322,7 @@ static class PartResolutionContext implements PlaceholderResolver {
322322
}
323323

324324
@Override
325+
@Nullable
325326
public String resolvePlaceholder(String placeholderName) {
326327
String value = this.resolver.resolvePlaceholder(placeholderName);
327328
if (value != null && logger.isTraceEnabled()) {
@@ -358,6 +359,7 @@ public void flagPlaceholderAsVisited(String placeholder) {
358359
}
359360

360361
public void removePlaceholder(String placeholder) {
362+
Assert.state(this.visitedPlaceholders != null, "Visited placeholders must not be null");
361363
this.visitedPlaceholders.remove(placeholder);
362364
}
363365

spring-core/src/main/java/org/springframework/util/StreamUtils.java

+2
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
import java.io.OutputStream;
2626
import java.nio.charset.Charset;
2727

28+
import org.springframework.lang.Contract;
2829
import org.springframework.lang.Nullable;
2930

3031
/**
@@ -201,6 +202,7 @@ else if (bytesRead <= bytesToCopy) {
201202
* @throws IOException in case of I/O errors
202203
* @since 4.3
203204
*/
205+
@Contract("null -> fail")
204206
public static int drain(@Nullable InputStream in) throws IOException {
205207
Assert.notNull(in, "No InputStream specified");
206208
return (int) in.transferTo(OutputStream.nullOutputStream());

spring-jms/src/main/java/org/springframework/jms/connection/JmsResourceHolder.java

+1
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,7 @@ public <S extends Session> S getSession(Class<S> sessionType) {
222222
* for the given connection, or {@code null} if none.
223223
*/
224224
@Nullable
225+
@SuppressWarnings("NullAway")
225226
public <S extends Session> S getSession(Class<S> sessionType, @Nullable Connection connection) {
226227
Deque<Session> sessions =
227228
(connection != null ? this.sessionsPerConnection.get(connection) : this.sessions);

spring-jms/src/main/java/org/springframework/jms/listener/SimpleMessageListenerContainer.java

+1
Original file line numberDiff line numberDiff line change
@@ -344,6 +344,7 @@ protected MessageConsumer createListenerConsumer(final Session session) throws J
344344
* @see #executeListener
345345
* @see #setExposeListenerSession
346346
*/
347+
@SuppressWarnings("NullAway")
347348
protected void processMessage(Message message, Session session) {
348349
ConnectionFactory connectionFactory = getConnectionFactory();
349350
boolean exposeResource = (connectionFactory != null && isExposeListenerSession());

spring-messaging/src/main/java/org/springframework/messaging/rsocket/service/RSocketServiceMethod.java

+1
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ private static MethodParameter[] initMethodParameters(Method method) {
9292
}
9393

9494
@Nullable
95+
@SuppressWarnings("NullAway")
9596
private static String initRoute(
9697
Method method, Class<?> containingClass, RSocketStrategies strategies,
9798
@Nullable StringValueResolver embeddedValueResolver) {

spring-orm/src/main/java/org/springframework/orm/jpa/persistenceunit/PersistenceManagedTypesBeanRegistrationAotProcessor.java

+1
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,7 @@ private void contributeHibernateHints(RuntimeHints hints, @Nullable ClassLoader
203203
});
204204
}
205205

206+
@SuppressWarnings("NullAway")
206207
private void registerInstantiatorForReflection(ReflectionHints reflection, @Nullable Annotation annotation) {
207208
if (annotation == null) {
208209
return;

0 commit comments

Comments
 (0)