Skip to content

Commit c90a5a9

Browse files
committed
Polish
1 parent 5632d04 commit c90a5a9

File tree

18 files changed

+33
-48
lines changed

18 files changed

+33
-48
lines changed

spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/simple/SimpleProperties.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2017 the original author or authors.
2+
* Copyright 2012-2018 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.

spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/info/Info.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2017 the original author or authors.
2+
* Copyright 2012-2018 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.

spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/cache/CacheManagerCustomizers.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2017 the original author or authors.
2+
* Copyright 2012-2018 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.

spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/reactive/PathRequest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@
2020
import org.springframework.security.web.server.util.matcher.ServerWebExchangeMatcher;
2121

2222
/**
23-
* Factory that can be used to create a {@link ServerWebExchangeMatcher} for commonly used paths.
23+
* Factory that can be used to create a {@link ServerWebExchangeMatcher} for commonly used
24+
* paths.
2425
*
2526
* @author Madhura Bhave
2627
* @since 2.0.0
@@ -36,8 +37,7 @@ private PathRequest() {
3637
* @return a {@link StaticResourceRequest}
3738
*/
3839
public static StaticResourceRequest toStaticResources() {
39-
return StaticResourceRequest.get();
40+
return StaticResourceRequest.INSTANCE;
4041
}
4142

4243
}
43-

spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/reactive/StaticResourceRequest.java

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -33,16 +33,16 @@
3333
import org.springframework.web.server.ServerWebExchange;
3434

