diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/simple/SimpleProperties.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/simple/SimpleProperties.java index df114024dd..8d0ec279d7 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/simple/SimpleProperties.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/simple/SimpleProperties.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2017 the original author or authors. + * Copyright 2012-2018 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. diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/info/Info.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/info/Info.java index 61c4eefc2f..be632c628c 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/info/Info.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/info/Info.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2017 the original author or authors. + * Copyright 2012-2018 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. diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/cache/CacheManagerCustomizers.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/cache/CacheManagerCustomizers.java index acca87ddb9..ff3a3273fc 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/cache/CacheManagerCustomizers.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/cache/CacheManagerCustomizers.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2017 the original author or authors. + * Copyright 2012-2018 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. diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/reactive/PathRequest.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/reactive/PathRequest.java index 067df91c19..395ad96645 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/reactive/PathRequest.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/reactive/PathRequest.java @@ -20,7 +20,8 @@ import org.springframework.boot.autoconfigure.security.StaticResourceLocation; import org.springframework.security.web.server.util.matcher.ServerWebExchangeMatcher; /** - * Factory that can be used to create a {@link ServerWebExchangeMatcher} for commonly used paths. + * Factory that can be used to create a {@link ServerWebExchangeMatcher} for commonly used + * paths. * * @author Madhura Bhave * @since 2.0.0 @@ -36,8 +37,7 @@ public final class PathRequest { * @return a {@link StaticResourceRequest} */ public static StaticResourceRequest toStaticResources() { - return StaticResourceRequest.get(); + return StaticResourceRequest.INSTANCE; } } - diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/reactive/StaticResourceRequest.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/reactive/StaticResourceRequest.java index 048a0dadd4..6e3ffb32c9 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/reactive/StaticResourceRequest.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/reactive/StaticResourceRequest.java @@ -33,8 +33,8 @@ import org.springframework.util.Assert; import org.springframework.web.server.ServerWebExchange; /** - * Used to create a {@link ServerWebExchangeMatcher} for static resources in - * commonly used locations. Returned by {@link PathRequest#toStaticResources()}. + * Used to create a {@link ServerWebExchangeMatcher} for static resources in commonly used + * locations. Returned by {@link PathRequest#toStaticResources()}. * * @author Madhura Bhave * @since 2.0.0 @@ -42,7 +42,7 @@ import org.springframework.web.server.ServerWebExchange; */ public final class StaticResourceRequest { - private static final StaticResourceRequest INSTANCE = new StaticResourceRequest(); + static final StaticResourceRequest INSTANCE = new StaticResourceRequest(); private StaticResourceRequest() { } @@ -83,20 +83,11 @@ public final class StaticResourceRequest { * @param locations the locations to include * @return the configured {@link ServerWebExchangeMatcher} */ - public StaticResourceServerWebExchange at( - Set locations) { + public StaticResourceServerWebExchange at(Set locations) { Assert.notNull(locations, "Locations must not be null"); return new StaticResourceServerWebExchange(new LinkedHashSet<>(locations)); } - /** - * Return the static resource request. - * @return the static resource request - */ - static StaticResourceRequest get() { - return INSTANCE; - } - /** * The server web exchange matcher used to match against resource * {@link StaticResourceLocation Locations}. diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/servlet/PathRequest.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/servlet/PathRequest.java index a87541557f..5c4ed4d2e0 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/servlet/PathRequest.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/servlet/PathRequest.java @@ -42,11 +42,12 @@ public final class PathRequest { * @return a {@link StaticResourceRequest} */ public static StaticResourceRequest toStaticResources() { - return StaticResourceRequest.get(); + return StaticResourceRequest.INSTANCE; } /** - * Returns a matcher that includes the H2 console location. For example:
+	 * Returns a matcher that includes the H2 console location. For example:
+	 * 
 	 * PathRequest.toH2Console()
 	 * 
* @return the configured {@link RequestMatcher} @@ -73,7 +74,8 @@ public final class PathRequest { } @Override - protected boolean matches(HttpServletRequest request, H2ConsoleProperties context) { + protected boolean matches(HttpServletRequest request, + H2ConsoleProperties context) { return this.delegate.matches(request); } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/servlet/StaticResourceRequest.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/servlet/StaticResourceRequest.java index a3954fd4d9..b037ec82a5 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/servlet/StaticResourceRequest.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/servlet/StaticResourceRequest.java @@ -34,8 +34,8 @@ import org.springframework.security.web.util.matcher.RequestMatcher; import org.springframework.util.Assert; /** - * Used to create a {@link RequestMatcher} for static resources in - * commonly used locations. Returned by {@link PathRequest#toStaticResources()}. + * Used to create a {@link RequestMatcher} for static resources in commonly used + * locations. Returned by {@link PathRequest#toStaticResources()}. * * @author Madhura Bhave * @author Phillip Webb @@ -44,7 +44,7 @@ import org.springframework.util.Assert; */ public final class StaticResourceRequest { - private static final StaticResourceRequest INSTANCE = new StaticResourceRequest(); + static final StaticResourceRequest INSTANCE = new StaticResourceRequest(); private StaticResourceRequest() { } @@ -90,14 +90,6 @@ public final class StaticResourceRequest { return new StaticResourceRequestMatcher(new LinkedHashSet<>(locations)); } - /** - * Return the static resource request. - * @return the static resource request - */ - static StaticResourceRequest get() { - return INSTANCE; - } - /** * The request matcher used to match against resource {@link StaticResourceLocation * Locations}. diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/transaction/TransactionManagerCustomizers.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/transaction/TransactionManagerCustomizers.java index 4108f62a68..68e8f5a3f0 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/transaction/TransactionManagerCustomizers.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/transaction/TransactionManagerCustomizers.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2017 the original author or authors. + * Copyright 2012-2018 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. diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/reactive/PathRequestTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/reactive/PathRequestTests.java index bfa65a0012..f79292d5f1 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/reactive/PathRequestTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/reactive/PathRequestTests.java @@ -29,7 +29,8 @@ public class PathRequestTests { @Test public void toStaticResourcesShouldReturnStaticResourceRequest() { - assertThat(PathRequest.toStaticResources()).isInstanceOf(StaticResourceRequest.class); + assertThat(PathRequest.toStaticResources()) + .isInstanceOf(StaticResourceRequest.class); } } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/reactive/StaticResourceRequestTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/reactive/StaticResourceRequestTests.java index 8f3f0911a7..7806c8a4ff 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/reactive/StaticResourceRequestTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/reactive/StaticResourceRequestTests.java @@ -44,7 +44,7 @@ import static org.mockito.Mockito.mock; */ public class StaticResourceRequestTests { - private StaticResourceRequest resourceRequest = StaticResourceRequest.get(); + private StaticResourceRequest resourceRequest = StaticResourceRequest.INSTANCE; @Rule public ExpectedException thrown = ExpectedException.none(); diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/servlet/PathRequestTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/servlet/PathRequestTests.java index 13c6f0c0a9..5e6b61514b 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/servlet/PathRequestTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/servlet/PathRequestTests.java @@ -44,7 +44,8 @@ public class PathRequestTests { @Test public void toStaticResourcesShouldReturnStaticResourceRequest() { - assertThat(PathRequest.toStaticResources()).isInstanceOf(StaticResourceRequest.class); + assertThat(PathRequest.toStaticResources()) + .isInstanceOf(StaticResourceRequest.class); } @Test diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/servlet/StaticResourceRequestTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/servlet/StaticResourceRequestTests.java index 50654bbec1..01ef099e31 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/servlet/StaticResourceRequestTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/servlet/StaticResourceRequestTests.java @@ -41,7 +41,7 @@ import static org.assertj.core.api.Assertions.assertThat; */ public class StaticResourceRequestTests { - private StaticResourceRequest resourceRequest = StaticResourceRequest.get(); + private StaticResourceRequest resourceRequest = StaticResourceRequest.INSTANCE; @Rule public ExpectedException thrown = ExpectedException.none(); @@ -92,8 +92,7 @@ public class StaticResourceRequestTests { public void excludeFromSetWhenSetIsNullShouldThrowException() { this.thrown.expect(IllegalArgumentException.class); this.thrown.expectMessage("Locations must not be null"); - this.resourceRequest.atCommonLocations() - .excluding(null); + this.resourceRequest.atCommonLocations().excluding(null); } private RequestMatcherAssert assertMatcher(RequestMatcher matcher) { diff --git a/spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli/DefaultCommandFactory.java b/spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli/DefaultCommandFactory.java index 9414a7613c..0c557740cd 100644 --- a/spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli/DefaultCommandFactory.java +++ b/spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli/DefaultCommandFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2017 the original author or authors. + * Copyright 2012-2018 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. diff --git a/spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/options/OptionHandler.java b/spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/options/OptionHandler.java index c2940e4b52..218740ac4c 100644 --- a/spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/options/OptionHandler.java +++ b/spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/options/OptionHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2017 the original author or authors. + * Copyright 2012-2018 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. diff --git a/spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/AstUtils.java b/spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/AstUtils.java index c4c37965d6..8db6716d5c 100644 --- a/spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/AstUtils.java +++ b/spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/AstUtils.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2017 the original author or authors. + * Copyright 2012-2018 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. diff --git a/spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/GroovyCompiler.java b/spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/GroovyCompiler.java index 4155115231..a2aa200b8b 100644 --- a/spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/GroovyCompiler.java +++ b/spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/GroovyCompiler.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2017 the original author or authors. + * Copyright 2012-2018 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. diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/builder/SpringApplicationBuilder.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/builder/SpringApplicationBuilder.java index 3a03607155..befe6e1dc3 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/builder/SpringApplicationBuilder.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/builder/SpringApplicationBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2017 the original author or authors. + * Copyright 2012-2018 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. diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/util/LambdaSafe.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/util/LambdaSafe.java index 1550da13b7..7ebfd42c84 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/util/LambdaSafe.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/util/LambdaSafe.java @@ -81,7 +81,7 @@ public final class LambdaSafe { Object... additionalArguments) { Assert.notNull(callbackType, "CallbackType must not be null"); Assert.notNull(callbackInstances, "CallbackInstances must not be null"); - return new Callbacks(callbackType, callbackInstances, argument, + return new Callbacks<>(callbackType, callbackInstances, argument, additionalArguments); } @@ -341,8 +341,7 @@ public final class LambdaSafe { */ public final static class InvocationResult { - private static final InvocationResult NONE = new InvocationResult( - null); + private static final InvocationResult NONE = new InvocationResult<>(null); private final R value;