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:
@@ -286,7 +286,7 @@ class MergeMetadataGenerationTests extends AbstractMetadataGenerationTests {
|
||||
}
|
||||
}
|
||||
|
||||
private static class AdditionalMetadata {
|
||||
static class AdditionalMetadata {
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -132,7 +132,7 @@ public abstract class AbstractFieldValuesProcessorTests {
|
||||
return false;
|
||||
}
|
||||
|
||||
public Map<String, Object> getValues() {
|
||||
Map<String, Object> getValues() {
|
||||
return this.values;
|
||||
}
|
||||
|
||||
|
||||
@@ -306,7 +306,7 @@ public final class Metadata {
|
||||
|
||||
}
|
||||
|
||||
private static class ItemHintValueCondition extends Condition<ItemHint> {
|
||||
static class ItemHintValueCondition extends Condition<ItemHint> {
|
||||
|
||||
private final int index;
|
||||
|
||||
@@ -350,7 +350,7 @@ public final class Metadata {
|
||||
|
||||
}
|
||||
|
||||
private static class ItemHintProviderCondition extends Condition<ItemHint> {
|
||||
static class ItemHintProviderCondition extends Condition<ItemHint> {
|
||||
|
||||
private final int index;
|
||||
|
||||
@@ -365,7 +365,7 @@ public final class Metadata {
|
||||
describedAs(createDescription());
|
||||
}
|
||||
|
||||
public String createDescription() {
|
||||
String createDescription() {
|
||||
StringBuilder description = new StringBuilder();
|
||||
description.append("value provider");
|
||||
if (this.name != null) {
|
||||
|
||||
@@ -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.
|
||||
@@ -16,6 +16,12 @@
|
||||
|
||||
package org.springframework.boot.configurationprocessor.metadata;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
import org.springframework.boot.configurationprocessor.json.JSONArray;
|
||||
import org.springframework.boot.configurationprocessor.json.JSONObject;
|
||||
import org.springframework.boot.configurationprocessor.metadata.ItemMetadata.ItemType;
|
||||
|
||||
/**
|
||||
* {@link JsonConverter} for use in tests.
|
||||
*
|
||||
@@ -23,4 +29,19 @@ package org.springframework.boot.configurationprocessor.metadata;
|
||||
*/
|
||||
public class TestJsonConverter extends JsonConverter {
|
||||
|
||||
@Override
|
||||
public JSONArray toJsonArray(ConfigurationMetadata metadata, ItemType itemType) throws Exception {
|
||||
return toJsonArray(metadata, itemType);
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONArray toJsonArray(Collection<ItemHint> hints) throws Exception {
|
||||
return super.toJsonArray(hints);
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONObject toJsonObject(ItemMetadata item) throws Exception {
|
||||
return super.toJsonObject(item);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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.
|
||||
@@ -41,7 +41,7 @@ public class EmptyTypeMethodConfig {
|
||||
return new Foo();
|
||||
}
|
||||
|
||||
public static class Foo {
|
||||
static class Foo {
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -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.
|
||||
@@ -68,7 +68,7 @@ public class SimpleArrayProperties {
|
||||
this.nameToInteger = nameToInteger;
|
||||
}
|
||||
|
||||
public static class Holder {
|
||||
static class Holder {
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -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.
|
||||
@@ -26,7 +26,7 @@ import org.springframework.boot.configurationsample.ConfigurationProperties;
|
||||
public class InnerClassRootConfig {
|
||||
|
||||
@ConfigurationProperties(prefix = "config")
|
||||
static class Config {
|
||||
public static class Config {
|
||||
|
||||
private String name;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user