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_r333492690
 
 

 ##########
 File path: 
hbase-server/src/main/java/org/apache/hadoop/hbase/io/HalfStoreFileReader.java
 ##########
 @@ -357,7 +357,7 @@ public boolean passesKeyRangeFilter(Scan scan) {
         }
       }
     }
-    return this.firstKey;
+    return Optional.ofNullable(this.firstKey);
 
 Review comment:
   Not sure if this has been answered but I think this method will be called 
multiple times? And we always need to do a wrapping and a null check?

----------------------------------------------------------------
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

Reply via email to