You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hbase.apache.org by GitBox <gi...@apache.org> on 2022/07/25 10:24:51 UTC

[GitHub] [hbase] Apache9 commented on a diff in pull request #4646: HBASE-27210 Clean up error-prone findings in hbase-endpoint

Apache9 commented on code in PR #4646:
URL: https://github.com/apache/hbase/pull/4646#discussion_r928711510


##########
hbase-endpoint/src/test/java/org/apache/hadoop/hbase/coprocessor/TestSecureExport.java:
##########
@@ -389,11 +389,9 @@ public void testVisibilityLabels() throws IOException, Throwable {
         try (Connection conn = ConnectionFactory.createConnection(UTIL.getConfiguration());
           Table table = conn.getTable(importHtd.getTableName());
           ResultScanner scanner = table.getScanner(scan)) {
-          int count = 0;
-          for (Result r : scanner) {
-            ++count;
-          }
-          assertEquals(rowCount, count);
+          MutableInt count = new MutableInt();
+          scanner.forEach((r) -> count.increment());

Review Comment:
   Unnecessary parentheses :)
   
   And we could just use Iterables.size.



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

To unsubscribe, e-mail: issues-unsubscribe@hbase.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org