3535
/**
36-
* Used to create a {@link ServerWebExchangeMatcher} for static resources in
37-
* commonly used locations. Returned by {@link PathRequest#toStaticResources()}.
36+
* Used to create a {@link ServerWebExchangeMatcher} for static resources in commonly used
37+
* locations. Returned by {@link PathRequest#toStaticResources()}.
3838
*
3939
* @author Madhura Bhave
4040
* @since 2.0.0
4141
* @see PathRequest
4242
*/
4343
public final class StaticResourceRequest {
4444

45-
private static final StaticResourceRequest INSTANCE = new StaticResourceRequest();
45+
static final StaticResourceRequest INSTANCE = new StaticResourceRequest();
4646

4747
private StaticResourceRequest() {
4848
}
@@ -83,20 +83,11 @@ public StaticResourceServerWebExchange at(StaticResourceLocation first,
8383
* @param locations the locations to include
8484
* @return the configured {@link ServerWebExchangeMatcher}
8585
*/
86-
public StaticResourceServerWebExchange at(
87-
Set<StaticResourceLocation> locations) {
86+
public StaticResourceServerWebExchange at(Set<StaticResourceLocation> locations) {
8887
Assert.notNull(locations, "Locations must not be null");
8988
return new StaticResourceServerWebExchange(new LinkedHashSet<>(locations));
9089
}
9190

92-
/**
93-
* Return the static resource request.
94-
* @return the static resource request
95-
*/
96-
static StaticResourceRequest get() {
97-
return INSTANCE;
98-
}
99-
10091
/**
10192
* The server web exchange matcher used to match against resource
10293
* {@link StaticResourceLocation Locations}.

spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/servlet/PathRequest.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,12 @@ private PathRequest() {
4242
* @return a {@link StaticResourceRequest}
4343
*/
4444
public static StaticResourceRequest toStaticResources() {
45-
return StaticResourceRequest.get();
45+
return StaticResourceRequest.INSTANCE;
4646
}
4747

4848
/**
49-
* Returns a matcher that includes the H2 console location. For example: <pre class="code">
49+
* Returns a matcher that includes the H2 console location. For example:
50+
* <pre class="code">
5051
* PathRequest.toH2Console()
5152
* </pre>
5253
* @return the configured {@link RequestMatcher}
@@ -73,7 +74,8 @@ protected void initialized(H2ConsoleProperties h2ConsoleProperties) {
7374
}
7475

7576
@Override
76-
protected boolean matches(HttpServletRequest request, H2ConsoleProperties context) {
77+
protected boolean matches(HttpServletRequest request,
78+
H2ConsoleProperties context) {
7779
return this.delegate.matches(request);
7880
}
7981

spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/servlet/StaticResourceRequest.java

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@
3434
import org.springframework.util.Assert;
3535

3636
/**
37-
* Used to create a {@link RequestMatcher} for static resources in
38-
* commonly used locations. Returned by {@link PathRequest#toStaticResources()}.
37+
* Used to create a {@link RequestMatcher} for static resources in commonly used
38+
* locations. Returned by {@link PathRequest#toStaticResources()}.
3939
*
4040
* @author Madhura Bhave
4141
* @author Phillip Webb
@@ -44,7 +44,7 @@
4444
*/
4545
public final class StaticResourceRequest {
4646

47-
private static final StaticResourceRequest INSTANCE = new StaticResourceRequest();
47+
static final StaticResourceRequest INSTANCE = new StaticResourceRequest();
4848

4949
private StaticResourceRequest() {
5050
}
@@ -90,14 +90,6 @@ public StaticResourceRequestMatcher at(Set<StaticResourceLocation> locations) {
9090
return new StaticResourceRequestMatcher(new LinkedHashSet<>(locations));
9191
}
9292

93-
/**
94-
* Return the static resource request.
95-
* @return the static resource request
96-
*/
97-
static StaticResourceRequest get() {
98-
return INSTANCE;
99-
}
100-
10193
/**
10294
* The request matcher used to match against resource {@link StaticResourceLocation
10395
* Locations}.

spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/transaction/TransactionManagerCustomizers.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2017 the original author or authors.
2+
* Copyright 2012-2018 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.

spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/reactive/PathRequestTests.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ public class PathRequestTests {
2929

3030
@Test
3131
public void toStaticResourcesShouldReturnStaticResourceRequest() {
32-
assertThat(PathRequest.toStaticResources()).isInstanceOf(StaticResourceRequest.class);
32+
assertThat(PathRequest.toStaticResources())
33+
.isInstanceOf(StaticResourceRequest.class);
3334
}
3435

3536
}

spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/reactive/StaticResourceRequestTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
*/
4545
public class StaticResourceRequestTests {
4646

47-
private StaticResourceRequest resourceRequest = StaticResourceRequest.get();
47+
private StaticResourceRequest resourceRequest = StaticResourceRequest.INSTANCE;
4848

4949
@Rule
5050
public ExpectedException thrown = ExpectedException.none();

spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/servlet/PathRequestTests.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ public class PathRequestTests {
4444

4545
@Test
4646
public void toStaticResourcesShouldReturnStaticResourceRequest() {
47-
assertThat(PathRequest.toStaticResources()).isInstanceOf(StaticResourceRequest.class);
47+
assertThat(PathRequest.toStaticResources())
48+
.isInstanceOf(StaticResourceRequest.class);
4849
}
4950

5051
@Test

spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/servlet/StaticResourceRequestTests.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
*/
4242
public class StaticResourceRequestTests {
4343

44-
private StaticResourceRequest resourceRequest = StaticResourceRequest.get();
44+
private StaticResourceRequest resourceRequest = StaticResourceRequest.INSTANCE;
4545

4646
@Rule
4747
public ExpectedException thrown = ExpectedException.none();
@@ -92,8 +92,7 @@ public void atLocationsFromSetWhenSetIsNullShouldThrowException() {
9292
public void excludeFromSetWhenSetIsNullShouldThrowException() {
9393
this.thrown.expect(IllegalArgumentException.class);
9494
this.thrown.expectMessage("Locations must not be null");
95-
this.resourceRequest.atCommonLocations()
96-
.excluding(null);
95+
this.resourceRequest.atCommonLocations().excluding(null);
9796
}
9897

9998
private RequestMatcherAssert assertMatcher(RequestMatcher matcher) {

spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli/DefaultCommandFactory.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2017 the original author or authors.
2+
* Copyright 2012-2018 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.

spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/options/OptionHandler.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2017 the original author or authors.
2+
* Copyright 2012-2018 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.

spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/AstUtils.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2017 the original author or authors.
2+
* Copyright 2012-2018 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.

spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/GroovyCompiler.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2017 the original author or authors.
2+
* Copyright 2012-2018 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.

spring-boot-project/spring-boot/src/main/java/org/springframework/boot/builder/SpringApplicationBuilder.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2017 the original author or authors.
2+
* Copyright 2012-2018 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.

spring-boot-project/spring-boot/src/main/java/org/springframework/boot/util/LambdaSafe.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ public static <C, A> Callbacks<C, A> callbacks(Class<C> callbackType,
8181
Object... additionalArguments) {
8282
Assert.notNull(callbackType, "CallbackType must not be null");
8383
Assert.notNull(callbackInstances, "CallbackInstances must not be null");
84-
return new Callbacks<C, A>(callbackType, callbackInstances, argument,
84+
return new Callbacks<>(callbackType, callbackInstances, argument,
8585
additionalArguments);
8686
}
8787

@@ -341,8 +341,7 @@ public boolean match(Class<C> callbackType, C callbackInstance, A argument,
341341
*/
342342
public final static class InvocationResult<R> {
343343

344-
private static final InvocationResult<?> NONE = new InvocationResult<Object>(
345-
null);
344+
private static final InvocationResult<?> NONE = new InvocationResult<>(null);
346345

347346
private final R value;
348347

0 commit comments

Comments
 (0)