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

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