From c2954881ad59c1fc2926e37a581cb4ed5949d53d Mon Sep 17 00:00:00 2001 From: Artem Bilan Date: Thu, 17 Mar 2016 13:10:05 -0400 Subject: [PATCH] Enable `RedundantModifier` checkstyle, add fixer Add `fixModifiers.gradle` to run after `check` task. The `RedundantModifierChecker` doesn't catch all errors at once. We need run `check -> fixModifiers` pair several times to reach `SUCCESSFUL`. The `fixThis` has been ported from the SA, but without applying. * Polishing for `fixModifiers.gradle` * Fix all redundant modifier with the `fixModifiers.gradle` NOTE: Since all these task modify files on Windows we have to run them with the `-Dfile.encoding=UTF-8`. Otherwise they are read and write with the Windows default `cp1251` making them incompatible with Unix system. --- build.gradle | 1 + .../aop/PublisherMetadataSource.java | 10 +-- .../dispatcher/LoadBalancingStrategy.java | 2 +- .../integration/gateway/MethodArgsHolder.java | 4 +- .../handler/PostProcessingMessageHandler.java | 2 +- .../json/JsonInboundMessageMapper.java | 4 +- .../integration/util/SimplePool.java | 4 +- .../MessagePublishingInterceptorTests.java | 4 +- .../aop/PublisherAnnotationAdvisorTests.java | 6 +- .../aop/PublisherExpressionTests.java | 4 +- .../ChannelCapacityPlaceholderTests.java | 4 +- ...MessagingAnnotationPostProcessorTests.java | 4 +- .../config/xml/PNamespaceTests.java | 4 +- .../core/TimeBasedUUIDGenerator.java | 2 +- .../gateway/GatewayInterfaceTests.java | 14 ++-- .../GatewayInvokingMessageHandlerTests.java | 6 +- ...hodInboundMessageMapperToMessageTests.java | 4 +- .../gateway/GatewayProxyFactoryBeanTests.java | 6 +- .../GatewayProxyMessageMappingTests.java | 4 +- .../gateway/GatewayRequiresReplyTests.java | 6 +- .../gateway/GatewayWithHeaderAnnotations.java | 6 +- .../GatewayWithPayloadExpressionTests.java | 6 +- .../gateway/GatewayXmlAndAnnotationTests.java | 2 +- .../gateway/HeaderEnrichedGatewayTests.java | 10 +-- .../gateway/InnerGatewayWithChainTests.java | 4 +- .../MultiMethodGatewayConfigTests.java | 10 +-- .../gateway/MultipleEndpointGatewayTests.java | 4 +- .../integration/handler/MockHandlerTests.java | 4 +- .../MessageHistoryIntegrationTests.java | 6 +- .../config/HeaderValueRouterParserTests.java | 10 +-- .../config/PayloadTypeRouterParserTests.java | 6 +- .../MutableMessageBuilderFactoryTests.java | 2 +- .../integration/file/remote/FileInfo.java | 18 ++--- .../remote/session/SharedSessionCapable.java | 4 +- ...tegrationRequestMappingHandlerMapping.java | 6 +- .../TcpConnectionInterceptorFactory.java | 2 +- .../ip/tcp/connection/TcpListener.java | 4 +- .../ip/tcp/ClientModeControlBusTests.java | 2 +- .../jdbc/SqlParameterSourceFactory.java | 4 +- .../integration/jms/JmsHeaderMapper.java | 4 +- .../ExceptionHandlingSiConsumerTests.java | 6 +- .../jms/config/JmsMessageHistoryTests.java | 8 +-- .../config/JmsOutboundGatewayParserTests.java | 6 +- .../AttributePollingMessageSourceTests.java | 4 +- .../OperationInvokingMessageHandlerTests.java | 4 +- ...eActivatorDefaultFrameworkMethodTests.java | 4 +- .../jmx/config/RouterMBeanTests.java | 2 +- .../HandlerMonitoringIntegrationTests.java | 2 +- .../MBeanExporterIntegrationTests.java | 4 +- ...ssageSourceMonitoringIntegrationTests.java | 2 +- .../monitor/RemoteMBeanServerTests.java | 2 +- ...igurableMongoDbMessageGroupStoreTests.java | 2 +- .../RedisStoreWritingMessageHandler.java | 2 +- .../integration/scripting/ScriptExecutor.java | 4 +- .../security/channel/ChannelAccessPolicy.java | 6 +- .../client/StompIntegrationTests.java | 2 +- .../integration/xml/XmlPayloadConverter.java | 8 +-- .../xmpp/core/XmppContextUtils.java | 4 +- src/checkstyle/checkstyle-suppressions.xml | 2 + src/checkstyle/checkstyle.xml | 2 +- src/checkstyle/fixModifiers.gradle | 50 ++++++++++++++ src/checkstyle/fixThis.gradle | 65 +++++++++++++++++++ 62 files changed, 259 insertions(+), 141 deletions(-) create mode 100644 src/checkstyle/fixModifiers.gradle create mode 100644 src/checkstyle/fixThis.gradle diff --git a/build.gradle b/build.gradle index 4e1a8311f2..ea1ed5062d 100644 --- a/build.gradle +++ b/build.gradle @@ -60,6 +60,7 @@ subprojects { subproject -> apply plugin: 'checkstyle' apply from: "${rootDir}/src/checkstyle/fixHeaders.gradle" + apply from: "${rootDir}/src/checkstyle/fixModifiers.gradle" if (project.hasProperty('platformVersion')) { apply plugin: 'spring-io' diff --git a/spring-integration-core/src/main/java/org/springframework/integration/aop/PublisherMetadataSource.java b/spring-integration-core/src/main/java/org/springframework/integration/aop/PublisherMetadataSource.java index 7186404149..2b9cf52ad8 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/aop/PublisherMetadataSource.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/aop/PublisherMetadataSource.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2014 the original author or authors. + * Copyright 2002-2016 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -29,13 +29,13 @@ import java.util.Map; */ interface PublisherMetadataSource { - static final String METHOD_NAME_VARIABLE_NAME = "method"; + String METHOD_NAME_VARIABLE_NAME = "method"; - static final String ARGUMENT_MAP_VARIABLE_NAME = "args"; + String ARGUMENT_MAP_VARIABLE_NAME = "args"; - static final String RETURN_VALUE_VARIABLE_NAME = "return"; + String RETURN_VALUE_VARIABLE_NAME = "return"; - static final String EXCEPTION_VARIABLE_NAME = "exception"; + String EXCEPTION_VARIABLE_NAME = "exception"; /** diff --git a/spring-integration-core/src/main/java/org/springframework/integration/dispatcher/LoadBalancingStrategy.java b/spring-integration-core/src/main/java/org/springframework/integration/dispatcher/LoadBalancingStrategy.java index 26878ab1df..b161b76ee0 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/dispatcher/LoadBalancingStrategy.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/dispatcher/LoadBalancingStrategy.java @@ -31,6 +31,6 @@ import org.springframework.messaging.MessageHandler; */ public interface LoadBalancingStrategy { - public Iterator getHandlerIterator(Message message, Collection handlers); + Iterator getHandlerIterator(Message message, Collection handlers); } diff --git a/spring-integration-core/src/main/java/org/springframework/integration/gateway/MethodArgsHolder.java b/spring-integration-core/src/main/java/org/springframework/integration/gateway/MethodArgsHolder.java index 55aff5f5bf..d78d6ad184 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/gateway/MethodArgsHolder.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/gateway/MethodArgsHolder.java @@ -40,11 +40,11 @@ public final class MethodArgsHolder { this.args = args;//NOSONAR - direct storage } - public final Method getMethod() { + public Method getMethod() { return method; } - public final Object[] getArgs() { + public Object[] getArgs() { return args;//NOSONAR - direct access } diff --git a/spring-integration-core/src/main/java/org/springframework/integration/handler/PostProcessingMessageHandler.java b/spring-integration-core/src/main/java/org/springframework/integration/handler/PostProcessingMessageHandler.java index ad70bec570..4a388eb59d 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/handler/PostProcessingMessageHandler.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/handler/PostProcessingMessageHandler.java @@ -37,6 +37,6 @@ public interface PostProcessingMessageHandler { * @param message The message. * @return The post-processed result. */ - public Object postProcess(Message message, Object result); + Object postProcess(Message message, Object result); } diff --git a/spring-integration-core/src/main/java/org/springframework/integration/support/json/JsonInboundMessageMapper.java b/spring-integration-core/src/main/java/org/springframework/integration/support/json/JsonInboundMessageMapper.java index 8b27de79b4..d03809566b 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/support/json/JsonInboundMessageMapper.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/support/json/JsonInboundMessageMapper.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2013 the original author or authors. + * Copyright 2002-2016 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -76,7 +76,7 @@ public class JsonInboundMessageMapper extends AbstractJsonInboundMessageMapper { + public interface JsonMessageParser

