diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/annotation/RequestPredicateFactory.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/annotation/RequestPredicateFactory.java index e4521148c3..b727237d5a 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/annotation/RequestPredicateFactory.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/annotation/RequestPredicateFactory.java @@ -65,8 +65,7 @@ class RequestPredicateFactory { private Parameter getAllRemainingPathSegmentsParameter(Parameter[] selectorParameters) { Parameter trailingPathsParameter = null; - for (int i = 0; i < selectorParameters.length; i++) { - Parameter selectorParameter = selectorParameters[i]; + for (Parameter selectorParameter : selectorParameters) { Selector selector = selectorParameter.getAnnotation(Selector.class); if (selector.match() == Match.ALL_REMAINING) { Assert.state(trailingPathsParameter == null, diff --git a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/context/ShutdownEndpointTests.java b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/context/ShutdownEndpointTests.java index 4802be2624..05f0ef4b4b 100644 --- a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/context/ShutdownEndpointTests.java +++ b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/context/ShutdownEndpointTests.java @@ -97,8 +97,7 @@ class ShutdownEndpointTests { @Bean ShutdownEndpoint endpoint() { - ShutdownEndpoint endpoint = new ShutdownEndpoint(); - return endpoint; + return new ShutdownEndpoint(); } @Bean diff --git a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/jmx/annotation/DiscoveredJmxOperationTests.java b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/jmx/annotation/DiscoveredJmxOperationTests.java index a9165b782c..ff1429382b 100644 --- a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/jmx/annotation/DiscoveredJmxOperationTests.java +++ b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/jmx/annotation/DiscoveredJmxOperationTests.java @@ -124,9 +124,7 @@ class DiscoveredJmxOperationTests { annotationAttributes.put("produces", "application/xml"); DiscoveredOperationMethod operationMethod = new DiscoveredOperationMethod(method, OperationType.READ, annotationAttributes); - DiscoveredJmxOperation operation = new DiscoveredJmxOperation(EndpointId.of("test"), operationMethod, - mock(OperationInvoker.class)); - return operation; + return new DiscoveredJmxOperation(EndpointId.of("test"), operationMethod, mock(OperationInvoker.class)); } private Method findMethod(String methodName) {