GH-3132: Remove usage of super();

Fixes https://github.com/spring-projects/spring-integration/issues/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

* Fix new Sonar smells
This commit is contained in:
Artem Bilan
2019-12-27 13:04:10 -05:00
committed by Gary Russell
parent 9c68ae4a7d
commit 5ac262f866
127 changed files with 386 additions and 490 deletions

View File

@@ -30,12 +30,12 @@ import org.springframework.web.bind.annotation.RequestMapping;
*
* @author Artem Bilan
* @author Gary Russell
*
* @since 3.0
*/
public final class HttpContextUtils {
private HttpContextUtils() {
super();
}
/**

View File

@@ -26,7 +26,6 @@ import org.springframework.integration.http.inbound.HttpRequestHandlingControlle
import org.springframework.integration.http.inbound.HttpRequestHandlingMessagingGateway;
import org.springframework.messaging.Message;
import org.springframework.util.Assert;
import org.springframework.util.StringUtils;
import org.springframework.web.client.RestTemplate;
/**
@@ -111,6 +110,7 @@ public final class Http {
*/
public static <P> HttpMessageHandlerSpec outboundChannelAdapter(Function<Message<P>, ?> uriFunction,
RestTemplate restTemplate) {
return outboundChannelAdapter(new FunctionExpression<>(uriFunction), restTemplate);
}
@@ -198,6 +198,7 @@ public final class Http {
*/
public static <P> HttpMessageHandlerSpec outboundGateway(Function<Message<P>, ?> uriFunction,
RestTemplate restTemplate) {
return outboundGateway(new FunctionExpression<>(uriFunction), restTemplate);
}
@@ -221,7 +222,7 @@ public final class Http {
* @return the HttpControllerEndpointSpec instance
*/
public static HttpControllerEndpointSpec inboundControllerAdapter(String viewName, String... path) {
Assert.isTrue(StringUtils.hasText(viewName), "View name must not be empty");
Assert.hasText(viewName, "View name must not be empty");
return inboundControllerAdapter(new LiteralExpression(viewName), path);
}
@@ -246,7 +247,7 @@ public final class Http {
* @return the HttpControllerEndpointSpec instance
*/
public static HttpControllerEndpointSpec inboundControllerGateway(String viewName, String... path) {
Assert.isTrue(StringUtils.hasText(viewName), "View name must not be empty");
Assert.hasText(viewName, "View name must not be empty");
return inboundControllerGateway(new LiteralExpression(viewName), path);
}
@@ -285,7 +286,6 @@ public final class Http {
}
private Http() {
super();
}
}

View File

@@ -190,7 +190,7 @@ public abstract class HttpInboundEndpointSupportSpec<S extends HttpInboundEndpoi
*/
public S mappedRequestHeaders(String... patterns) {
Assert.isNull(this.explicitHeaderMapper,
"The 'mappedRequestHeaders' must be specified on the provided 'headerMapper': "
() -> "The 'mappedRequestHeaders' must be specified on the provided 'headerMapper': "
+ this.explicitHeaderMapper);
((DefaultHttpHeaderMapper) this.headerMapper).setInboundHeaderNames(patterns);
return _this();
@@ -204,7 +204,7 @@ public abstract class HttpInboundEndpointSupportSpec<S extends HttpInboundEndpoi
*/
public S mappedResponseHeaders(String... patterns) {
Assert.isNull(this.explicitHeaderMapper,
"The 'mappedRequestHeaders' must be specified on the provided 'headerMapper': "
() -> "The 'mappedRequestHeaders' must be specified on the provided 'headerMapper': "
+ this.explicitHeaderMapper);
((DefaultHttpHeaderMapper) this.headerMapper).setOutboundHeaderNames(patterns);
return _this();
@@ -214,7 +214,7 @@ public abstract class HttpInboundEndpointSupportSpec<S extends HttpInboundEndpoi
* Specify the type of payload to be generated when the inbound HTTP request content is read by the
* {@link org.springframework.http.converter.HttpMessageConverter}s.
* By default this value is null which means at runtime any "text" Content-Type will
* result in String while all others default to <code>byte[].class</code>.
* result in String while all others default to {@code byte[].class}.
* @param requestPayloadType The payload type.
* @return the current Spec.
*/
@@ -227,7 +227,7 @@ public abstract class HttpInboundEndpointSupportSpec<S extends HttpInboundEndpoi
* Specify the type of payload to be generated when the inbound HTTP request content is read by the
* {@link org.springframework.http.converter.HttpMessageConverter}s.
* By default this value is null which means at runtime any "text" Content-Type will
* result in String while all others default to <code>byte[].class</code>.
* result in String while all others default to {@code byte[].class}.
* @param requestPayloadType The payload type.
* @return the current Spec.
*/
@@ -373,7 +373,6 @@ public abstract class HttpInboundEndpointSupportSpec<S extends HttpInboundEndpoi
private final CrossOrigin crossOrigin = new CrossOrigin();
CrossOriginSpec() {
super();
}
/**