{ Message doInParser(JsonInboundMessageMapper messageMapper, String jsonMessage) throws Exception; diff --git a/spring-integration-core/src/main/java/org/springframework/integration/util/SimplePool.java b/spring-integration-core/src/main/java/org/springframework/integration/util/SimplePool.java index ca0c58deb5..a7d81b9fc1 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/util/SimplePool.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/util/SimplePool.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2014 the original author or authors. + * Copyright 2002-2016 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -255,7 +255,7 @@ public class SimplePool implements Pool { * various pool operations. * */ - public static interface PoolItemCallback { + public interface PoolItemCallback { /** * Called by the pool when a new instance is required to populate the pool. Only diff --git a/spring-integration-core/src/test/java/org/springframework/integration/aop/MessagePublishingInterceptorTests.java b/spring-integration-core/src/test/java/org/springframework/integration/aop/MessagePublishingInterceptorTests.java index 7b3c737bc8..c0ebfc0ad5 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/aop/MessagePublishingInterceptorTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/aop/MessagePublishingInterceptorTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2016 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -100,7 +100,7 @@ public class MessagePublishingInterceptorTests { } - static interface TestBean { + interface TestBean { String test(); diff --git a/spring-integration-core/src/test/java/org/springframework/integration/aop/PublisherAnnotationAdvisorTests.java b/spring-integration-core/src/test/java/org/springframework/integration/aop/PublisherAnnotationAdvisorTests.java index bf8349ab70..f604b49a64 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/aop/PublisherAnnotationAdvisorTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/aop/PublisherAnnotationAdvisorTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2014 the original author or authors. + * Copyright 2002-2016 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -121,14 +121,14 @@ public class PublisherAnnotationAdvisorTests { } - static interface TestBean { + interface TestBean { String test(); } - static interface TestVoidBean { + interface TestVoidBean { void testVoidMethod(String s); diff --git a/spring-integration-core/src/test/java/org/springframework/integration/aop/PublisherExpressionTests.java b/spring-integration-core/src/test/java/org/springframework/integration/aop/PublisherExpressionTests.java index 12fc706b30..3b5d2feb18 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/aop/PublisherExpressionTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/aop/PublisherExpressionTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2014 the original author or authors. + * Copyright 2002-2016 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -72,7 +72,7 @@ public class PublisherExpressionTests { } - static interface TestBean { + interface TestBean { String test(String sku); } diff --git a/spring-integration-core/src/test/java/org/springframework/integration/channel/config/ChannelCapacityPlaceholderTests.java b/spring-integration-core/src/test/java/org/springframework/integration/channel/config/ChannelCapacityPlaceholderTests.java index 8776b5ee6a..6f4de3d9e1 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/channel/config/ChannelCapacityPlaceholderTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/channel/config/ChannelCapacityPlaceholderTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2016 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -52,7 +52,7 @@ public class ChannelCapacityPlaceholderTests { } - public static interface TestService { + public interface TestService { @org.springframework.integration.annotation.Gateway(requestChannel="channel") void test(); diff --git a/spring-integration-core/src/test/java/org/springframework/integration/config/annotation/MessagingAnnotationPostProcessorTests.java b/spring-integration-core/src/test/java/org/springframework/integration/config/annotation/MessagingAnnotationPostProcessorTests.java index 494ccfe4d1..9654190e2d 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/config/annotation/MessagingAnnotationPostProcessorTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/config/annotation/MessagingAnnotationPostProcessorTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2014 the original author or authors. + * Copyright 2002-2016 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -346,7 +346,7 @@ public class MessagingAnnotationPostProcessorTests { @MessageEndpoint - private static interface SimpleAnnotatedEndpointInterface { + private interface SimpleAnnotatedEndpointInterface { String test(String input); } diff --git a/spring-integration-core/src/test/java/org/springframework/integration/config/xml/PNamespaceTests.java b/spring-integration-core/src/test/java/org/springframework/integration/config/xml/PNamespaceTests.java index 2577034a95..43644f15d4 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/config/xml/PNamespaceTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/config/xml/PNamespaceTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2016 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -105,7 +105,7 @@ public class PNamespaceTests { public interface InboundGateway { - public String echo(); + String echo(); } diff --git a/spring-integration-core/src/test/java/org/springframework/integration/core/TimeBasedUUIDGenerator.java b/spring-integration-core/src/test/java/org/springframework/integration/core/TimeBasedUUIDGenerator.java index 13bd88b2c8..b9efec5245 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/core/TimeBasedUUIDGenerator.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/core/TimeBasedUUIDGenerator.java @@ -83,7 +83,7 @@ class TimeBasedUUIDGenerator { return new UUID(time, lsb); } } - private static final long getMac(){ + private static long getMac(){ long macAddressAsLong = 0; try { InetAddress address = InetAddress.getLocalHost(); diff --git a/spring-integration-core/src/test/java/org/springframework/integration/gateway/GatewayInterfaceTests.java b/spring-integration-core/src/test/java/org/springframework/integration/gateway/GatewayInterfaceTests.java index bba5cfa415..14f4fd943d 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/gateway/GatewayInterfaceTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/gateway/GatewayInterfaceTests.java @@ -397,19 +397,19 @@ public class GatewayInterfaceTests { public interface Foo { @Gateway(requestChannel="requestChannelFoo") - public void foo(String payload); + void foo(String payload); - public void baz(String payload); + void baz(String payload); - public String lateReply(String payload); + String lateReply(String payload); } - public static interface Bar extends Foo { + public interface Bar extends Foo { @Gateway(requestChannel="requestChannelBar") - public void bar(String payload); + void bar(String payload); - public void qux(String payload, @Header("name") String nameHeader); + void qux(String payload, @Header("name") String nameHeader); } public static class NotAnInterface { @@ -418,7 +418,7 @@ public class GatewayInterfaceTests { public interface Baz { - public void baz(String payload); + void baz(String payload); } public static class BazMapper implements MethodArgsMessageMapper { diff --git a/spring-integration-core/src/test/java/org/springframework/integration/gateway/GatewayInvokingMessageHandlerTests.java b/spring-integration-core/src/test/java/org/springframework/integration/gateway/GatewayInvokingMessageHandlerTests.java index 1cfd4cfb72..72d0ba8656 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/gateway/GatewayInvokingMessageHandlerTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/gateway/GatewayInvokingMessageHandlerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2013 the original author or authors. + * Copyright 2002-2016 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -163,8 +163,8 @@ public class GatewayInvokingMessageHandlerTests { } - public static interface SimpleGateway { - public String process(String str); + public interface SimpleGateway { + String process(String str); } diff --git a/spring-integration-core/src/test/java/org/springframework/integration/gateway/GatewayMethodInboundMessageMapperToMessageTests.java b/spring-integration-core/src/test/java/org/springframework/integration/gateway/GatewayMethodInboundMessageMapperToMessageTests.java index 755e91f30f..e33e1b96b9 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/gateway/GatewayMethodInboundMessageMapperToMessageTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/gateway/GatewayMethodInboundMessageMapperToMessageTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2014 the original author or authors. + * Copyright 2002-2016 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -286,7 +286,7 @@ public class GatewayMethodInboundMessageMapperToMessageTests { } - private static interface TestService { + private interface TestService { void sendPayload(String payload); diff --git a/spring-integration-core/src/test/java/org/springframework/integration/gateway/GatewayProxyFactoryBeanTests.java b/spring-integration-core/src/test/java/org/springframework/integration/gateway/GatewayProxyFactoryBeanTests.java index 973e84a083..957aebe54d 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/gateway/GatewayProxyFactoryBeanTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/gateway/GatewayProxyFactoryBeanTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2015 the original author or authors. + * Copyright 2002-2016 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -399,13 +399,13 @@ public class GatewayProxyFactoryBeanTests { } - static interface TestEchoService { + interface TestEchoService { Message echo(String s); } - static interface TestExceptionThrowingInterface { + interface TestExceptionThrowingInterface { String throwCheckedException(String s) throws TestException; } diff --git a/spring-integration-core/src/test/java/org/springframework/integration/gateway/GatewayProxyMessageMappingTests.java b/spring-integration-core/src/test/java/org/springframework/integration/gateway/GatewayProxyMessageMappingTests.java index 58d643ef59..d4fedfa22a 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/gateway/GatewayProxyMessageMappingTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/gateway/GatewayProxyMessageMappingTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2015 the original author or authors. + * Copyright 2002-2016 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -211,7 +211,7 @@ public class GatewayProxyMessageMappingTests { } - public static interface TestGateway { + public interface TestGateway { void payloadAndHeaderMapWithoutAnnotations(String s, Map map); diff --git a/spring-integration-core/src/test/java/org/springframework/integration/gateway/GatewayRequiresReplyTests.java b/spring-integration-core/src/test/java/org/springframework/integration/gateway/GatewayRequiresReplyTests.java index c314076d6e..7cd98fe1cc 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/gateway/GatewayRequiresReplyTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/gateway/GatewayRequiresReplyTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2013 the original author or authors. + * Copyright 2002-2016 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -62,8 +62,8 @@ public class GatewayRequiresReplyTests { } - public static interface TestService { - public String test(String s); + public interface TestService { + String test(String s); } public static class LongRunningService { diff --git a/spring-integration-core/src/test/java/org/springframework/integration/gateway/GatewayWithHeaderAnnotations.java b/spring-integration-core/src/test/java/org/springframework/integration/gateway/GatewayWithHeaderAnnotations.java index bf9bc2d8b3..b94e6da140 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/gateway/GatewayWithHeaderAnnotations.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/gateway/GatewayWithHeaderAnnotations.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2014 the original author or authors. + * Copyright 2002-2016 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -48,9 +48,9 @@ public class GatewayWithHeaderAnnotations { } - public static interface TestService { + public interface TestService { // wrt INT-1205, priority no longer has a $ prefix, so here we are testing the $custom header as well - public String test(String str, @Header(IntegrationMessageHeaderAccessor.PRIORITY) int priority, + String test(String str, @Header(IntegrationMessageHeaderAccessor.PRIORITY) int priority, @Header("$custom") String custom); } diff --git a/spring-integration-core/src/test/java/org/springframework/integration/gateway/GatewayWithPayloadExpressionTests.java b/spring-integration-core/src/test/java/org/springframework/integration/gateway/GatewayWithPayloadExpressionTests.java index dd7ec83e10..70ddaff475 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/gateway/GatewayWithPayloadExpressionTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/gateway/GatewayWithPayloadExpressionTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2014 the original author or authors. + * Copyright 2002-2016 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -76,7 +76,7 @@ public class GatewayWithPayloadExpressionTests { } - public static interface SampleGateway { + public interface SampleGateway { void send1(String value); @@ -86,7 +86,7 @@ public class GatewayWithPayloadExpressionTests { } - public static interface SampleAnnotatedGateway { + public interface SampleAnnotatedGateway { @Payload("#args[0] + #args[1]") void send(String value1, String value2); diff --git a/spring-integration-core/src/test/java/org/springframework/integration/gateway/GatewayXmlAndAnnotationTests.java b/spring-integration-core/src/test/java/org/springframework/integration/gateway/GatewayXmlAndAnnotationTests.java index 4204e7b5f2..2fc28cfc3d 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/gateway/GatewayXmlAndAnnotationTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/gateway/GatewayXmlAndAnnotationTests.java @@ -74,7 +74,7 @@ public class GatewayXmlAndAnnotationTests { assertEquals(4, assertions); } - public static interface AGateway { + public interface AGateway { @Gateway String annotationShouldntOverrideDefault(String foo); diff --git a/spring-integration-core/src/test/java/org/springframework/integration/gateway/HeaderEnrichedGatewayTests.java b/spring-integration-core/src/test/java/org/springframework/integration/gateway/HeaderEnrichedGatewayTests.java index 4727ca4af3..8adfdaa2af 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/gateway/HeaderEnrichedGatewayTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/gateway/HeaderEnrichedGatewayTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2014 the original author or authors. + * Copyright 2002-2016 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -106,13 +106,13 @@ public class HeaderEnrichedGatewayTests { } - public static interface SampleGateway { + public interface SampleGateway { - public void sendString(String value); + void sendString(String value); - public void sendInteger(Integer value); + void sendInteger(Integer value); - public void sendStringWithParameterHeaders(String value, + void sendStringWithParameterHeaders(String value, @Header("headerA") String headerA, @Header("headerB") String headerB); } diff --git a/spring-integration-core/src/test/java/org/springframework/integration/gateway/InnerGatewayWithChainTests.java b/spring-integration-core/src/test/java/org/springframework/integration/gateway/InnerGatewayWithChainTests.java index ce9a276b5d..85c38b3a39 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/gateway/InnerGatewayWithChainTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/gateway/InnerGatewayWithChainTests.java @@ -110,7 +110,7 @@ public class InnerGatewayWithChainTests { verify(handler, times(1)).handleMessage(Mockito.any(Message.class)); } - public static interface TestGateway{ - public String echo(int value); + public interface TestGateway{ + String echo(int value); } } diff --git a/spring-integration-core/src/test/java/org/springframework/integration/gateway/MultiMethodGatewayConfigTests.java b/spring-integration-core/src/test/java/org/springframework/integration/gateway/MultiMethodGatewayConfigTests.java index 008c22f8fa..f25eb9b8d2 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/gateway/MultiMethodGatewayConfigTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/gateway/MultiMethodGatewayConfigTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2013 the original author or authors. + * Copyright 2002-2016 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -70,10 +70,10 @@ public class MultiMethodGatewayConfigTests { } } - public static interface TestGateway { - public String echo(String str); - public String echoViaDefault(String str); - public String echoUpperCase(String str); + public interface TestGateway { + String echo(String str); + String echoViaDefault(String str); + String echoUpperCase(String str); } } diff --git a/spring-integration-core/src/test/java/org/springframework/integration/gateway/MultipleEndpointGatewayTests.java b/spring-integration-core/src/test/java/org/springframework/integration/gateway/MultipleEndpointGatewayTests.java index b8025c4165..1453a0da0f 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/gateway/MultipleEndpointGatewayTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/gateway/MultipleEndpointGatewayTests.java @@ -58,8 +58,8 @@ public class MultipleEndpointGatewayTests { // there is nothing to assert. Successful execution of the above is all we care in this test } - public static interface SampleGateway{ - public Object echo(Object value); + public interface SampleGateway{ + Object echo(Object value); } public static class SampleEchoService { diff --git a/spring-integration-core/src/test/java/org/springframework/integration/handler/MockHandlerTests.java b/spring-integration-core/src/test/java/org/springframework/integration/handler/MockHandlerTests.java index 2a6c91d13d..c975268200 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/handler/MockHandlerTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/handler/MockHandlerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2016 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -58,7 +58,7 @@ public class MockHandlerTests { } - public static interface TestInterface { + public interface TestInterface { String test(String input); } diff --git a/spring-integration-core/src/test/java/org/springframework/integration/history/MessageHistoryIntegrationTests.java b/spring-integration-core/src/test/java/org/springframework/integration/history/MessageHistoryIntegrationTests.java index 038340fb47..96d7166cfe 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/history/MessageHistoryIntegrationTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/history/MessageHistoryIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2014 the original author or authors. + * Copyright 2002-2016 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -249,8 +249,8 @@ public class MessageHistoryIntegrationTests { System.out.println("Elapsed time without history 10000 calls: " + stopWatch.getTotalTimeSeconds()); } - public static interface SampleGateway { - public Message echo(String value); + public interface SampleGateway { + Message echo(String value); } } diff --git a/spring-integration-core/src/test/java/org/springframework/integration/router/config/HeaderValueRouterParserTests.java b/spring-integration-core/src/test/java/org/springframework/integration/router/config/HeaderValueRouterParserTests.java index 1d4d0b1bc2..7674b428aa 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/router/config/HeaderValueRouterParserTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/router/config/HeaderValueRouterParserTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2016 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -84,12 +84,12 @@ public class HeaderValueRouterParserTests { } - public static interface TestServiceA { - public void foo(Message message); + public interface TestServiceA { + void foo(Message message); } - public static interface TestServiceB { - public void foo(Message message); + public interface TestServiceB { + void foo(Message message); } } diff --git a/spring-integration-core/src/test/java/org/springframework/integration/router/config/PayloadTypeRouterParserTests.java b/spring-integration-core/src/test/java/org/springframework/integration/router/config/PayloadTypeRouterParserTests.java index 2f8eae5788..4f27134da9 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/router/config/PayloadTypeRouterParserTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/router/config/PayloadTypeRouterParserTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2016 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -106,8 +106,8 @@ public class PayloadTypeRouterParserTests { ""; - public static interface TestService{ - public void foo(Message message); + public interface TestService{ + void foo(Message message); } } diff --git a/spring-integration-core/src/test/java/org/springframework/integration/support/MutableMessageBuilderFactoryTests.java b/spring-integration-core/src/test/java/org/springframework/integration/support/MutableMessageBuilderFactoryTests.java index 5fc0e49f6e..1bbfdc984e 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/support/MutableMessageBuilderFactoryTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/support/MutableMessageBuilderFactoryTests.java @@ -91,7 +91,7 @@ public class MutableMessageBuilderFactoryTests { } @MessagingGateway - static interface TestGateway { + interface TestGateway { @Gateway(requestChannel = "input") void input(String payload); diff --git a/spring-integration-file/src/main/java/org/springframework/integration/file/remote/FileInfo.java b/spring-integration-file/src/main/java/org/springframework/integration/file/remote/FileInfo.java index 97139dc9b2..e2b5cb9495 100644 --- a/spring-integration-file/src/main/java/org/springframework/integration/file/remote/FileInfo.java +++ b/spring-integration-file/src/main/java/org/springframework/integration/file/remote/FileInfo.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2016 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -27,42 +27,42 @@ public interface FileInfo { /** * @return true if the remote file is a directory */ - public abstract boolean isDirectory(); + boolean isDirectory(); /** * @return true if the remote file is a link */ - public abstract boolean isLink(); + boolean isLink(); /** * @return the size of the remote file */ - public abstract long getSize(); + long getSize(); /** * @return the modified time of the remote file */ - public abstract long getModified(); + long getModified(); /** * @return the name of the remote file */ - public abstract String getFilename(); + String getFilename(); /** * @return the remote directory in which the file resides */ - public abstract String getRemoteDirectory(); + String getRemoteDirectory(); /** * @return a string representing the permissions of the remote * file (e.g. -rw-r--r--). */ - public String getPermissions(); + String getPermissions(); /** * @return the actual implementation from the underlying * library, more sophisticated access is needed. */ - public F getFileInfo(); + F getFileInfo(); } diff --git a/spring-integration-file/src/main/java/org/springframework/integration/file/remote/session/SharedSessionCapable.java b/spring-integration-file/src/main/java/org/springframework/integration/file/remote/session/SharedSessionCapable.java index 4ff792f611..502eeafde7 100644 --- a/spring-integration-file/src/main/java/org/springframework/integration/file/remote/session/SharedSessionCapable.java +++ b/spring-integration-file/src/main/java/org/springframework/integration/file/remote/session/SharedSessionCapable.java @@ -29,12 +29,12 @@ public interface SharedSessionCapable { /** * @return true if this factory uses a shared session. */ - public abstract boolean isSharedSession(); + boolean isSharedSession(); /** * Resets the shared session so the next {@code #getSession()} will return a session * using a new connection. */ - public abstract void resetSharedSession(); + void resetSharedSession(); } diff --git a/spring-integration-http/src/main/java/org/springframework/integration/http/inbound/IntegrationRequestMappingHandlerMapping.java b/spring-integration-http/src/main/java/org/springframework/integration/http/inbound/IntegrationRequestMappingHandlerMapping.java index 70c8d666f0..71f9c30da5 100644 --- a/spring-integration-http/src/main/java/org/springframework/integration/http/inbound/IntegrationRequestMappingHandlerMapping.java +++ b/spring-integration-http/src/main/java/org/springframework/integration/http/inbound/IntegrationRequestMappingHandlerMapping.java @@ -82,12 +82,12 @@ public final class IntegrationRequestMappingHandlerMapping extends RequestMappin private final AtomicBoolean initialized = new AtomicBoolean(); @Override - protected final boolean isHandler(Class beanType) { + protected boolean isHandler(Class beanType) { return HttpRequestHandlingEndpointSupport.class.isAssignableFrom(beanType); } @Override - protected final HandlerExecutionChain getHandlerExecutionChain(Object handler, HttpServletRequest request) { + protected HandlerExecutionChain getHandlerExecutionChain(Object handler, HttpServletRequest request) { if (handler instanceof HandlerMethod) { HandlerMethod handlerMethod = (HandlerMethod) handler; Object bean = handlerMethod.getBean(); @@ -109,7 +109,7 @@ public final class IntegrationRequestMappingHandlerMapping extends RequestMappin } @Override - protected final void detectHandlerMethods(Object handler) { + protected void detectHandlerMethods(Object handler) { if (handler instanceof String) { handler = this.getApplicationContext().getBean((String) handler); } diff --git a/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpConnectionInterceptorFactory.java b/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpConnectionInterceptorFactory.java index 8fc38c3a27..80b5a383bc 100644 --- a/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpConnectionInterceptorFactory.java +++ b/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpConnectionInterceptorFactory.java @@ -32,6 +32,6 @@ public interface TcpConnectionInterceptorFactory { * * @return the TcpInterceptor */ - abstract TcpConnectionInterceptorSupport getInterceptor(); + TcpConnectionInterceptorSupport getInterceptor(); } diff --git a/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpListener.java b/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpListener.java index a3e070b05f..e62b36b85c 100644 --- a/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpListener.java +++ b/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpListener.java @@ -1,5 +1,5 @@ /* - * Copyright 2001-2011 the original author or authors. + * Copyright 2001-2016 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -33,6 +33,6 @@ public interface TcpListener { * @param message The message. * @return true if the message was intercepted */ - abstract boolean onMessage(Message message); + boolean onMessage(Message message); } diff --git a/spring-integration-ip/src/test/java/org/springframework/integration/ip/tcp/ClientModeControlBusTests.java b/spring-integration-ip/src/test/java/org/springframework/integration/ip/tcp/ClientModeControlBusTests.java index c2e8c683c2..68255d19a5 100644 --- a/spring-integration-ip/src/test/java/org/springframework/integration/ip/tcp/ClientModeControlBusTests.java +++ b/spring-integration-ip/src/test/java/org/springframework/integration/ip/tcp/ClientModeControlBusTests.java @@ -62,7 +62,7 @@ public class ClientModeControlBusTests { controlBus.voidResult("@tcpIn.retryConnection()"); } - public static interface ControlBus { + public interface ControlBus { boolean boolResult(String command); diff --git a/spring-integration-jdbc/src/main/java/org/springframework/integration/jdbc/SqlParameterSourceFactory.java b/spring-integration-jdbc/src/main/java/org/springframework/integration/jdbc/SqlParameterSourceFactory.java index a21a97a862..e1e4049f0d 100644 --- a/spring-integration-jdbc/src/main/java/org/springframework/integration/jdbc/SqlParameterSourceFactory.java +++ b/spring-integration-jdbc/src/main/java/org/springframework/integration/jdbc/SqlParameterSourceFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2014 the original author or authors. + * Copyright 2002-2016 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -33,6 +33,6 @@ public interface SqlParameterSourceFactory { * @param input the raw message or query result to be transformed into a SqlParameterSource * @return The parameter source. */ - public SqlParameterSource createParameterSource(Object input); + SqlParameterSource createParameterSource(Object input); } diff --git a/spring-integration-jms/src/main/java/org/springframework/integration/jms/JmsHeaderMapper.java b/spring-integration-jms/src/main/java/org/springframework/integration/jms/JmsHeaderMapper.java index 70965b9d20..2c1024ec95 100644 --- a/spring-integration-jms/src/main/java/org/springframework/integration/jms/JmsHeaderMapper.java +++ b/spring-integration-jms/src/main/java/org/springframework/integration/jms/JmsHeaderMapper.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2013 the original author or authors. + * Copyright 2002-2016 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -31,7 +31,7 @@ import org.springframework.integration.mapping.HeaderMapper; */ public interface JmsHeaderMapper extends HeaderMapper { - static final String CONTENT_TYPE_PROPERTY = "content_type"; + String CONTENT_TYPE_PROPERTY = "content_type"; } diff --git a/spring-integration-jms/src/test/java/org/springframework/integration/jms/config/ExceptionHandlingSiConsumerTests.java b/spring-integration-jms/src/test/java/org/springframework/integration/jms/config/ExceptionHandlingSiConsumerTests.java index 3a5c7ba7c7..d83cedd665 100644 --- a/spring-integration-jms/src/test/java/org/springframework/integration/jms/config/ExceptionHandlingSiConsumerTests.java +++ b/spring-integration-jms/src/test/java/org/springframework/integration/jms/config/ExceptionHandlingSiConsumerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2016 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -113,8 +113,8 @@ public class ExceptionHandlingSiConsumerTests { } - public static interface SampleGateway { - public String echo(String value); + public interface SampleGateway { + String echo(String value); } diff --git a/spring-integration-jms/src/test/java/org/springframework/integration/jms/config/JmsMessageHistoryTests.java b/spring-integration-jms/src/test/java/org/springframework/integration/jms/config/JmsMessageHistoryTests.java index 26cdf50a47..aae1f6eeee 100644 --- a/spring-integration-jms/src/test/java/org/springframework/integration/jms/config/JmsMessageHistoryTests.java +++ b/spring-integration-jms/src/test/java/org/springframework/integration/jms/config/JmsMessageHistoryTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2013 the original author or authors. + * Copyright 2002-2016 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -64,11 +64,11 @@ public class JmsMessageHistoryTests { - public static interface SampleGateway { + public interface SampleGateway { - public void send(String value); + void send(String value); - public Message echo(String value); + Message echo(String value); } diff --git a/spring-integration-jms/src/test/java/org/springframework/integration/jms/config/JmsOutboundGatewayParserTests.java b/spring-integration-jms/src/test/java/org/springframework/integration/jms/config/JmsOutboundGatewayParserTests.java index bf36afd0f9..b411b29c23 100644 --- a/spring-integration-jms/src/test/java/org/springframework/integration/jms/config/JmsOutboundGatewayParserTests.java +++ b/spring-integration-jms/src/test/java/org/springframework/integration/jms/config/JmsOutboundGatewayParserTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2015 the original author or authors. + * Copyright 2002-2016 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -286,8 +286,8 @@ public class JmsOutboundGatewayParserTests { } - public static interface SampleGateway{ - public String echo(String value); + public interface SampleGateway{ + String echo(String value); } public static class SampleService{ diff --git a/spring-integration-jmx/src/test/java/org/springframework/integration/jmx/AttributePollingMessageSourceTests.java b/spring-integration-jmx/src/test/java/org/springframework/integration/jmx/AttributePollingMessageSourceTests.java index 0415483f2f..ef16955fc1 100644 --- a/spring-integration-jmx/src/test/java/org/springframework/integration/jmx/AttributePollingMessageSourceTests.java +++ b/spring-integration-jmx/src/test/java/org/springframework/integration/jmx/AttributePollingMessageSourceTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2016 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -67,7 +67,7 @@ public class AttributePollingMessageSourceTests { } - public static interface TestCounterMBean { + public interface TestCounterMBean { int getCount(); } diff --git a/spring-integration-jmx/src/test/java/org/springframework/integration/jmx/OperationInvokingMessageHandlerTests.java b/spring-integration-jmx/src/test/java/org/springframework/integration/jmx/OperationInvokingMessageHandlerTests.java index 638af8e95c..09f918b607 100644 --- a/spring-integration-jmx/src/test/java/org/springframework/integration/jmx/OperationInvokingMessageHandlerTests.java +++ b/spring-integration-jmx/src/test/java/org/springframework/integration/jmx/OperationInvokingMessageHandlerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2014 the original author or authors. + * Copyright 2002-2016 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -141,7 +141,7 @@ public class OperationInvokingMessageHandlerTests { assertEquals("foo123", reply.getPayload()); } - public static interface TestOpsMBean { + public interface TestOpsMBean { String x(String s1, String s2); diff --git a/spring-integration-jmx/src/test/java/org/springframework/integration/jmx/ServiceActivatorDefaultFrameworkMethodTests.java b/spring-integration-jmx/src/test/java/org/springframework/integration/jmx/ServiceActivatorDefaultFrameworkMethodTests.java index 636ac83e7c..ba8999f72a 100644 --- a/spring-integration-jmx/src/test/java/org/springframework/integration/jmx/ServiceActivatorDefaultFrameworkMethodTests.java +++ b/spring-integration-jmx/src/test/java/org/springframework/integration/jmx/ServiceActivatorDefaultFrameworkMethodTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2015 the original author or authors. + * Copyright 2002-2016 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -180,7 +180,7 @@ public class ServiceActivatorDefaultFrameworkMethodTests { private interface Foo { - public String foo(String in); + String foo(String in); } diff --git a/spring-integration-jmx/src/test/java/org/springframework/integration/jmx/config/RouterMBeanTests.java b/spring-integration-jmx/src/test/java/org/springframework/integration/jmx/config/RouterMBeanTests.java index 374e553748..5b443f9b9c 100644 --- a/spring-integration-jmx/src/test/java/org/springframework/integration/jmx/config/RouterMBeanTests.java +++ b/spring-integration-jmx/src/test/java/org/springframework/integration/jmx/config/RouterMBeanTests.java @@ -98,7 +98,7 @@ public class RouterMBeanTests { assertEquals(0, names.size()); } - public static interface Service { + public interface Service { void send(String input); } diff --git a/spring-integration-jmx/src/test/java/org/springframework/integration/monitor/HandlerMonitoringIntegrationTests.java b/spring-integration-jmx/src/test/java/org/springframework/integration/monitor/HandlerMonitoringIntegrationTests.java index 60fd4aed46..c23184bedf 100644 --- a/spring-integration-jmx/src/test/java/org/springframework/integration/monitor/HandlerMonitoringIntegrationTests.java +++ b/spring-integration-jmx/src/test/java/org/springframework/integration/monitor/HandlerMonitoringIntegrationTests.java @@ -104,7 +104,7 @@ public class HandlerMonitoringIntegrationTests { return context; } - public static interface Service { + public interface Service { void execute(String input) throws Exception; int getCounter(); } diff --git a/spring-integration-jmx/src/test/java/org/springframework/integration/monitor/MBeanExporterIntegrationTests.java b/spring-integration-jmx/src/test/java/org/springframework/integration/monitor/MBeanExporterIntegrationTests.java index 685acbc1f0..717fb3fd8f 100644 --- a/spring-integration-jmx/src/test/java/org/springframework/integration/monitor/MBeanExporterIntegrationTests.java +++ b/spring-integration-jmx/src/test/java/org/springframework/integration/monitor/MBeanExporterIntegrationTests.java @@ -366,7 +366,7 @@ public class MBeanExporterIntegrationTests { } - public static interface Service { + public interface Service { String execute() throws Exception; int getCounter(); } @@ -387,7 +387,7 @@ public class MBeanExporterIntegrationTests { } } - public static interface ActiveChannel { + public interface ActiveChannel { boolean isStopCalled(); } diff --git a/spring-integration-jmx/src/test/java/org/springframework/integration/monitor/MessageSourceMonitoringIntegrationTests.java b/spring-integration-jmx/src/test/java/org/springframework/integration/monitor/MessageSourceMonitoringIntegrationTests.java index 24c6f1485a..5c3df15bce 100644 --- a/spring-integration-jmx/src/test/java/org/springframework/integration/monitor/MessageSourceMonitoringIntegrationTests.java +++ b/spring-integration-jmx/src/test/java/org/springframework/integration/monitor/MessageSourceMonitoringIntegrationTests.java @@ -78,7 +78,7 @@ public class MessageSourceMonitoringIntegrationTests { return context; } - public static interface Service { + public interface Service { String execute() throws Exception; int getCounter(); } diff --git a/spring-integration-jmx/src/test/java/org/springframework/integration/monitor/RemoteMBeanServerTests.java b/spring-integration-jmx/src/test/java/org/springframework/integration/monitor/RemoteMBeanServerTests.java index ed3030f7a6..d4cf4a21cf 100644 --- a/spring-integration-jmx/src/test/java/org/springframework/integration/monitor/RemoteMBeanServerTests.java +++ b/spring-integration-jmx/src/test/java/org/springframework/integration/monitor/RemoteMBeanServerTests.java @@ -92,7 +92,7 @@ public class RemoteMBeanServerTests { assertEquals("bar", message.getPayload()); } - public static interface TesterMBean { + public interface TesterMBean { String getFoo(); diff --git a/spring-integration-mongodb/src/test/java/org/springframework/integration/mongodb/store/ConfigurableMongoDbMessageGroupStoreTests.java b/spring-integration-mongodb/src/test/java/org/springframework/integration/mongodb/store/ConfigurableMongoDbMessageGroupStoreTests.java index 9efcdf3de8..b53df566ca 100644 --- a/spring-integration-mongodb/src/test/java/org/springframework/integration/mongodb/store/ConfigurableMongoDbMessageGroupStoreTests.java +++ b/spring-integration-mongodb/src/test/java/org/springframework/integration/mongodb/store/ConfigurableMongoDbMessageGroupStoreTests.java @@ -147,7 +147,7 @@ public class ConfigurableMongoDbMessageGroupStoreTests extends AbstractMongoDbMe - public static interface TestGateway { + public interface TestGateway { String service(String payload); diff --git a/spring-integration-redis/src/main/java/org/springframework/integration/redis/outbound/RedisStoreWritingMessageHandler.java b/spring-integration-redis/src/main/java/org/springframework/integration/redis/outbound/RedisStoreWritingMessageHandler.java index 9dfcbfaa8a..1207d7d63f 100644 --- a/spring-integration-redis/src/main/java/org/springframework/integration/redis/outbound/RedisStoreWritingMessageHandler.java +++ b/spring-integration-redis/src/main/java/org/springframework/integration/redis/outbound/RedisStoreWritingMessageHandler.java @@ -480,6 +480,6 @@ public class RedisStoreWritingMessageHandler extends AbstractMessageHandler { } private interface PipelineCallback { - public void process(); + void process(); } } diff --git a/spring-integration-scripting/src/main/java/org/springframework/integration/scripting/ScriptExecutor.java b/spring-integration-scripting/src/main/java/org/springframework/integration/scripting/ScriptExecutor.java index 7f126a3fb5..43465eec47 100644 --- a/spring-integration-scripting/src/main/java/org/springframework/integration/scripting/ScriptExecutor.java +++ b/spring-integration-scripting/src/main/java/org/springframework/integration/scripting/ScriptExecutor.java @@ -30,13 +30,13 @@ public interface ScriptExecutor { * @param scriptSource The script source. * @return The result of the execution. */ - public abstract Object executeScript(ScriptSource scriptSource); + Object executeScript(ScriptSource scriptSource); /** * @param scriptSource The script source. * @param variables The variables. * @return The result of the execution. */ - public abstract Object executeScript(ScriptSource scriptSource, Map variables); + Object executeScript(ScriptSource scriptSource, Map variables); } diff --git a/spring-integration-security/src/main/java/org/springframework/integration/security/channel/ChannelAccessPolicy.java b/spring-integration-security/src/main/java/org/springframework/integration/security/channel/ChannelAccessPolicy.java index c7bf20f802..e8c9b092a4 100644 --- a/spring-integration-security/src/main/java/org/springframework/integration/security/channel/ChannelAccessPolicy.java +++ b/spring-integration-security/src/main/java/org/springframework/integration/security/channel/ChannelAccessPolicy.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2016 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -29,8 +29,8 @@ import org.springframework.security.access.ConfigAttribute; */ public interface ChannelAccessPolicy { - public Collection getConfigAttributesForSend(); + Collection getConfigAttributesForSend(); - public Collection getConfigAttributesForReceive(); + Collection getConfigAttributesForReceive(); } diff --git a/spring-integration-websocket/src/test/java/org/springframework/integration/websocket/client/StompIntegrationTests.java b/spring-integration-websocket/src/test/java/org/springframework/integration/websocket/client/StompIntegrationTests.java index 5417823541..f01b5d6a93 100644 --- a/spring-integration-websocket/src/test/java/org/springframework/integration/websocket/client/StompIntegrationTests.java +++ b/spring-integration-websocket/src/test/java/org/springframework/integration/websocket/client/StompIntegrationTests.java @@ -435,7 +435,7 @@ public class StompIntegrationTests { @MessagingGateway @Controller - static interface WebSocketGateway { + interface WebSocketGateway { @MessageMapping("/greeting") @SendToUser("/queue/answer") diff --git a/spring-integration-xml/src/main/java/org/springframework/integration/xml/XmlPayloadConverter.java b/spring-integration-xml/src/main/java/org/springframework/integration/xml/XmlPayloadConverter.java index aae58e2382..bda33ebeb7 100644 --- a/spring-integration-xml/src/main/java/org/springframework/integration/xml/XmlPayloadConverter.java +++ b/spring-integration-xml/src/main/java/org/springframework/integration/xml/XmlPayloadConverter.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2016 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -29,10 +29,10 @@ import org.w3c.dom.Node; */ public interface XmlPayloadConverter { - public Document convertToDocument(Object object); + Document convertToDocument(Object object); - public Node convertToNode(Object object); + Node convertToNode(Object object); - public Source convertToSource(Object object); + Source convertToSource(Object object); } diff --git a/spring-integration-xmpp/src/main/java/org/springframework/integration/xmpp/core/XmppContextUtils.java b/spring-integration-xmpp/src/main/java/org/springframework/integration/xmpp/core/XmppContextUtils.java index c1abb2ceef..e9019d1542 100644 --- a/spring-integration-xmpp/src/main/java/org/springframework/integration/xmpp/core/XmppContextUtils.java +++ b/spring-integration-xmpp/src/main/java/org/springframework/integration/xmpp/core/XmppContextUtils.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2016 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,6 +22,6 @@ package org.springframework.integration.xmpp.core; */ public interface XmppContextUtils { - final String XMPP_CONNECTION_BEAN_NAME = "xmppConnection"; + String XMPP_CONNECTION_BEAN_NAME = "xmppConnection"; } diff --git a/src/checkstyle/checkstyle-suppressions.xml b/src/checkstyle/checkstyle-suppressions.xml index 6d3dc8a2cd..4097d904b0 100644 --- a/src/checkstyle/checkstyle-suppressions.xml +++ b/src/checkstyle/checkstyle-suppressions.xml @@ -4,4 +4,6 @@ "http://www.puppycrawl.com/dtds/suppressions_1_1.dtd"> + + diff --git a/src/checkstyle/checkstyle.xml b/src/checkstyle/checkstyle.xml index 89651cbc7b..71fefe5ccd 100644 --- a/src/checkstyle/checkstyle.xml +++ b/src/checkstyle/checkstyle.xml @@ -125,7 +125,7 @@ - + diff --git a/src/checkstyle/fixModifiers.gradle b/src/checkstyle/fixModifiers.gradle new file mode 100644 index 0000000000..d9005d2404 --- /dev/null +++ b/src/checkstyle/fixModifiers.gradle @@ -0,0 +1,50 @@ +task fixModifiers << { + fileTree("${buildDir}/reports/checkstyle").include('*.xml').each { report -> + def xml = new XmlParser(false, false).parse(report) + xml.file.each { f -> + def errors = f.error + def modifierErrors = [] + errors.each { error -> + if (error.@source == 'com.puppycrawl.tools.checkstyle.checks.modifier.RedundantModifierCheck') { + modifierErrors.add(error) + } + } + if (modifierErrors) { + def errorInx = 0 + def error = modifierErrors[errorInx++] + def file = new File(f.@name) + println "Fixing file $file ..." + boolean headerFixed + def outSource = '' + file.eachLine { line, ln -> + if (!headerFixed) { + def matcher = line =~ /Copyright (20\d\d)(?:-20\d\d)?/ + if (matcher.count) { + def years = matcher[0][1] + if (years != now) { + years = years + "-$now" + line = line.replaceFirst(/(20\d\d)(?:-20\d\d)?/, years) + } + headerFixed = true + } + } + + while (error && ln == (error.@line as int)) { + def message = error.@message + def modifier = message.substring(message.indexOf('\'') + 1, message.lastIndexOf('\'')) + + line = line.replaceFirst(modifier + ' ', '') + + println "Fixed line $line" + + error = modifierErrors[errorInx++] + } + + outSource += line + System.lineSeparator() + } + file.write(outSource) + println() + } + } + } +} diff --git a/src/checkstyle/fixThis.gradle b/src/checkstyle/fixThis.gradle new file mode 100644 index 0000000000..9e61cbb18c --- /dev/null +++ b/src/checkstyle/fixThis.gradle @@ -0,0 +1,65 @@ +task fixThis << { + fileTree("${buildDir}/reports/checkstyle").include('*.xml').each { report -> + println "processing $report" + def xml = new XmlParser(false, false).parse(report) + xml.file.each { f -> + // println "processing $f" + def errors = f.error + def hasThisError = false + def thisErrors = [] + errors.each { error -> + if (error.@source == 'com.puppycrawl.tools.checkstyle.checks.coding.RequireThisCheck') { + thisErrors.add(error) + hasThisError = true + } + } + // println hasThisError + // println f.@name + if (hasThisError) { + def errorInx = 0 + def error = thisErrors[errorInx++] + def lx = Integer.valueOf(error.@line) + println error + def file = new File(f.@name) + def outSource = '' + def ln = 0 + file.eachLine { line -> + // println line + ln++ + def matcher = line =~ /Copyright (20\d\d)(?:-20\d\d)?/ + if (matcher.count) { + def years = matcher[0][1] + if (years != now) { + years = years + "-$now" + } + line.replaceFirst(/(20\d\d)(?:-20\d\d)?/, years) + } + if (error && ln == lx) { + // println line + def beforeIndex = Integer.valueOf(error.@column) - 1 + def chars = line.toCharArray() + for (int i = 0; i < beforeIndex; i++) { + if (chars[i] == '\t') { // tabs before code == 8 + beforeIndex -= 7; + } + else if (chars[i] != ' ') { // tabs after code start are only counted as 1 + break; + } + } + line = line.substring(0, beforeIndex) + "this." + line.substring(beforeIndex) + // println line + error = thisErrors[errorInx++] + while (error && lx == Integer.valueOf(error.@line)) { + error = thisErrors[errorInx++] + } + if (error) { + lx = Integer.valueOf(error.@line) + } + } + outSource += line + '\n' + } + file.write(outSource) + } + } + } +}