Skip to content

Commit e2daa2d

Browse files
authored
Add checkstyle rule on empty-line-separater
* Update checkstyle.xml * Fix checkstyle violations * Fix test class checkstyle * Add field also.
1 parent cb45e56 commit e2daa2d

File tree

75 files changed

+161
-105
lines changed

Some content is hidden

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

75 files changed

+161
-105
lines changed

spring-kafka-test/src/main/java/org/springframework/kafka/test/EmbeddedKafkaKraftBroker.java

-1
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,6 @@ public void afterPropertiesSet() {
204204
}
205205
}
206206

207-
208207
private void start() {
209208
if (this.cluster != null) {
210209
return;

spring-kafka-test/src/main/java/org/springframework/kafka/test/assertj/KafkaConditions.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2016-2019 the original author or authors.
2+
* Copyright 2016-2024 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.
@@ -90,7 +90,6 @@ public static <K, V> Condition<ConsumerRecord<K, V>> keyValue(K key, V value) {
9090
return new ConsumerRecordPartitionCondition(partition);
9191
}
9292

93-
9493
public static class ConsumerRecordKeyCondition<K> extends Condition<ConsumerRecord<K, ?>> {
9594

9695
private final K key;

spring-kafka-test/src/main/java/org/springframework/kafka/test/condition/EmbeddedKafkaCondition.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2019-2023 the original author or authors.
2+
* Copyright 2019-2024 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.
@@ -211,7 +211,6 @@ private Store getParentStore(ExtensionContext context) {
211211
return parent.getStore(Namespace.create(getClass(), parent));
212212
}
213213

214-
215214
public static EmbeddedKafkaBroker getBroker() {
216215
return BROKERS.get();
217216
}

spring-kafka-test/src/test/java/org/springframework/kafka/test/context/EmbeddedKafkaContextCustomizerTests.java

+1-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2017-2023 the original author or authors.
2+
* Copyright 2017-2024 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.
@@ -48,15 +48,13 @@ void beforeEachTest() {
4848
AnnotationUtils.findAnnotation(SecondTestWithEmbeddedKafka.class, EmbeddedKafka.class);
4949
}
5050

51-
5251
@Test
5352
void testHashCode() {
5453
assertThat(new EmbeddedKafkaContextCustomizer(annotationFromFirstClass).hashCode()).isNotEqualTo(0);
5554
assertThat(new EmbeddedKafkaContextCustomizer(annotationFromFirstClass).hashCode())
5655
.isEqualTo(new EmbeddedKafkaContextCustomizer(annotationFromSecondClass).hashCode());
5756
}
5857

59-
6058
@Test
6159
void testEquals() {
6260
assertThat(new EmbeddedKafkaContextCustomizer(annotationFromFirstClass))
@@ -93,7 +91,6 @@ void testMulti() {
9391
.matches("127.0.0.1:[0-9]+,127.0.0.1:[0-9]+");
9492
}
9593

96-
9794
@EmbeddedKafka(kraft = false)
9895
private static final class TestWithEmbeddedKafka {
9996

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

-1
Original file line numberDiff line numberDiff line change
@@ -1190,7 +1190,6 @@ private MessageHandlerMethodFactory createDefaultMessageHandlerMethodFactory() {
11901190

11911191
private record BytesToStringConverter(Charset charset) implements Converter<byte[], String> {
11921192

1193-
11941193
@Override
11951194
public String convert(byte[] source) {
11961195
return new String(source, this.charset);

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

-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737
import org.springframework.kafka.retrytopic.RetryTopicConfiguration;
3838
import org.springframework.lang.Nullable;
3939

40-
4140
/**
4241
*
4342
* Attempts to provide an instance of

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

-3
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,6 @@ else if (endpoint instanceof MethodKafkaListenerEndpoint<?, ?> mkle) {
361361
return listenerContainer;
362362
}
363363

364-
365364
@Override
366365
public void destroy() {
367366
for (MessageListenerContainer listenerContainer : getListenerContainers()) {
@@ -419,7 +418,6 @@ public boolean isRunning() {
419418
return this.running;
420419
}
421420

422-
423421
@Override
424422
public void onApplicationEvent(ContextRefreshedEvent event) {
425423
if (event.getApplicationContext().equals(this.applicationContext)) {
@@ -439,7 +437,6 @@ private void startIfNecessary(MessageListenerContainer listenerContainer) {
439437
}
440438
}
441439

442-
443440
private static final class AggregatingCallback implements Runnable {
444441

445442
private final AtomicInteger count;

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

-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ public MultiMethodKafkaListenerEndpoint(List<Method> methods, @Nullable Method d
6161
setBean(bean);
6262
}
6363

64-
6564
/**
6665
* Get a method list.
6766
* @return the method list.

spring-kafka/src/main/java/org/springframework/kafka/core/DefaultKafkaConsumerFactory.java

-1
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,6 @@ public void setValueDeserializerSupplier(Supplier<Deserializer<V>> valueDeserial
252252
this.valueDeserializerSupplier = valueDeserializerSupplier(valueDeserializerSupplier);
253253
}
254254

255-
256255
/**
257256
* Set to false (default true) to prevent programmatically provided deserializers (via
258257
* constructor or setters) from being configured using the producer configuration,

spring-kafka/src/main/java/org/springframework/kafka/core/DefaultKafkaProducerFactory.java

-3
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,6 @@
6868
import org.springframework.util.Assert;
6969
import org.springframework.util.StringUtils;
7070

71-
72-
7371
/**
7472
* The {@link ProducerFactory} implementation for a {@code singleton} shared {@link Producer} instance.
7573
* <p>
@@ -567,7 +565,6 @@ public ProducerFactory<K, V> copyWithConfigurationOverride(Map<String, Object> o
567565
return newFactory;
568566
}
569567

570-
571568
/**
572569
* Ensures that the returned properties map contains a transaction id prefix.
573570
* The {@link org.springframework.kafka.core.DefaultKafkaProducerFactory}

spring-kafka/src/main/java/org/springframework/kafka/core/KafkaTemplate.java

-2
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,6 @@ public void setMessagingConverter(SmartMessageConverter messageConverter) {
308308
((MessagingMessageConverter) this.messageConverter).setMessagingConverter(messageConverter);
309309
}
310310

311-
312311
@Override
313312
public boolean isTransactional() {
314313
return this.transactional;
@@ -590,7 +589,6 @@ public CompletableFuture<SendResult<K, V>> send(Message<?> message) {
590589
return observeSend((ProducerRecord<K, V>) producerRecord);
591590
}
592591

593-
594592
@Override
595593
public List<PartitionInfo> partitionsFor(String topic) {
596594
Producer<K, V> producer = getTheProducer();

spring-kafka/src/main/java/org/springframework/kafka/core/MicrometerProducerListener.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2020-2022 the original author or authors.
2+
* Copyright 2020-2024 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.
@@ -65,7 +65,6 @@ public MicrometerProducerListener(MeterRegistry meterRegistry, List<Tag> tags) {
6565
this.tags = tags;
6666
}
6767

68-
6968
@Override
7069
public synchronized void producerAdded(String id, Producer<K, V> producer) {
7170
if (!this.metrics.containsKey(id)) {

spring-kafka/src/main/java/org/springframework/kafka/event/KafkaEvent.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2015-2023 the original author or authors.
2+
* Copyright 2015-2024 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.
@@ -19,7 +19,6 @@
1919
import org.springframework.context.ApplicationEvent;
2020
import org.springframework.util.Assert;
2121

22-
2322
/**
2423
* Base class for events.
2524
*

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

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2015-2019 the original author or authors.
2+
* Copyright 2015-2024 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.
@@ -40,7 +40,6 @@
4040
@FunctionalInterface
4141
public interface BatchMessageListener<K, V> extends GenericMessageListener<List<ConsumerRecord<K, V>>> {
4242

43-
4443
/**
4544
* Listener receives the original {@link ConsumerRecords} object instead of a
4645
* list of {@link ConsumerRecord}.

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

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2021-2023 the original author or authors.
2+
* Copyright 2021-2024 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.
@@ -83,7 +83,6 @@ public void handleOtherException(Exception thrownException, Consumer<?, ?> consu
8383
stopContainer(container, thrownException);
8484
}
8585

86-
8786
@Override
8887
public void handleRemaining(Exception thrownException, List<ConsumerRecord<?, ?>> records, Consumer<?, ?> consumer,
8988
MessageListenerContainer container) {

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

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2021-2023 the original author or authors.
2+
* Copyright 2021-2024 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.
@@ -47,7 +47,6 @@ public void setAckAfterHandle(boolean ackAfterHandle) {
4747
this.ackAfterHandle = ackAfterHandle;
4848
}
4949

50-
5150
@Override
5251
public boolean handleOne(Exception thrownException, ConsumerRecord<?, ?> record, Consumer<?, ?> consumer,
5352
MessageListenerContainer container) {

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

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2017-2023 the original author or authors.
2+
* Copyright 2017-2024 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.
@@ -34,7 +34,6 @@
3434
*/
3535
public interface ConsumerAwareRebalanceListener extends ConsumerRebalanceListener {
3636

37-
3837
/**
3938
* The same as {@link #onPartitionsRevoked(Collection)} with the additional consumer
4039
* parameter. It is invoked by the container before any pending offsets are committed.

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

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2021 the original author or authors.
2+
* Copyright 2021-2024 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.
@@ -32,7 +32,6 @@
3232
@FunctionalInterface
3333
public interface ConsumerAwareRecordRecoverer extends ConsumerRecordRecoverer {
3434

35-
3635
@Override
3736
default void accept(ConsumerRecord<?, ?> record, Exception exception) {
3837
accept(record, null, exception);

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

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2018-2023 the original author or authors.
2+
* Copyright 2018-2024 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.
@@ -1364,6 +1364,7 @@ public ExceptionInfo exceptionCauseFqcn(String exceptionCauseFqcn) {
13641364
this.exceptionCauseFqcn = exceptionCauseFqcn;
13651365
return this;
13661366
}
1367+
13671368
/**
13681369
* Sets the name of the header that will be used to store the keyExceptionMessage
13691370
* of the original record.

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

-2
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,6 @@
137137
import io.micrometer.observation.Observation;
138138
import io.micrometer.observation.ObservationRegistry;
139139

140-
141140
/**
142141
* Single-threaded Message listener container using the Java {@link Consumer} supporting
143142
* auto-partition assignment or user-configured assignment.
@@ -593,7 +592,6 @@ public String toString() {
593592
+ "]";
594593
}
595594

596-
597595
private final class ListenerConsumer implements SchedulingAwareRunnable, ConsumerSeekCallback {
598596

599597
private static final String COMMITTING = "Committing: ";

spring-kafka/src/main/java/org/springframework/kafka/listener/adapter/BatchMessagingMessageListenerAdapter.java

+1-2
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-2024 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.
@@ -35,7 +35,6 @@
3535
import org.springframework.messaging.support.MessageBuilder;
3636
import org.springframework.util.Assert;
3737

38-
3938
/**
4039
* A {@link org.springframework.kafka.listener.MessageListener MessageListener}
4140
* adapter that invokes a configurable {@link HandlerAdapter}; used when the factory is

spring-kafka/src/main/java/org/springframework/kafka/listener/adapter/DelegatingInvocableHandler.java

-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@
4747
import org.springframework.util.Assert;
4848
import org.springframework.validation.Validator;
4949

50-
5150
/**
5251
* Delegates to an {@link InvocableHandlerMethod} based on the message payload type.
5352
* Matches a single, non-annotated parameter or one that is annotated with

spring-kafka/src/main/java/org/springframework/kafka/listener/adapter/RecordMessagingMessageListenerAdapter.java

+1-2
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-2024 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.
@@ -28,7 +28,6 @@
2828
import org.springframework.lang.Nullable;
2929
import org.springframework.messaging.Message;
3030

31-
3231
/**
3332
* A {@link org.springframework.kafka.listener.MessageListener MessageListener}
3433
* adapter that invokes a configurable {@link HandlerAdapter}; used when the factory is

spring-kafka/src/main/java/org/springframework/kafka/retrytopic/DefaultDestinationTopicResolver.java

-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@
3939
import org.springframework.lang.Nullable;
4040
import org.springframework.util.Assert;
4141

42-
4342
/**
4443
*
4544
* Default implementation of the {@link DestinationTopicResolver} interface.

spring-kafka/src/main/java/org/springframework/kafka/retrytopic/DestinationTopic.java

+1
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ public static class Properties {
148148

149149
@Nullable
150150
private final Boolean autoStartDltHandler;
151+
151152
/**
152153
* Create an instance with the provided properties with the DLT container starting
153154
* automatically (if the container factory is so configured).

spring-kafka/src/main/java/org/springframework/kafka/retrytopic/RetryTopicConfiguration.java

+2
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,9 @@ public Integer getConcurrency() {
9191
static class TopicCreation {
9292

9393
private final boolean shouldCreateTopics;
94+
9495
private final int numPartitions;
96+
9597
private final short replicationFactor;
9698

9799
TopicCreation(@Nullable Boolean shouldCreate, @Nullable Integer numPartitions, @Nullable Short replicationFactor) {

spring-kafka/src/main/java/org/springframework/kafka/retrytopic/RetryTopicConfigurationBuilder.java

-2
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ public class RetryTopicConfigurationBuilder {
7272

7373
private RetryTopicConfiguration.TopicCreation topicCreationConfiguration = new RetryTopicConfiguration.TopicCreation();
7474

75-
7675
private ConcurrentKafkaListenerContainerFactory<?, ?> listenerContainerFactory;
7776

7877
@Nullable
@@ -401,7 +400,6 @@ public RetryTopicConfigurationBuilder customBackoff(SleepingBackOffPolicy<?> bac
401400
return this;
402401
}
403402

404-
405403
/**
406404
* Configure a {@link FixedBackOffPolicy}.
407405
* @param interval the interval.

spring-kafka/src/main/java/org/springframework/kafka/retrytopic/RetryTopicConfigurer.java

-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@
4343
import org.springframework.lang.NonNull;
4444
import org.springframework.lang.Nullable;
4545

46-
4746
/**
4847
*
4948
* <p>Configures main, retry and DLT topics based on a main endpoint and provided

spring-kafka/src/main/java/org/springframework/kafka/streams/KafkaStreamsMicrometerListener.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2020-2022 the original author or authors.
2+
* Copyright 2020-2024 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.
@@ -64,7 +64,6 @@ public KafkaStreamsMicrometerListener(MeterRegistry meterRegistry, List<Tag> tag
6464
this.tags = tags;
6565
}
6666

67-
6867
@Override
6968
public synchronized void streamsAdded(String id, KafkaStreams kafkaStreams) {
7069
if (!this.metrics.containsKey(id)) {

0 commit comments

Comments
 (0)