Unify method visibility of private classes

Apply checkstyle rule to ensure that private and package private
classes do not have unnecessary public methods. Test classes have
also been unified as much as possible to use default scoped
inner-classes.

Closes gh-7316
This commit is contained in:
Phillip Webb
2019-07-01 12:29:51 -07:00
parent 0a02a3a19c
commit a66c4d3096
910 changed files with 3754 additions and 3945 deletions

View File

@@ -92,7 +92,7 @@ class SpringApplicationLauncherTests {
return classLoader.classes;
}
private static class TestClassLoader extends ClassLoader {
static class TestClassLoader extends ClassLoader {
private Set<String> classes = new HashSet<>();

View File

@@ -37,7 +37,7 @@ class OptionParsingCommandTests {
assertThat(command.getHelp()).contains("--bar");
}
private static class TestOptionParsingCommand extends OptionParsingCommand {
static class TestOptionParsingCommand extends OptionParsingCommand {
TestOptionParsingCommand(String name, String description, OptionHandler handler) {
super(name, description, handler);

View File

@@ -153,7 +153,7 @@ public abstract class AbstractHttpClientMockTests {
return json.toString();
}
protected static class MockHttpProjectGenerationRequest {
static class MockHttpProjectGenerationRequest {
String contentType;
@@ -161,11 +161,11 @@ public abstract class AbstractHttpClientMockTests {
byte[] content = new byte[] { 0, 0, 0, 0 };
public MockHttpProjectGenerationRequest(String contentType, String fileName) {
MockHttpProjectGenerationRequest(String contentType, String fileName) {
this(contentType, fileName, new byte[] { 0, 0, 0, 0 });
}
public MockHttpProjectGenerationRequest(String contentType, String fileName, byte[] content) {
MockHttpProjectGenerationRequest(String contentType, String fileName, byte[] content) {
this.contentType = contentType;
this.fileName = fileName;
this.content = content;
@@ -173,7 +173,7 @@ public abstract class AbstractHttpClientMockTests {
}
private static class HasAcceptHeader implements ArgumentMatcher<HttpGet> {
static class HasAcceptHeader implements ArgumentMatcher<HttpGet> {
private final String value;

View File

@@ -361,7 +361,7 @@ class InitCommandTests extends AbstractHttpClientMockTests {
}
}
private static class TestableInitCommandOptionHandler extends InitCommand.InitOptionHandler {
static class TestableInitCommandOptionHandler extends InitCommand.InitOptionHandler {
private boolean disableProjectGeneration;

View File

@@ -218,7 +218,7 @@ class ProjectGenerationRequestTests {
return createUrl("/starter.zip" + param);
}
public void setBuildAndFormat(String build, String format) {
void setBuildAndFormat(String build, String format) {
this.request.setBuild((build != null) ? build : "maven");
this.request.setFormat((format != null) ? format : "project");
this.request.setDetectType(true);

View File

@@ -121,7 +121,7 @@ class GroovyGrabDependencyResolverTests {
"hamcrest-core-2.1.jar", "hamcrest-2.1.jar");
}
public Set<String> getNames(Collection<File> files) {
Set<String> getNames(Collection<File> files) {
Set<String> names = new HashSet<>(files.size());
for (File file : files) {
names.add(file.getName());