Skip to content

Commit 610f9c1

Browse files
committed
spring-projectsGH-3132: Remove usage of super();
Fixes spring-projects#3132 It turns out that Checkstyle EmptyBlock doesn't complain about empty default ctor. Plus a new check for `super();` call treats it as a violation * Remove `super();` from all the no-arg ctors * Code style clean up in the affected classes according IDEA suggestions
1 parent 9c68ae4 commit 610f9c1

File tree

118 files changed

+315
-435
lines changed

Some content is hidden

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

118 files changed

+315
-435
lines changed

spring-integration-amqp/src/main/java/org/springframework/integration/amqp/support/EndpointUtils.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
* Utility methods for messaging endpoints.
2626
*
2727
* @author Gary Russell
28+
* @author Artem Bilan
2829
*
2930
* @since 5.1.3
3031
*
@@ -34,7 +35,6 @@ public final class EndpointUtils {
3435
private static final String LEFE_MESSAGE = "Message conversion failed";
3536

3637
private EndpointUtils() {
37-
super();
3838
}
3939

4040
/**
@@ -43,16 +43,16 @@ private EndpointUtils() {
4343
* @param message the failed message.
4444
* @param channel the channel.
4545
* @param isManualAck true if the container uses manual acknowledgment.
46-
* @param e the exception.
46+
* @param ex the exception.
4747
* @return the exception.
4848
*/
49-
public static ListenerExecutionFailedException errorMessagePayload(final Message message,
50-
Channel channel, boolean isManualAck, Exception e) {
49+
public static ListenerExecutionFailedException errorMessagePayload(Message message,
50+
Channel channel, boolean isManualAck, Exception ex) {
5151

5252
return isManualAck
53-
? new ManualAckListenerExecutionFailedException(LEFE_MESSAGE, e, message, channel,
53+
? new ManualAckListenerExecutionFailedException(LEFE_MESSAGE, ex, message, channel,
5454
message.getMessageProperties().getDeliveryTag())
55-
: new ListenerExecutionFailedException(LEFE_MESSAGE, e, message);
55+
: new ListenerExecutionFailedException(LEFE_MESSAGE, ex, message);
5656
}
5757

5858
}

spring-integration-amqp/src/main/java/org/springframework/integration/amqp/support/MappingUtils.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@
3838
public final class MappingUtils {
3939

4040
private MappingUtils() {
41-
super();
4241
}
4342

4443
/**

spring-integration-core/src/main/java/org/springframework/integration/StaticMessageHeaderAccessor.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
* creation just to access a header.
3232
*
3333
* @author Gary Russell
34+
* @author Artem Bilan
3435
*
3536
* @since 5.0.1
3637
*
@@ -39,7 +40,6 @@
3940
public final class StaticMessageHeaderAccessor {
4041

4142
private StaticMessageHeaderAccessor() {
42-
super();
4343
}
4444

4545
@Nullable

spring-integration-core/src/main/java/org/springframework/integration/acks/AckUtils.java

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -18,31 +18,19 @@
1818

1919
import org.springframework.integration.acks.AcknowledgmentCallback.Status;
2020
import org.springframework.lang.Nullable;
21-
import org.springframework.messaging.Message;
2221

2322
/**
2423
* Utility methods for acting on {@link AcknowledgmentCallback} headers.
2524
*
2625
* @author Gary Russell
26+
* @author Artem Bilan
27+
*
2728
* @since 5.0.1
2829
*
2930
*/
3031
public final class AckUtils {
3132

3233
private AckUtils() {
33-
super();
34-
}
35-
36-
/**
37-
* Return the {@link AcknowledgmentCallback} header (if present).
38-
* @param message the message.
39-
* @return the callback, or null.
40-
* @deprecated use StaticMessageHeaderAccessor.getAcknowledgmentCallback(message).
41-
*/
42-
@Deprecated
43-
@Nullable
44-
public static AcknowledgmentCallback getAckCallback(Message<?> message) {
45-
throw new UnsupportedOperationException("Use StaticMessageHeaderAccessor.getAcknowledgmentCallback(message)");
4634
}
4735

4836
/**

spring-integration-core/src/main/java/org/springframework/integration/aggregator/AbstractCorrelatingMessageHandler.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -960,7 +960,6 @@ private boolean containsSequenceNumber(Collection<Message<?>> messages, Integer
960960
private class ForceReleaseMessageGroupProcessor implements MessageGroupProcessor {
961961

962962
ForceReleaseMessageGroupProcessor() {
963-
super();
964963
}
965964

966965
@Override

spring-integration-core/src/main/java/org/springframework/integration/aggregator/MessageCountReleaseStrategy.java

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,29 +19,30 @@
1919
import org.springframework.integration.store.MessageGroup;
2020

2121
/**
22-
* A {@link ReleaseStrategy} that releases only the first <code>n</code> messages, where <code>n</code> is a threshold.
22+
* A {@link ReleaseStrategy} that releases only the first {@code n} messages, where {@code n} is a threshold.
2323
*
2424
* @author Dave Syer
2525
* @author Oleg Zhurakousky
26+
* @author Artem Bilan
2627
*
2728
*/
2829
public class MessageCountReleaseStrategy implements ReleaseStrategy {
2930

3031
private final int threshold;
3132

3233
/**
33-
* @param threshold the number of messages to accept before releasing
34+
* Convenient constructor is only one message is required (threshold=1).
3435
*/
35-
public MessageCountReleaseStrategy(int threshold) {
36-
super();
37-
this.threshold = threshold;
36+
public MessageCountReleaseStrategy() {
37+
this(1);
3838
}
3939

4040
/**
41-
* Convenient constructor is only one message is required (threshold=1).
41+
* Construct an instance based on the provided threshold.
42+
* @param threshold the number of messages to accept before releasing
4243
*/
43-
public MessageCountReleaseStrategy() {
44-
this(1);
44+
public MessageCountReleaseStrategy(int threshold) {
45+
this.threshold = threshold;
4546
}
4647

4748
/**

spring-integration-core/src/main/java/org/springframework/integration/channel/ChannelUtils.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ public final class ChannelUtils {
3535
public static final String MESSAGE_PUBLISHING_ERROR_HANDLER_BEAN_NAME = "integrationMessagePublishingErrorHandler";
3636

3737
private ChannelUtils() {
38-
super();
3938
}
4039

4140
/**
@@ -56,5 +55,4 @@ public static ErrorHandler getErrorHandler(BeanFactory beanFactory) {
5655
return beanFactory.getBean(MESSAGE_PUBLISHING_ERROR_HANDLER_BEAN_NAME, ErrorHandler.class);
5756
}
5857

59-
6058
}

spring-integration-core/src/main/java/org/springframework/integration/channel/MessageChannelReactiveUtils.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@
4040
public final class MessageChannelReactiveUtils {
4141

4242
private MessageChannelReactiveUtils() {
43-
super();
4443
}
4544

4645
@SuppressWarnings("unchecked")

spring-integration-core/src/main/java/org/springframework/integration/dsl/Channels.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,6 @@ public FluxMessageChannelSpec flux(String id) {
132132
}
133133

134134
private Channels() {
135-
super();
136135
}
137136

138137
}

spring-integration-core/src/main/java/org/springframework/integration/dsl/DirectChannelSpec.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ protected DirectChannel doGet() {
3838
}
3939

4040
DirectChannelSpec() {
41-
super();
4241
}
4342

4443
}

spring-integration-core/src/main/java/org/springframework/integration/dsl/IntegrationFlowBuilder.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
public final class IntegrationFlowBuilder extends IntegrationFlowDefinition<IntegrationFlowBuilder> {
2929

3030
IntegrationFlowBuilder() {
31-
super();
3231
}
3332

3433
@Override

spring-integration-core/src/main/java/org/springframework/integration/dsl/LoadBalancingChannelSpec.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ public abstract class LoadBalancingChannelSpec<S extends MessageChannelSpec<S, C
3939
protected Integer maxSubscribers; // NOSONAR
4040

4141
protected LoadBalancingChannelSpec() {
42-
super();
4342
}
4443

4544
public S loadBalancer(LoadBalancingStrategy loadBalancingStrategyToSet) {

spring-integration-core/src/main/java/org/springframework/integration/dsl/MessageChannelSpec.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ public abstract class MessageChannelSpec<S extends MessageChannelSpec<S, C>, C e
5454
private MessageConverter messageConverter;
5555

5656
protected MessageChannelSpec() {
57-
super();
5857
}
5958

6059
public S datatype(Class<?>... types) {
@@ -118,7 +117,7 @@ public Map<Object, String> getComponentsToRegister() {
118117

119118
@Override
120119
protected C doGet() {
121-
this.channel.setDatatypes(this.datatypes.toArray(new Class<?>[this.datatypes.size()]));
120+
this.channel.setDatatypes(this.datatypes.toArray(new Class<?>[0]));
122121
this.channel.setBeanName(getId());
123122
this.channel.setInterceptors(this.interceptors);
124123
this.channel.setMessageConverter(this.messageConverter);

spring-integration-core/src/main/java/org/springframework/integration/dsl/MessageChannels.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,6 @@ public static FluxMessageChannelSpec flux(String id) {
133133
}
134134

135135
private MessageChannels() {
136-
super();
137136
}
138137

139138
}

spring-integration-core/src/main/java/org/springframework/integration/dsl/PollerFactory.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,6 @@ public PollerSpec fixedDelay(long period) {
8181
}
8282

8383
PollerFactory() {
84-
super();
8584
}
8685

8786
}

spring-integration-core/src/main/java/org/springframework/integration/dsl/PriorityChannelSpec.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ public class PriorityChannelSpec extends MessageChannelSpec<PriorityChannelSpec,
3838
private MessageGroupQueue messageGroupQueue;
3939

4040
PriorityChannelSpec() {
41-
super();
4241
}
4342

4443
public PriorityChannelSpec capacity(int capacity) {

spring-integration-core/src/main/java/org/springframework/integration/dsl/PublishSubscribeChannelSpec.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
import java.util.concurrent.Executor;
2020

2121
import org.springframework.integration.channel.PublishSubscribeChannel;
22+
import org.springframework.lang.Nullable;
2223
import org.springframework.util.ErrorHandler;
2324

2425
/**
@@ -33,10 +34,10 @@ public class PublishSubscribeChannelSpec<S extends PublishSubscribeChannelSpec<S
3334
extends MessageChannelSpec<S, PublishSubscribeChannel> {
3435

3536
protected PublishSubscribeChannelSpec() {
36-
this.channel = new PublishSubscribeChannel();
37+
this(null);
3738
}
3839

39-
protected PublishSubscribeChannelSpec(Executor executor) {
40+
protected PublishSubscribeChannelSpec(@Nullable Executor executor) {
4041
this.channel = new PublishSubscribeChannel(executor);
4142
}
4243

spring-integration-core/src/main/java/org/springframework/integration/dsl/PublishSubscribeSpec.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import java.util.Map;
2121
import java.util.concurrent.Executor;
2222

23+
import org.springframework.lang.Nullable;
2324
import org.springframework.messaging.MessageChannel;
2425
import org.springframework.util.Assert;
2526

@@ -36,10 +37,9 @@ public class PublishSubscribeSpec extends PublishSubscribeChannelSpec<PublishSub
3637
private int order;
3738

3839
PublishSubscribeSpec() {
39-
super();
4040
}
4141

42-
PublishSubscribeSpec(Executor executor) {
42+
PublishSubscribeSpec(@Nullable Executor executor) {
4343
super(executor);
4444
}
4545

spring-integration-core/src/main/java/org/springframework/integration/dsl/QueueChannelSpec.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ public class QueueChannelSpec extends MessageChannelSpec<QueueChannelSpec, Queue
3636
protected Integer capacity; // NOSONAR
3737

3838
QueueChannelSpec() {
39-
super();
4039
}
4140

4241
QueueChannelSpec(Queue<Message<?>> queue) {
@@ -73,7 +72,6 @@ public static class MessageStoreSpec extends QueueChannelSpec {
7372
private Lock storeLock;
7473

7574
MessageStoreSpec(ChannelMessageStore messageGroupStore, Object groupId) {
76-
super();
7775
this.messageGroupStore = messageGroupStore;
7876
this.groupId = groupId;
7977
}

spring-integration-core/src/main/java/org/springframework/integration/endpoint/ReactiveStreamsConsumer.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,6 @@ private final class DelegatingSubscriber extends BaseSubscriber<Message<?>> {
150150
private final Subscriber<Message<?>> delegate = ReactiveStreamsConsumer.this.subscriber;
151151

152152
DelegatingSubscriber() {
153-
super();
154153
}
155154

156155
@Override

spring-integration-core/src/main/java/org/springframework/integration/expression/ExpressionEvalMap.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,6 @@ public ExpressionEvalMapComponentsBuilder withReturnType(Class<?> returnType) {
303303
private class ExpressionEvalMapFinalBuilderImpl implements ExpressionEvalMapFinalBuilder {
304304

305305
ExpressionEvalMapFinalBuilderImpl() {
306-
super();
307306
}
308307

309308
@Override
@@ -327,7 +326,6 @@ private class ExpressionEvalMapComponentsBuilderImpl extends ExpressionEvalMapFi
327326
implements ExpressionEvalMapComponentsBuilder {
328327

329328
ExpressionEvalMapComponentsBuilderImpl() {
330-
super();
331329
}
332330

333331
@Override

spring-integration-core/src/main/java/org/springframework/integration/expression/ExpressionUtils.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ public final class ExpressionUtils {
6060
private static final Log LOGGER = LogFactory.getLog(ExpressionUtils.class);
6161

6262
private ExpressionUtils() {
63-
super();
6463
}
6564

6665
/**

0 commit comments

Comments
 (0)