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:
@@ -518,7 +518,7 @@ public abstract class AbstractRunMojo extends AbstractDependencyFilterMojo {
|
||||
}
|
||||
}
|
||||
|
||||
public void rethrowUncaughtException() throws MojoExecutionException {
|
||||
void rethrowUncaughtException() throws MojoExecutionException {
|
||||
synchronized (this.monitor) {
|
||||
if (this.exception != null) {
|
||||
throw new MojoExecutionException(
|
||||
@@ -572,7 +572,7 @@ public abstract class AbstractRunMojo extends AbstractDependencyFilterMojo {
|
||||
*/
|
||||
static class SystemPropertyFormatter {
|
||||
|
||||
public static String format(String key, String value) {
|
||||
static String format(String key, String value) {
|
||||
if (key == null) {
|
||||
return "";
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2018 the original author or authors.
|
||||
* Copyright 2012-2019 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,11 +52,11 @@ class EnvVariables {
|
||||
return (value != null) ? value : "";
|
||||
}
|
||||
|
||||
public Map<String, String> asMap() {
|
||||
Map<String, String> asMap() {
|
||||
return Collections.unmodifiableMap(this.variables);
|
||||
}
|
||||
|
||||
public String[] asArray() {
|
||||
String[] asArray() {
|
||||
List<String> args = new ArrayList<>(this.variables.size());
|
||||
for (Map.Entry<String, String> arg : this.variables.entrySet()) {
|
||||
args.add(arg.getKey() + "=" + arg.getValue());
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2017 the original author or authors.
|
||||
* Copyright 2012-2019 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.
|
||||
@@ -44,27 +44,27 @@ abstract class FilterableDependency {
|
||||
@Parameter
|
||||
private String classifier;
|
||||
|
||||
public String getGroupId() {
|
||||
String getGroupId() {
|
||||
return this.groupId;
|
||||
}
|
||||
|
||||
public void setGroupId(String groupId) {
|
||||
void setGroupId(String groupId) {
|
||||
this.groupId = groupId;
|
||||
}
|
||||
|
||||
public String getArtifactId() {
|
||||
String getArtifactId() {
|
||||
return this.artifactId;
|
||||
}
|
||||
|
||||
public void setArtifactId(String artifactId) {
|
||||
void setArtifactId(String artifactId) {
|
||||
this.artifactId = artifactId;
|
||||
}
|
||||
|
||||
public String getClassifier() {
|
||||
String getClassifier() {
|
||||
return this.classifier;
|
||||
}
|
||||
|
||||
public void setClassifier(String classifier) {
|
||||
void setClassifier(String classifier) {
|
||||
this.classifier = classifier;
|
||||
}
|
||||
|
||||
|
||||
@@ -44,11 +44,11 @@ class RunArguments {
|
||||
}
|
||||
}
|
||||
|
||||
public Deque<String> getArgs() {
|
||||
Deque<String> getArgs() {
|
||||
return this.args;
|
||||
}
|
||||
|
||||
public String[] asArray() {
|
||||
String[] asArray() {
|
||||
return this.args.toArray(new String[0]);
|
||||
}
|
||||
|
||||
|
||||
@@ -58,7 +58,7 @@ class SpringApplicationAdminClient {
|
||||
* @return {@code true} if the application is ready to service requests
|
||||
* @throws MojoExecutionException if the JMX service could not be contacted
|
||||
*/
|
||||
public boolean isReady() throws MojoExecutionException {
|
||||
boolean isReady() throws MojoExecutionException {
|
||||
try {
|
||||
return (Boolean) this.connection.getAttribute(this.objectName, "Ready");
|
||||
}
|
||||
@@ -82,7 +82,7 @@ class SpringApplicationAdminClient {
|
||||
* @throws IOException if an I/O error occurs
|
||||
* @throws InstanceNotFoundException if the lifecycle mbean cannot be found
|
||||
*/
|
||||
public void stop() throws MojoExecutionException, IOException, InstanceNotFoundException {
|
||||
void stop() throws MojoExecutionException, IOException, InstanceNotFoundException {
|
||||
try {
|
||||
this.connection.invoke(this.objectName, "shutdown", null, null);
|
||||
}
|
||||
@@ -110,7 +110,7 @@ class SpringApplicationAdminClient {
|
||||
* @return a connection
|
||||
* @throws IOException if the connection to that server failed
|
||||
*/
|
||||
public static JMXConnector connect(int port) throws IOException {
|
||||
static JMXConnector connect(int port) throws IOException {
|
||||
String url = "service:jmx:rmi:///jndi/rmi://127.0.0.1:" + port + "/jmxrmi";
|
||||
JMXServiceURL serviceUrl = new JMXServiceURL(url);
|
||||
return JMXConnectorFactory.connect(serviceUrl, null);
|
||||
|
||||
@@ -122,7 +122,7 @@ class DependencyFilterMojoTests {
|
||||
this.additionalFilters = additionalFilters;
|
||||
}
|
||||
|
||||
public Set<Artifact> filterDependencies(Artifact... artifacts) throws MojoExecutionException {
|
||||
Set<Artifact> filterDependencies(Artifact... artifacts) throws MojoExecutionException {
|
||||
Set<Artifact> input = new LinkedHashSet<>(Arrays.asList(artifacts));
|
||||
return filterDependencies(input, getFilters(this.additionalFilters));
|
||||
}
|
||||
|
||||
@@ -159,7 +159,7 @@ public final class Verify {
|
||||
|
||||
}
|
||||
|
||||
private abstract static class AbstractArchiveVerification {
|
||||
public abstract static class AbstractArchiveVerification {
|
||||
|
||||
private final File file;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user