diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/OnlyOnceLoggingDenyMeterFilter.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/OnlyOnceLoggingDenyMeterFilter.java index 92b4625aba7..b257f66c4fb 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/OnlyOnceLoggingDenyMeterFilter.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/OnlyOnceLoggingDenyMeterFilter.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2020 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. @@ -38,7 +38,7 @@ public final class OnlyOnceLoggingDenyMeterFilter implements MeterFilter { private static final Log logger = LogFactory.getLog(OnlyOnceLoggingDenyMeterFilter.class); - private final AtomicBoolean alreadyWarned = new AtomicBoolean(false); + private final AtomicBoolean alreadyWarned = new AtomicBoolean(); private final Supplier message; diff --git a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/neo4j/Neo4jHealthIndicatorTests.java b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/neo4j/Neo4jHealthIndicatorTests.java index a72f1fa8fd7..d5c28227e64 100644 --- a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/neo4j/Neo4jHealthIndicatorTests.java +++ b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/neo4j/Neo4jHealthIndicatorTests.java @@ -87,7 +87,7 @@ class Neo4jHealthIndicatorTests { ResultSummary resultSummary = ResultSummaryMock.createResultSummary("4711", "My Home", ""); Session session = mock(Session.class); Result statementResult = mockStatementResult(resultSummary, "some edition"); - AtomicInteger count = new AtomicInteger(0); + AtomicInteger count = new AtomicInteger(); given(session.run(anyString())).will((invocation) -> { if (count.compareAndSet(0, 1)) { throw new SessionExpiredException("Session expired"); diff --git a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/neo4j/Neo4jReactiveHealthIndicatorTest.java b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/neo4j/Neo4jReactiveHealthIndicatorTest.java index 9379d92d0f9..355dd41d149 100644 --- a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/neo4j/Neo4jReactiveHealthIndicatorTest.java +++ b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/neo4j/Neo4jReactiveHealthIndicatorTest.java @@ -66,7 +66,7 @@ class Neo4jReactiveHealthIndicatorTest { ResultSummary resultSummary = ResultSummaryMock.createResultSummary("4711", "My Home", ""); RxSession session = mock(RxSession.class); RxResult statementResult = mockStatementResult(resultSummary, "some edition"); - AtomicInteger count = new AtomicInteger(0); + AtomicInteger count = new AtomicInteger(); given(session.run(anyString())).will((invocation) -> { if (count.compareAndSet(0, 1)) { throw new SessionExpiredException("Session expired"); diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/BackgroundPreinitializer.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/BackgroundPreinitializer.java index eba44ac3019..a64699a784a 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/BackgroundPreinitializer.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/BackgroundPreinitializer.java @@ -60,7 +60,7 @@ public class BackgroundPreinitializer implements ApplicationListener> sources = new LinkedHashSet<>(); diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/ApplicationPidFileWriter.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/ApplicationPidFileWriter.java index 1fa0b65ae39..488daf6c7ea 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/ApplicationPidFileWriter.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/ApplicationPidFileWriter.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2020 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. @@ -86,7 +86,7 @@ public class ApplicationPidFileWriter implements ApplicationListener[] SOURCE_TYPES = { SpringApplication.class, ApplicationContext.class }; - private static final AtomicBoolean shutdownHookRegistered = new AtomicBoolean(false); + private static final AtomicBoolean shutdownHookRegistered = new AtomicBoolean(); private final Log logger = LogFactory.getLog(getClass()); diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/SpringApplicationTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/SpringApplicationTests.java index 1610eb5ddbc..b6cf0af4ece 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/SpringApplicationTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/SpringApplicationTests.java @@ -1506,7 +1506,7 @@ class SpringApplicationTests { @Bean AtomicInteger counter() { - return new AtomicInteger(0); + return new AtomicInteger(); } @Bean @@ -1529,7 +1529,7 @@ class SpringApplicationTests { @Bean AtomicInteger counter() { - return new AtomicInteger(0); + return new AtomicInteger(); } @Bean @@ -1553,7 +1553,7 @@ class SpringApplicationTests { @Bean AtomicInteger counter() { - return new AtomicInteger(0); + return new AtomicInteger(); } @Bean diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/server/AbstractServletWebServerFactoryTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/server/AbstractServletWebServerFactoryTests.java index 4800bf83e0a..7e92f7f48f4 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/server/AbstractServletWebServerFactoryTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/server/AbstractServletWebServerFactoryTests.java @@ -1355,7 +1355,7 @@ public abstract class AbstractServletWebServerFactoryTests { private class TestGzipInputStreamFactory implements InputStreamFactory { - private final AtomicBoolean requested = new AtomicBoolean(false); + private final AtomicBoolean requested = new AtomicBoolean(); @Override public InputStream create(InputStream in) throws IOException { diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-websocket-jetty/src/main/java/smoketest/websocket/jetty/snake/SnakeWebSocketHandler.java b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-websocket-jetty/src/main/java/smoketest/websocket/jetty/snake/SnakeWebSocketHandler.java index 8eaf0a04cab..fbc37fc7614 100644 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-websocket-jetty/src/main/java/smoketest/websocket/jetty/snake/SnakeWebSocketHandler.java +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-websocket-jetty/src/main/java/smoketest/websocket/jetty/snake/SnakeWebSocketHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2020 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. @@ -28,7 +28,7 @@ import org.springframework.web.socket.handler.TextWebSocketHandler; public class SnakeWebSocketHandler extends TextWebSocketHandler { - private static final AtomicInteger snakeIds = new AtomicInteger(0); + private static final AtomicInteger snakeIds = new AtomicInteger(); private static final Random random = new Random(); diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-websocket-tomcat/src/main/java/smoketest/websocket/tomcat/snake/SnakeWebSocketHandler.java b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-websocket-tomcat/src/main/java/smoketest/websocket/tomcat/snake/SnakeWebSocketHandler.java index d101119b16e..b6131a1bdbd 100644 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-websocket-tomcat/src/main/java/smoketest/websocket/tomcat/snake/SnakeWebSocketHandler.java +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-websocket-tomcat/src/main/java/smoketest/websocket/tomcat/snake/SnakeWebSocketHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2020 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. @@ -28,7 +28,7 @@ import org.springframework.web.socket.handler.TextWebSocketHandler; public class SnakeWebSocketHandler extends TextWebSocketHandler { - private static final AtomicInteger snakeIds = new AtomicInteger(0); + private static final AtomicInteger snakeIds = new AtomicInteger(); private static final Random random = new Random(); diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-websocket-undertow/src/main/java/smoketest/websocket/undertow/snake/SnakeWebSocketHandler.java b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-websocket-undertow/src/main/java/smoketest/websocket/undertow/snake/SnakeWebSocketHandler.java index 8583e86cbbd..e96e2c22e12 100644 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-websocket-undertow/src/main/java/smoketest/websocket/undertow/snake/SnakeWebSocketHandler.java +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-websocket-undertow/src/main/java/smoketest/websocket/undertow/snake/SnakeWebSocketHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2020 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. @@ -28,7 +28,7 @@ import org.springframework.web.socket.handler.TextWebSocketHandler; public class SnakeWebSocketHandler extends TextWebSocketHandler { - private static final AtomicInteger snakeIds = new AtomicInteger(0); + private static final AtomicInteger snakeIds = new AtomicInteger(); private static final Random random = new Random();