Apache9 commented on a change in pull request #673: HBASE-23093 : Avoid Optional Anti-Pattern where possible URL: https://github.com/apache/hbase/pull/673#discussion_r332386910
########## File path: hbase-client/src/main/java/org/apache/hadoop/hbase/client/ConnectionUtils.java ########## @@ -415,13 +414,15 @@ static void incRegionCountMetrics(ScanMetrics scanMetrics) { * increase the hedge read related metrics. */ private static <T> void connect(CompletableFuture<T> srcFuture, CompletableFuture<T> dstFuture, - Optional<MetricsConnection> metrics) { + MetricsConnection metrics) { Review comment: Here I do not think it is necessary to do this change? The upper layer will get an Optional, and then we convert it to an object or a null, by checking if the object is null, and here we check it again... ---------------------------------------------------------------- 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: us...@infra.apache.org With regards, Apache Git Services