Commit d8baefc3 authored by lijuny's avatar lijuny Committed by Stephane Nicoll

Simplify some code

See gh-17834
parent dec15864
......@@ -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,
......
......@@ -97,8 +97,7 @@ class ShutdownEndpointTests {
@Bean
ShutdownEndpoint endpoint() {
ShutdownEndpoint endpoint = new ShutdownEndpoint();
return endpoint;
return new ShutdownEndpoint();
}
@Bean
......
......@@ -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) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment