Fix new Sonar smells

* Optimize logic in the `ExpressionEvaluatingParameterSourceFactory`
do not compute object if they are present in maps.
Plus extract some common code to the method
This commit is contained in:
Artem Bilan
2020-01-02 10:43:22 -05:00
parent 5eb3bfe1c3
commit 1d80e9ff05
2 changed files with 39 additions and 55 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2017-2019 the original author or authors.
* Copyright 2017-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.
@@ -365,7 +365,7 @@ public class BaseHttpInboundEndpoint extends MessagingGatewaySupport implements
* @return true or false if HTTP request can contain the body
*/
protected static boolean isReadable(@Nullable HttpMethod httpMethod) {
return !(CollectionUtils.containsInstance(NON_READABLE_BODY_HTTP_METHODS, httpMethod));
return httpMethod != null && !(CollectionUtils.containsInstance(NON_READABLE_BODY_HTTP_METHODS, httpMethod));
}
}