Skip to content

Commit 24e1148

Browse files
committed
Fix Sonar issues
1 parent 2041450 commit 24e1148

File tree

3 files changed

+26
-30
lines changed

3 files changed

+26
-30
lines changed

spring-kafka-test/src/main/java/org/springframework/kafka/test/rule/EmbeddedKafkaRule.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,11 @@
1919
import java.util.Map;
2020

2121
import org.junit.rules.ExternalResource;
22-
import org.junit.rules.TestRule;
2322

2423
import org.springframework.kafka.test.EmbeddedKafkaBroker;
2524

2625
/**
27-
* A {@link TestRule} wrapper around an {@link EmbeddedKafkaBroker}.
26+
* A {@link org.junit.rules.TestRule} wrapper around an {@link EmbeddedKafkaBroker}.
2827
*
2928
* @author Artem Bilan
3029
*

spring-kafka/src/main/java/org/springframework/kafka/listener/DefaultAfterRollbackProcessor.java

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
import org.springframework.kafka.support.SeekUtils;
3030
import org.springframework.lang.Nullable;
3131
import org.springframework.util.backoff.BackOff;
32-
import org.springframework.util.backoff.FixedBackOff;
3332

3433
/**
3534
* Default implementation of {@link AfterRollbackProcessor}. Seeks all
@@ -66,11 +65,12 @@ public DefaultAfterRollbackProcessor() {
6665
* 'maxFailures' have occurred for a topic/partition/offset.
6766
* @param maxFailures the maxFailures; a negative value is treated as infinity.
6867
* @deprecated in favor of {@link #DefaultAfterRollbackProcessor(BackOff)}.
69-
* <b>IMPORTANT</b> When using a {@link FixedBackOff}, the maxAttempts property
70-
* represents retries (one less than maxFailures). To retry indefinitely, use a
71-
* fixed or exponential {@link BackOff} configured appropriately.
72-
* To use the other constructor with the semantics of this one, with maxFailures
73-
* equal to 3, use {@code new DefaultAfterRollbackProcessor(new FixedBackOff(0L, 2L)}.
68+
* <b>IMPORTANT</b> When using a
69+
* {@link org.springframework.util.backoff.FixedBackOff}, the maxAttempts property
70+
* represents retries (one less than maxFailures). To retry indefinitely, use a fixed
71+
* or exponential {@link BackOff} configured appropriately. To use the other
72+
* constructor with the semantics of this one, with maxFailures equal to 3, use
73+
* {@code new DefaultAfterRollbackProcessor(new FixedBackOff(0L, 2L)}.
7474
* @since 2.2.1
7575
*/
7676
@Deprecated
@@ -105,11 +105,11 @@ public DefaultAfterRollbackProcessor(BiConsumer<ConsumerRecord<?, ?>, Exception>
105105
* @param recoverer the recoverer; if null, the default (logging) recoverer is used.
106106
* @param maxFailures the maxFailures; a negative value is treated as infinity.
107107
* @deprecated in favor of {@link #DefaultAfterRollbackProcessor(BackOff)}.
108-
* <b>IMPORTANT</b> When using a {@link FixedBackOff}, the maxAttempts property
109-
* represents retries (one less than maxFailures). To retry indefinitely, use a
110-
* fixed or exponential {@link BackOff} configured appropriately.
111-
* To use the other constructor with the semantics of this one, with maxFailures
112-
* equal to 3, use
108+
* <b>IMPORTANT</b> When using a
109+
* {@link org.springframework.util.backoff.FixedBackOff}, the maxAttempts property
110+
* represents retries (one less than maxFailures). To retry indefinitely, use a fixed
111+
* or exponential {@link BackOff} configured appropriately. To use the other
112+
* constructor with the semantics of this one, with maxFailures equal to 3, use
113113
* {@code new DefaultAfterRollbackProcessor(recoverer, new FixedBackOff(0L, 2L)}.
114114
* @since 2.2
115115
*/

spring-kafka/src/main/java/org/springframework/kafka/listener/SeekToCurrentErrorHandler.java

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,10 @@
3232
import org.springframework.kafka.KafkaException;
3333
import org.springframework.kafka.listener.ContainerProperties.AckMode;
3434
import org.springframework.kafka.support.SeekUtils;
35-
import org.springframework.kafka.support.serializer.DeserializationException;
3635
import org.springframework.lang.Nullable;
37-
import org.springframework.messaging.converter.MessageConversionException;
38-
import org.springframework.messaging.handler.invocation.MethodArgumentResolutionException;
3936
import org.springframework.util.Assert;
4037
import org.springframework.util.ObjectUtils;
4138
import org.springframework.util.backoff.BackOff;
42-
import org.springframework.util.backoff.FixedBackOff;
4339

4440
/**
4541
* An error handler that seeks to the current offset for each topic in the remaining
@@ -73,11 +69,12 @@ public SeekToCurrentErrorHandler() {
7369
* 'maxFailures' have occurred for a topic/partition/offset.
7470
* @param maxFailures the maxFailures; a negative value is treated as infinity.
7571
* @deprecated in favor of {@link #SeekToCurrentErrorHandler(BackOff)}.
76-
* <b>IMPORTANT</b> When using a {@link FixedBackOff}, the maxAttempts property
77-
* represents retries (one less than maxFailures). To retry indefinitely, use a
78-
* fixed or exponential {@link BackOff} configured appropriately.
79-
* To use the other constructor with the semantics of this one, with maxFailures
80-
* equal to 3, use {@code new SeekToCurrentErrorHandler(new FixedBackOff(0L, 2L)}.
72+
* <b>IMPORTANT</b> When using a
73+
* {@link org.springframework.util.backoff.FixedBackOff}, the maxAttempts property
74+
* represents retries (one less than maxFailures). To retry indefinitely, use a fixed
75+
* or exponential {@link BackOff} configured appropriately. To use the other
76+
* constructor with the semantics of this one, with maxFailures equal to 3, use
77+
* {@code new SeekToCurrentErrorHandler(new FixedBackOff(0L, 2L)}.
8178
* @since 2.2.1
8279
*/
8380
@Deprecated
@@ -112,11 +109,11 @@ public SeekToCurrentErrorHandler(BiConsumer<ConsumerRecord<?, ?>, Exception> rec
112109
* @param recoverer the recoverer; if null, the default (logging) recoverer is used.
113110
* @param maxFailures the maxFailures; a negative value is treated as infinity.
114111
* @deprecated in favor of {@link #SeekToCurrentErrorHandler(BiConsumer, BackOff)}.
115-
* <b>IMPORTANT</b> When using a {@link FixedBackOff}, the maxAttempts property
116-
* represents retries (one less than maxFailures). To retry indefinitely, use a
117-
* fixed or exponential {@link BackOff} configured appropriately.
118-
* To use the other constructor with the semantics of this one, with maxFailures
119-
* equal to 3, use
112+
* <b>IMPORTANT</b> When using a
113+
* {@link org.springframework.util.backoff.FixedBackOff}, the maxAttempts property
114+
* represents retries (one less than maxFailures). To retry indefinitely, use a fixed
115+
* or exponential {@link BackOff} configured appropriately. To use the other
116+
* constructor with the semantics of this one, with maxFailures equal to 3, use
120117
* {@code new SeekToCurrentErrorHandler(recoverer, new FixedBackOff(0L, 2L)}.
121118
* @since 2.2
122119
*/
@@ -155,9 +152,9 @@ public void setCommitRecovered(boolean commitRecovered) { // NOSONAR enhanced ja
155152
* (until exhaustion) or not. If not, we go straight to the recoverer. By default,
156153
* the following exceptions will not be retried:
157154
* <ul>
158-
* <li>{@link DeserializationException}</li>
159-
* <li>{@link MessageConversionException}</li>
160-
* <li>{@link MethodArgumentResolutionException}</li>
155+
* <li>{@link org.springframework.kafka.support.serializer.DeserializationException}</li>
156+
* <li>{@link org.springframework.messaging.converter.MessageConversionException}</li>
157+
* <li>{@link org.springframework.messaging.handler.invocation.MethodArgumentResolutionException}</li>
161158
* <li>{@link NoSuchMethodException}</li>
162159
* <li>{@link ClassCastException}</li>
163160
* </ul>

0 commit comments

Comments
 (0)