Skip to content

Commit 1957a8c

Browse files
authored
Fix Compiler Warnings
1 parent a797d77 commit 1957a8c

20 files changed

+46
-33
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2018-2022 the original author or authors.
2+
* Copyright 2018-2023 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.
@@ -31,10 +31,10 @@ public class ConsumerPausedEvent extends KafkaEvent {
3131

3232
private static final long serialVersionUID = 1L;
3333

34-
private final Collection<TopicPartition> partitions;
35-
3634
private final String reason;
3735

36+
private transient Collection<TopicPartition> partitions;
37+
3838
/**
3939
* Construct an instance with the provided source and partitions.
4040
* @param source the container instance that generated the event.

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2018-2020 the original author or authors.
2+
* Copyright 2018-2023 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.
@@ -31,7 +31,7 @@ public class ConsumerResumedEvent extends KafkaEvent {
3131

3232
private static final long serialVersionUID = 1L;
3333

34-
private final Collection<TopicPartition> partitions;
34+
private transient Collection<TopicPartition> partitions;
3535

3636
/**
3737
* Construct an instance with the provided source and partitions.

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2018-2020 the original author or authors.
2+
* Copyright 2018-2023 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.
@@ -37,7 +37,7 @@ public class ConsumerStoppingEvent extends KafkaEvent {
3737

3838
private transient Consumer<?, ?> consumer;
3939

40-
private final Collection<TopicPartition> partitions;
40+
private transient Collection<TopicPartition> partitions;
4141

4242
/**
4343
* Construct an instance with the provided source, consumer and partitions.

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2015-2021 the original author or authors.
2+
* Copyright 2015-2023 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.
@@ -30,7 +30,7 @@ public abstract class KafkaEvent extends ApplicationEvent {
3030

3131
private static final long serialVersionUID = 1L;
3232

33-
private final Object container;
33+
private transient Object container;
3434

3535
public KafkaEvent(Object source, Object container) {
3636
super(source);

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2016-2020 the original author or authors.
2+
* Copyright 2016-2023 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.
@@ -39,10 +39,10 @@ public class ListenerContainerIdleEvent extends KafkaEvent {
3939

4040
private final String listenerId;
4141

42-
private final List<TopicPartition> topicPartitions;
43-
4442
private final boolean paused;
4543

44+
private transient List<TopicPartition> topicPartitions;
45+
4646
private transient Consumer<?, ?> consumer;
4747

4848
/**

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2020 the original author or authors.
2+
* Copyright 2020-2023 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.
@@ -39,7 +39,7 @@ public class ListenerContainerNoLongerIdleEvent extends KafkaEvent {
3939

4040
private final String listenerId;
4141

42-
private final List<TopicPartition> topicPartitions;
42+
private transient List<TopicPartition> topicPartitions;
4343

4444
private transient Consumer<?, ?> consumer;
4545

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2020 the original author or authors.
2+
* Copyright 2020-2023 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.
@@ -33,10 +33,10 @@ public class BatchListenerFailedException extends KafkaException {
3333

3434
private static final long serialVersionUID = 1L;
3535

36-
private final ConsumerRecord<?, ?> record;
37-
3836
private final int index;
3937

38+
private transient ConsumerRecord<?, ?> record;
39+
4040
/**
4141
* Construct an instance with the provided properties.
4242
* @param message the message.

spring-kafka/src/main/java/org/springframework/kafka/mock/MockConsumerFactory.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,13 @@
3939
*/
4040
public class MockConsumerFactory<K, V> implements ConsumerFactory<K, V> {
4141

42-
private final Supplier<MockConsumer> consumerProvider;
42+
private final Supplier<MockConsumer<K, V>> consumerProvider;
4343

4444
/**
4545
* Create an instance with the supplied consumer provicer.
4646
* @param consumerProvider the consumer provider.
4747
*/
48-
public MockConsumerFactory(Supplier<MockConsumer> consumerProvider) {
48+
public MockConsumerFactory(Supplier<MockConsumer<K, V>> consumerProvider) {
4949
this.consumerProvider = consumerProvider;
5050
}
5151

spring-kafka/src/main/java/org/springframework/kafka/mock/MockProducerFactory.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public class MockProducerFactory<K, V> implements ProducerFactory<K, V> {
4848
* Create an instance that does not support transactional producers.
4949
* @param producerProvider a {@link Supplier} for a {@link MockProducer}.
5050
*/
51-
public MockProducerFactory(Supplier<MockProducer> producerProvider) {
51+
public MockProducerFactory(Supplier<MockProducer<K, V>> producerProvider) {
5252
this.producerProvider = (tx, id) -> producerProvider.get();
5353
this.defaultTxId = null;
5454
this.transactional = false;

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2018-2021 the original author or authors.
2+
* Copyright 2018-2023 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.
@@ -104,7 +104,8 @@ private List<Long> generateFromNoBackOffPolicy(int maxAttempts) {
104104
private static class BackoffRetainerSleeper implements Sleeper {
105105

106106
private static final long serialVersionUID = 1L;
107-
private final List<Long> backoffValues = new ArrayList<>();
107+
108+
private transient List<Long> backoffValues = new ArrayList<>();
108109

109110
@Override
110111
public void sleep(long backOffPeriod) throws InterruptedException {

0 commit comments

Comments
 (0)