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.
This commit is contained in:
Artem Bilan
2016-03-17 13:10:05 -04:00
parent 714734115a
commit c2954881ad
62 changed files with 259 additions and 141 deletions

View File

@@ -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'

View File

@@ -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";
/**

View File

@@ -31,6 +31,6 @@ import org.springframework.messaging.MessageHandler;
*/
public interface LoadBalancingStrategy {
public Iterator<MessageHandler> getHandlerIterator(Message<?> message, Collection<MessageHandler> handlers);
Iterator<MessageHandler> getHandlerIterator(Message<?> message, Collection<MessageHandler> handlers);
}

View File

@@ -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
}

View File

@@ -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);
}

View File

@@ -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<J
return null;
}
public static interface JsonMessageParser<P> {
public interface JsonMessageParser<P> {
Message<?> doInParser(JsonInboundMessageMapper messageMapper, String jsonMessage) throws Exception;

View File

@@ -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<T> implements Pool<T> {
* various pool operations.
*
*/
public static interface PoolItemCallback<T> {
public interface PoolItemCallback<T> {
/**
* Called by the pool when a new instance is required to populate the pool. Only

View File

@@ -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();

View File

@@ -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);

View File

@@ -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);
}

View File

@@ -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();

View File

@@ -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);
}

View File

@@ -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();
}

View File

@@ -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();

View File

@@ -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 {

View File

@@ -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);
}

View File

@@ -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);

View File

@@ -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;
}

View File

@@ -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<String, Object> map);

View File

@@ -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 {

View File

@@ -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);
}

View File

@@ -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);

View File

@@ -74,7 +74,7 @@ public class GatewayXmlAndAnnotationTests {
assertEquals(4, assertions);
}
public static interface AGateway {
public interface AGateway {
@Gateway
String annotationShouldntOverrideDefault(String foo);

View File

@@ -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);
}

View File

@@ -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);
}
}

View File

@@ -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);
}
}

View File

@@ -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 {

View File

@@ -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);
}

View File

@@ -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);
}
}

View File

@@ -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);
}
}

View File

@@ -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 {
"</beans:beans>";
public static interface TestService{
public void foo(Message<?> message);
public interface TestService{
void foo(Message<?> message);
}
}

View File

@@ -91,7 +91,7 @@ public class MutableMessageBuilderFactoryTests {
}
@MessagingGateway
static interface TestGateway {
interface TestGateway {
@Gateway(requestChannel = "input")
void input(String payload);

View File

@@ -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<F> {
/**
* @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();
}

View File

@@ -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();
}

View File

@@ -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);
}

View File

@@ -32,6 +32,6 @@ public interface TcpConnectionInterceptorFactory {
*
* @return the TcpInterceptor
*/
abstract TcpConnectionInterceptorSupport getInterceptor();
TcpConnectionInterceptorSupport getInterceptor();
}

View File

@@ -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);
}

View File

@@ -62,7 +62,7 @@ public class ClientModeControlBusTests {
controlBus.voidResult("@tcpIn.retryConnection()");
}
public static interface ControlBus {
public interface ControlBus {
boolean boolResult(String command);

View File

@@ -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);
}

View File

@@ -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<Message> {
static final String CONTENT_TYPE_PROPERTY = "content_type";
String CONTENT_TYPE_PROPERTY = "content_type";
}

View File

@@ -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);
}

View File

@@ -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);
}

View File

@@ -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{

View File

@@ -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();
}

View File

@@ -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);

View File

@@ -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);
}

View File

@@ -98,7 +98,7 @@ public class RouterMBeanTests {
assertEquals(0, names.size());
}
public static interface Service {
public interface Service {
void send(String input);
}

View File

@@ -104,7 +104,7 @@ public class HandlerMonitoringIntegrationTests {
return context;
}
public static interface Service {
public interface Service {
void execute(String input) throws Exception;
int getCounter();
}

View File

@@ -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();
}

View File

@@ -78,7 +78,7 @@ public class MessageSourceMonitoringIntegrationTests {
return context;
}
public static interface Service {
public interface Service {
String execute() throws Exception;
int getCounter();
}

View File

@@ -92,7 +92,7 @@ public class RemoteMBeanServerTests {
assertEquals("bar", message.getPayload());
}
public static interface TesterMBean {
public interface TesterMBean {
String getFoo();

View File

@@ -147,7 +147,7 @@ public class ConfigurableMongoDbMessageGroupStoreTests extends AbstractMongoDbMe
public static interface TestGateway {
public interface TestGateway {
String service(String payload);

View File

@@ -480,6 +480,6 @@ public class RedisStoreWritingMessageHandler extends AbstractMessageHandler {
}
private interface PipelineCallback {
public void process();
void process();
}
}

View File

@@ -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<String,Object> variables);
Object executeScript(ScriptSource scriptSource, Map<String,Object> variables);
}

View File

@@ -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<ConfigAttribute> getConfigAttributesForSend();
Collection<ConfigAttribute> getConfigAttributesForSend();
public Collection<ConfigAttribute> getConfigAttributesForReceive();
Collection<ConfigAttribute> getConfigAttributesForReceive();
}

View File

@@ -435,7 +435,7 @@ public class StompIntegrationTests {
@MessagingGateway
@Controller
static interface WebSocketGateway {
interface WebSocketGateway {
@MessageMapping("/greeting")
@SendToUser("/queue/answer")

View File

@@ -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);
}

View File

@@ -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";
}

View File

@@ -4,4 +4,6 @@
"http://www.puppycrawl.com/dtds/suppressions_1_1.dtd">
<suppressions>
<suppress files="package-info\.java" checks=".*" />
<suppress files="[\\/]test[\\/]" checks="RequireThis" />
<suppress files="[\\/]test[\\/]" checks="Javadoc*" />
</suppressions>

View File

@@ -125,7 +125,7 @@
<!-- <module name="OuterTypeFilename" /> -->
<!-- Modifiers -->
<!-- <module name="RedundantModifier" /> -->
<module name="RedundantModifier" />
<!-- Regexp -->
<!-- <module name="RegexpSinglelineJava"> -->

View File

@@ -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()
}
}
}
}

View File

@@ -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)
}
}
}
}