Simplify some code

See gh-17834
This commit is contained in:
lijuny 2019-08-11 23:01:06 +08:00 committed by Stephane Nicoll
parent dec15864df
commit d8baefc38a
3 changed files with 3 additions and 7 deletions

View File

@ -65,8 +65,7 @@ class RequestPredicateFactory {
private Parameter getAllRemainingPathSegmentsParameter(Parameter[] selectorParameters) { private Parameter getAllRemainingPathSegmentsParameter(Parameter[] selectorParameters) {
Parameter trailingPathsParameter = null; Parameter trailingPathsParameter = null;
for (int i = 0; i < selectorParameters.length; i++) { for (Parameter selectorParameter : selectorParameters) {
Parameter selectorParameter = selectorParameters[i];
Selector selector = selectorParameter.getAnnotation(Selector.class); Selector selector = selectorParameter.getAnnotation(Selector.class);
if (selector.match() == Match.ALL_REMAINING) { if (selector.match() == Match.ALL_REMAINING) {
Assert.state(trailingPathsParameter == null, Assert.state(trailingPathsParameter == null,

View File

@ -97,8 +97,7 @@ class ShutdownEndpointTests {
@Bean @Bean
ShutdownEndpoint endpoint() { ShutdownEndpoint endpoint() {
ShutdownEndpoint endpoint = new ShutdownEndpoint(); return new ShutdownEndpoint();
return endpoint;
} }
@Bean @Bean

View File

@ -124,9 +124,7 @@ class DiscoveredJmxOperationTests {
annotationAttributes.put("produces", "application/xml"); annotationAttributes.put("produces", "application/xml");
DiscoveredOperationMethod operationMethod = new DiscoveredOperationMethod(method, OperationType.READ, DiscoveredOperationMethod operationMethod = new DiscoveredOperationMethod(method, OperationType.READ,
annotationAttributes); annotationAttributes);
DiscoveredJmxOperation operation = new DiscoveredJmxOperation(EndpointId.of("test"), operationMethod, return new DiscoveredJmxOperation(EndpointId.of("test"), operationMethod, mock(OperationInvoker.class));
mock(OperationInvoker.class));
return operation;
} }
private Method findMethod(String methodName) { private Method findMethod(String methodName) {