Skip to content

Commit a66c4d3

Browse files
committed
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
1 parent 0a02a3a commit a66c4d3

File tree

910 files changed

+3753
-3944
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

910 files changed

+3753
-3944
lines changed

spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/reactive/ReactiveCloudFoundryActuatorAutoConfiguration.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ private CorsConfiguration getCorsConfiguration() {
155155
static class IgnoredPathsSecurityConfiguration {
156156

157157
@Bean
158-
public WebFilterChainPostProcessor webFilterChainPostProcessor() {
158+
WebFilterChainPostProcessor webFilterChainPostProcessor() {
159159
return new WebFilterChainPostProcessor();
160160
}
161161

spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/reactive/ReactiveCloudFoundrySecurityService.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,7 @@ private SslContextBuilder createSslContext() {
8383
* @return a Mono of the access level that should be granted
8484
* @throws CloudFoundryAuthorizationException if the token is not authorized
8585
*/
86-
public Mono<AccessLevel> getAccessLevel(String token, String applicationId)
87-
throws CloudFoundryAuthorizationException {
86+
Mono<AccessLevel> getAccessLevel(String token, String applicationId) throws CloudFoundryAuthorizationException {
8887
String uri = getPermissionsUri(applicationId);
8988
return this.webClient.get().uri(uri).header("Authorization", "bearer " + token).retrieve().bodyToMono(Map.class)
9089
.map(this::getAccessLevel).onErrorMap(this::mapError);
@@ -118,7 +117,7 @@ private String getPermissionsUri(String applicationId) {
118117
* Return a Mono of all token keys known by the UAA.
119118
* @return a Mono of token keys
120119
*/
121-
public Mono<Map<String, String>> fetchTokenKeys() {
120+
Mono<Map<String, String>> fetchTokenKeys() {
122121
return getUaaUrl().flatMap(this::fetchTokenKeys);
123122
}
124123

@@ -141,7 +140,7 @@ private Map<String, String> extractTokenKeys(Map<String, Object> response) {
141140
* Return a Mono of URL of the UAA.
142141
* @return the UAA url Mono
143142
*/
144-
public Mono<String> getUaaUrl() {
143+
Mono<String> getUaaUrl() {
145144
this.uaaUrl = this.webClient.get().uri(this.cloudControllerUrl + "/info").retrieve().bodyToMono(Map.class)
146145
.map((response) -> (String) response.get("token_endpoint")).cache()
147146
.onErrorMap((ex) -> new CloudFoundryAuthorizationException(Reason.SERVICE_UNAVAILABLE,

spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/reactive/ReactiveTokenValidator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ class ReactiveTokenValidator {
5050
this.securityService = securityService;
5151
}
5252

53-
public Mono<Void> validate(Token token) {
53+
Mono<Void> validate(Token token) {
5454
return validateAlgorithm(token).then(validateKeyIdAndSignature(token)).then(validateExpiry(token))
5555
.then(validateIssuer(token)).then(validateAudience(token));
5656
}

spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/servlet/CloudFoundrySecurityService.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ class CloudFoundrySecurityService {
6565
* @return the access level that should be granted
6666
* @throws CloudFoundryAuthorizationException if the token is not authorized
6767
*/
68-
public AccessLevel getAccessLevel(String token, String applicationId) throws CloudFoundryAuthorizationException {
68+
AccessLevel getAccessLevel(String token, String applicationId) throws CloudFoundryAuthorizationException {
6969
try {
7070
URI uri = getPermissionsUri(applicationId);
7171
RequestEntity<?> request = RequestEntity.get(uri).header("Authorization", "bearer " + token).build();
@@ -99,7 +99,7 @@ private URI getPermissionsUri(String applicationId) {
9999
* Return all token keys known by the UAA.
100100
* @return a list of token keys
101101
*/
102-
public Map<String, String> fetchTokenKeys() {
102+
Map<String, String> fetchTokenKeys() {
103103
try {
104104
return extractTokenKeys(this.restTemplate.getForObject(getUaaUrl() + "/token_keys", Map.class));
105105
}
@@ -121,7 +121,7 @@ private Map<String, String> extractTokenKeys(Map<?, ?> response) {
121121
* Return the URL of the UAA.
122122
* @return the UAA url
123123
*/
124-
public String getUaaUrl() {
124+
String getUaaUrl() {
125125
if (this.uaaUrl == null) {
126126
try {
127127
Map<?, ?> response = this.restTemplate.getForObject(this.cloudControllerUrl + "/info", Map.class);

spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/servlet/TokenValidator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ class TokenValidator {
4646
this.securityService = cloudFoundrySecurityService;
4747
}
4848

49-
public void validate(Token token) {
49+
void validate(Token token) {
5050
validateAlgorithm(token);
5151
validateKeyIdAndSignature(token);
5252
validateExpiry(token);

spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/WebEndpointAutoConfiguration.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ static class WebEndpointServletConfiguration {
136136

137137
@Bean
138138
@ConditionalOnMissingBean(ServletEndpointsSupplier.class)
139-
public ServletEndpointDiscoverer servletEndpointDiscoverer(ApplicationContext applicationContext,
139+
ServletEndpointDiscoverer servletEndpointDiscoverer(ApplicationContext applicationContext,
140140
ObjectProvider<PathMapper> endpointPathMappers,
141141
ObjectProvider<EndpointFilter<ExposableServletEndpoint>> filters) {
142142
return new ServletEndpointDiscoverer(applicationContext,

spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/jersey/JerseyWebEndpointManagementContextConfiguration.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
class JerseyWebEndpointManagementContextConfiguration {
6161

6262
@Bean
63-
public ResourceConfigCustomizer webEndpointRegistrar(WebEndpointsSupplier webEndpointsSupplier,
63+
ResourceConfigCustomizer webEndpointRegistrar(WebEndpointsSupplier webEndpointsSupplier,
6464
ServletEndpointsSupplier servletEndpointsSupplier, EndpointMediaTypes endpointMediaTypes,
6565
WebEndpointProperties webEndpointProperties) {
6666
List<ExposableEndpoint<?>> allEndpoints = new ArrayList<>();

spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/health/HealthEndpointConfiguration.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class HealthEndpointConfiguration {
3838

3939
@Bean
4040
@ConditionalOnMissingBean
41-
public HealthEndpoint healthEndpoint(HealthAggregator healthAggregator, HealthIndicatorRegistry registry) {
41+
HealthEndpoint healthEndpoint(HealthAggregator healthAggregator, HealthIndicatorRegistry registry) {
4242
return new HealthEndpoint(new CompositeHealthIndicator(healthAggregator, registry));
4343
}
4444

spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/health/HealthEndpointWebExtensionConfiguration.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ class HealthEndpointWebExtensionConfiguration {
4848

4949
@Bean
5050
@ConditionalOnMissingBean
51-
public HealthStatusHttpMapper createHealthStatusHttpMapper(HealthIndicatorProperties healthIndicatorProperties) {
51+
HealthStatusHttpMapper createHealthStatusHttpMapper(HealthIndicatorProperties healthIndicatorProperties) {
5252
HealthStatusHttpMapper statusHttpMapper = new HealthStatusHttpMapper();
5353
if (healthIndicatorProperties.getHttpMapping() != null) {
5454
statusHttpMapper.addStatusMapping(healthIndicatorProperties.getHttpMapping());
@@ -58,7 +58,7 @@ public HealthStatusHttpMapper createHealthStatusHttpMapper(HealthIndicatorProper
5858

5959
@Bean
6060
@ConditionalOnMissingBean
61-
public HealthWebEndpointResponseMapper healthWebEndpointResponseMapper(HealthStatusHttpMapper statusHttpMapper,
61+
HealthWebEndpointResponseMapper healthWebEndpointResponseMapper(HealthStatusHttpMapper statusHttpMapper,
6262
HealthEndpointProperties properties) {
6363
return new HealthWebEndpointResponseMapper(statusHttpMapper, properties.getShowDetails(),
6464
properties.getRoles());
@@ -72,7 +72,7 @@ static class ReactiveWebHealthConfiguration {
7272
@Bean
7373
@ConditionalOnMissingBean
7474
@ConditionalOnBean(HealthEndpoint.class)
75-
public ReactiveHealthEndpointWebExtension reactiveHealthEndpointWebExtension(
75+
ReactiveHealthEndpointWebExtension reactiveHealthEndpointWebExtension(
7676
ObjectProvider<HealthAggregator> healthAggregator, ReactiveHealthIndicatorRegistry registry,
7777
HealthWebEndpointResponseMapper responseMapper) {
7878
return new ReactiveHealthEndpointWebExtension(new CompositeReactiveHealthIndicator(
@@ -88,7 +88,7 @@ static class ServletWebHealthConfiguration {
8888
@Bean
8989
@ConditionalOnMissingBean
9090
@ConditionalOnBean(HealthEndpoint.class)
91-
public HealthEndpointWebExtension healthEndpointWebExtension(HealthEndpoint healthEndpoint,
91+
HealthEndpointWebExtension healthEndpointWebExtension(HealthEndpoint healthEndpoint,
9292
HealthWebEndpointResponseMapper responseMapper) {
9393
return new HealthEndpointWebExtension(healthEndpoint, responseMapper);
9494
}

spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/health/HealthIndicatorAutoConfiguration.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ static class ReactiveHealthIndicatorConfiguration {
7777

7878
@Bean
7979
@ConditionalOnMissingBean
80-
public ReactiveHealthIndicatorRegistry reactiveHealthIndicatorRegistry(
80+
ReactiveHealthIndicatorRegistry reactiveHealthIndicatorRegistry(
8181
Map<String, ReactiveHealthIndicator> reactiveHealthIndicators,
8282
Map<String, HealthIndicator> healthIndicators) {
8383
return new ReactiveHealthIndicatorRegistryFactory()

0 commit comments

Comments
 (0)