adoroszlai commented on a change in pull request #198: HDDS-2501. Sonar: Fix
issues found in the ObjectEndpoint class.
URL: https://github.com/apache/hadoop-ozone/pull/198#discussion_r347127664
##########
File path:
hadoop-ozone/s3gateway/src/main/java/org/apache/hadoop/ozone/s3/endpoint/ObjectEndpoint.java
##########
@@ -233,16 +233,19 @@ public Response get(
String rangeHeaderVal = headers.getHeaderString(RANGE_HEADER);
RangeHeader rangeHeader = null;
- LOG.debug("range Header provided value is {}", rangeHeaderVal);
+ if (LOG.isDebugEnabled()) {
+ LOG.debug("range Header provided value is {}", rangeHeaderVal);
+ }
Review comment:
Wrapping every `LOG.debug` in an `if` increases method complexity and may
trigger a new Sonar warning above a threshold (it does here). I think log
statements are safe to call unconditionally (both for performance and for
Sonar) as long as their arguments are not eagerly evaluated. Using
placeholders and passing existing objects as arguments should be OK.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]