Skip to content

Commit aa78bd4

Browse files
committed
Fix compile warnings due to the depreacated Nullable components
- Remove the usage of Spring Nullable related annotations in preference to the ones from jspecify. Signed-off-by: Soby Chacko <[email protected]>
1 parent 66b121a commit aa78bd4

File tree

122 files changed

+274
-265
lines changed

Some content is hidden

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

122 files changed

+274
-265
lines changed

spring-kafka/src/main/java/org/springframework/kafka/KafkaException.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2016-2023 the original author or authors.
2+
* Copyright 2016-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -16,9 +16,10 @@
1616

1717
package org.springframework.kafka;
1818

19+
import org.jspecify.annotations.Nullable;
20+
1921
import org.springframework.core.NestedRuntimeException;
2022
import org.springframework.core.log.LogAccessor;
21-
import org.springframework.lang.Nullable;
2223
import org.springframework.util.Assert;
2324

2425
/**

spring-kafka/src/main/java/org/springframework/kafka/annotation/KafkaListenerAnnotationBeanPostProcessor.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2014-2024 the original author or authors.
2+
* Copyright 2014-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -44,6 +44,7 @@
4444
import java.util.stream.Stream;
4545

4646
import org.apache.commons.logging.LogFactory;
47+
import org.jspecify.annotations.Nullable;
4748

4849
import org.springframework.aop.framework.Advised;
4950
import org.springframework.aop.support.AopUtils;
@@ -101,7 +102,6 @@
101102
import org.springframework.kafka.retrytopic.RetryTopicSchedulerWrapper;
102103
import org.springframework.kafka.support.TopicPartitionOffset;
103104
import org.springframework.kafka.support.TopicPartitionOffset.SeekPosition;
104-
import org.springframework.lang.Nullable;
105105
import org.springframework.messaging.converter.GenericMessageConverter;
106106
import org.springframework.messaging.converter.SmartMessageConverter;
107107
import org.springframework.messaging.handler.annotation.support.DefaultMessageHandlerMethodFactory;
@@ -1034,7 +1034,6 @@ else if (resolvedValue instanceof Integer intgr) {
10341034
}
10351035
}
10361036

1037-
@Nullable
10381037
private TopicPartitionOffset.SeekPosition resloveTopicPartitionOffsetSeekPosition(@Nullable Object seekPosition) {
10391038
TopicPartitionOffset.SeekPosition resloveTpoSp = null;
10401039
if (seekPosition instanceof String seekPositionName) {

spring-kafka/src/main/java/org/springframework/kafka/annotation/RetryTopicConfigurationProvider.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2018-2024 the original author or authors.
2+
* Copyright 2018-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -22,6 +22,7 @@
2222
import java.util.Objects;
2323

2424
import org.apache.commons.logging.LogFactory;
25+
import org.jspecify.annotations.Nullable;
2526

2627
import org.springframework.beans.factory.BeanFactory;
2728
import org.springframework.beans.factory.ListableBeanFactory;
@@ -35,7 +36,6 @@
3536
import org.springframework.core.annotation.RepeatableContainers;
3637
import org.springframework.core.log.LogAccessor;
3738
import org.springframework.kafka.retrytopic.RetryTopicConfiguration;
38-
import org.springframework.lang.Nullable;
3939

4040
/**
4141
*

spring-kafka/src/main/java/org/springframework/kafka/annotation/RetryableTopicAnnotationProcessor.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2018-2024 the original author or authors.
2+
* Copyright 2018-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -26,6 +26,8 @@
2626
import java.util.Set;
2727
import java.util.stream.Collectors;
2828

29+
import org.jspecify.annotations.Nullable;
30+
2931
import org.springframework.beans.factory.BeanFactory;
3032
import org.springframework.beans.factory.BeanInitializationException;
3133
import org.springframework.beans.factory.NoSuchBeanDefinitionException;
@@ -45,7 +47,6 @@
4547
import org.springframework.kafka.retrytopic.RetryTopicConfigurer;
4648
import org.springframework.kafka.retrytopic.RetryTopicConstants;
4749
import org.springframework.kafka.support.EndpointHandlerMethod;
48-
import org.springframework.lang.Nullable;
4950
import org.springframework.retry.annotation.Backoff;
5051
import org.springframework.retry.backoff.ExponentialBackOffPolicy;
5152
import org.springframework.retry.backoff.ExponentialRandomBackOffPolicy;

spring-kafka/src/main/java/org/springframework/kafka/aot/KafkaAvroBeanRegistrationAotProcessor.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2022 the original author or authors.
2+
* Copyright 2022-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -24,6 +24,7 @@
2424

2525
import org.apache.kafka.clients.consumer.ConsumerRecord;
2626
import org.apache.kafka.clients.consumer.ConsumerRecords;
27+
import org.jspecify.annotations.Nullable;
2728

2829
import org.springframework.aot.hint.MemberCategory;
2930
import org.springframework.aot.hint.ReflectionHints;
@@ -33,7 +34,6 @@
3334
import org.springframework.core.ResolvableType;
3435
import org.springframework.core.annotation.MergedAnnotations;
3536
import org.springframework.kafka.listener.GenericMessageListener;
36-
import org.springframework.lang.Nullable;
3737
import org.springframework.util.ClassUtils;
3838
import org.springframework.util.ReflectionUtils;
3939

spring-kafka/src/main/java/org/springframework/kafka/aot/KafkaRuntimeHints.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2022-2024 the original author or authors.
2+
* Copyright 2022-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -27,6 +27,7 @@
2727
import org.apache.kafka.common.serialization.Serdes;
2828
import org.apache.kafka.common.utils.AppInfoParser.AppInfo;
2929
import org.apache.kafka.common.utils.ImplicitLinkedHashCollection;
30+
import org.jspecify.annotations.Nullable;
3031

3132
import org.springframework.aop.framework.AopProxyUtils;
3233
import org.springframework.aot.hint.MemberCategory;
@@ -62,7 +63,6 @@
6263
import org.springframework.kafka.support.serializer.ParseStringDeserializer;
6364
import org.springframework.kafka.support.serializer.StringOrBytesSerializer;
6465
import org.springframework.kafka.support.serializer.ToStringSerializer;
65-
import org.springframework.lang.Nullable;
6666

6767
/**
6868
* {@link RuntimeHintsRegistrar} for Spring for Apache Kafka.

spring-kafka/src/main/java/org/springframework/kafka/config/AbstractKafkaListenerEndpoint.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2014-2024 the original author or authors.
2+
* Copyright 2014-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -24,6 +24,7 @@
2424
import java.util.regex.Pattern;
2525

2626
import org.apache.commons.logging.LogFactory;
27+
import org.jspecify.annotations.Nullable;
2728

2829
import org.springframework.beans.BeansException;
2930
import org.springframework.beans.factory.BeanFactory;
@@ -48,7 +49,6 @@
4849
import org.springframework.kafka.support.JavaUtils;
4950
import org.springframework.kafka.support.TopicPartitionOffset;
5051
import org.springframework.kafka.support.converter.MessageConverter;
51-
import org.springframework.lang.Nullable;
5252
import org.springframework.util.Assert;
5353
import org.springframework.util.ObjectUtils;
5454

spring-kafka/src/main/java/org/springframework/kafka/config/KafkaListenerEndpoint.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2023 the original author or authors.
2+
* Copyright 2002-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -20,10 +20,11 @@
2020
import java.util.Properties;
2121
import java.util.regex.Pattern;
2222

23+
import org.jspecify.annotations.Nullable;
24+
2325
import org.springframework.kafka.listener.MessageListenerContainer;
2426
import org.springframework.kafka.support.TopicPartitionOffset;
2527
import org.springframework.kafka.support.converter.MessageConverter;
26-
import org.springframework.lang.Nullable;
2728

2829
/**
2930
* Model for a Kafka listener endpoint. Can be used against a

spring-kafka/src/main/java/org/springframework/kafka/config/KafkaListenerEndpointAdapter.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2018-2019 the original author or authors.
2+
* Copyright 2018-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -20,10 +20,11 @@
2020
import java.util.Collections;
2121
import java.util.regex.Pattern;
2222

23+
import org.jspecify.annotations.Nullable;
24+
2325
import org.springframework.kafka.listener.MessageListenerContainer;
2426
import org.springframework.kafka.support.TopicPartitionOffset;
2527
import org.springframework.kafka.support.converter.MessageConverter;
26-
import org.springframework.lang.Nullable;
2728

2829
/**
2930
* Adapter to avoid having to implement all methods.

spring-kafka/src/main/java/org/springframework/kafka/config/KafkaListenerEndpointRegistrar.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2014-2024 the original author or authors.
2+
* Copyright 2014-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -23,10 +23,11 @@
2323
import java.util.concurrent.locks.Lock;
2424
import java.util.concurrent.locks.ReentrantLock;
2525

26+
import org.jspecify.annotations.Nullable;
27+
2628
import org.springframework.beans.factory.BeanFactory;
2729
import org.springframework.beans.factory.BeanFactoryAware;
2830
import org.springframework.beans.factory.InitializingBean;
29-
import org.springframework.lang.Nullable;
3031
import org.springframework.messaging.handler.annotation.support.MessageHandlerMethodFactory;
3132
import org.springframework.messaging.handler.invocation.HandlerMethodArgumentResolver;
3233
import org.springframework.util.Assert;

0 commit comments

Comments
 (0)