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:
@@ -29,7 +29,7 @@ import org.springframework.context.annotation.Configuration;
|
||||
public class MetricsFilterBeanExample {
|
||||
|
||||
@Configuration(proxyBeanMethods = false)
|
||||
static class MetricsFilterExampleConfiguration {
|
||||
public static class MetricsFilterExampleConfiguration {
|
||||
|
||||
// tag::configuration[]
|
||||
@Bean
|
||||
|
||||
@@ -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.
|
||||
@@ -21,11 +21,11 @@ package org.springframework.boot.docs.autoconfigure;
|
||||
*
|
||||
* @author Stephane Nicoll
|
||||
*/
|
||||
class UserService {
|
||||
public class UserService {
|
||||
|
||||
private final String name;
|
||||
|
||||
UserService(String name) {
|
||||
public UserService(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ public class UserServiceAutoConfiguration {
|
||||
}
|
||||
|
||||
@ConfigurationProperties("user")
|
||||
static class UserProperties {
|
||||
public static class UserProperties {
|
||||
|
||||
private String name = "test";
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ public class TomcatLegacyCookieProcessorExample {
|
||||
* Configuration class that declares the required {@link WebServerFactoryCustomizer}.
|
||||
*/
|
||||
@Configuration(proxyBeanMethods = false)
|
||||
static class LegacyCookieProcessorConfiguration {
|
||||
public static class LegacyCookieProcessorConfiguration {
|
||||
|
||||
// tag::customizer[]
|
||||
@Bean
|
||||
|
||||
@@ -34,7 +34,7 @@ public class BasicDataSourceExample {
|
||||
* A configuration that exposes an empty {@link DataSource}.
|
||||
*/
|
||||
@Configuration(proxyBeanMethods = false)
|
||||
static class BasicDataSourceConfiguration {
|
||||
public static class BasicDataSourceConfiguration {
|
||||
|
||||
// tag::configuration[]
|
||||
@Bean
|
||||
|
||||
@@ -37,7 +37,7 @@ public class CompleteTwoDataSourcesExample {
|
||||
* A complete configuration that exposes two data sources.
|
||||
*/
|
||||
@Configuration
|
||||
static class CompleteDataSourcesConfiguration {
|
||||
public static class CompleteDataSourcesConfiguration {
|
||||
|
||||
// tag::configuration[]
|
||||
@Bean
|
||||
|
||||
@@ -38,7 +38,7 @@ public class ConfigurableDataSourceExample {
|
||||
* {@link DataSourceProperties}.
|
||||
*/
|
||||
@Configuration(proxyBeanMethods = false)
|
||||
static class ConfigurableDataSourceConfiguration {
|
||||
public static class ConfigurableDataSourceConfiguration {
|
||||
|
||||
// tag::configuration[]
|
||||
@Bean
|
||||
|
||||
@@ -36,7 +36,7 @@ public class SimpleDataSourceExample {
|
||||
* A simple configuration that exposes dedicated settings.
|
||||
*/
|
||||
@Configuration(proxyBeanMethods = false)
|
||||
static class SimpleDataSourceConfiguration {
|
||||
public static class SimpleDataSourceConfiguration {
|
||||
|
||||
// tag::configuration[]
|
||||
@Bean
|
||||
|
||||
@@ -40,7 +40,7 @@ public class SimpleTwoDataSourcesExample {
|
||||
* A simple configuration that exposes two data sources.
|
||||
*/
|
||||
@Configuration
|
||||
static class SimpleDataSourcesConfiguration {
|
||||
public static class SimpleDataSourcesConfiguration {
|
||||
|
||||
// tag::configuration[]
|
||||
@Bean
|
||||
|
||||
@@ -37,7 +37,7 @@ public class KafkaStreamsBeanExample {
|
||||
// tag::configuration[]
|
||||
@Configuration(proxyBeanMethods = false)
|
||||
@EnableKafkaStreams
|
||||
static class KafkaStreamsExampleConfiguration {
|
||||
public static class KafkaStreamsExampleConfiguration {
|
||||
|
||||
@Bean
|
||||
public KStream<Integer, String> kStream(StreamsBuilder streamsBuilder) {
|
||||
|
||||
@@ -70,7 +70,7 @@ class UserServiceAutoConfigurationTests {
|
||||
static class UserConfiguration {
|
||||
|
||||
@Bean
|
||||
public UserService myUserService() {
|
||||
UserService myUserService() {
|
||||
return new UserService("mine");
|
||||
}
|
||||
|
||||
|
||||
@@ -51,12 +51,12 @@ class TomcatLegacyCookieProcessorExampleTests {
|
||||
static class TestConfiguration {
|
||||
|
||||
@Bean
|
||||
public TomcatServletWebServerFactory tomcatFactory() {
|
||||
TomcatServletWebServerFactory tomcatFactory() {
|
||||
return new TomcatServletWebServerFactory(0);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public WebServerFactoryCustomizerBeanPostProcessor postProcessor() {
|
||||
WebServerFactoryCustomizerBeanPostProcessor postProcessor() {
|
||||
return new WebServerFactoryCustomizerBeanPostProcessor();
|
||||
}
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ class SampleWebClientConfiguration {
|
||||
private static class ExampleController {
|
||||
|
||||
@RequestMapping("/example")
|
||||
public ResponseEntity<String> example() {
|
||||
ResponseEntity<String> example() {
|
||||
return ResponseEntity.ok().location(URI.create("https://other.example.com/example")).body("test");
|
||||
}
|
||||
|
||||
|
||||
@@ -56,7 +56,7 @@ class SampleWebClientTests {
|
||||
static class Config {
|
||||
|
||||
@Bean
|
||||
public RestTemplateBuilder restTemplateBuilder() {
|
||||
RestTemplateBuilder restTemplateBuilder() {
|
||||
return new RestTemplateBuilder().setConnectTimeout(Duration.ofSeconds(1))
|
||||
.setReadTimeout(Duration.ofSeconds(1));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user