[ 
https://issues.apache.org/jira/browse/HBASE-19733?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16316483#comment-16316483
 ] 

Chia-Ping Tsai commented on HBASE-19733:
----------------------------------------

Why we need this change?
{code}
+  public static int findFirstMissingPositive(List<Integer> list) {
+    // writing list.get(i) to list.get(i)-1
+    int i = 0;
+    while (i < list.size()) {
+      if (list.get(i) > 0 && list.get(i) < list.size() &&
+          list.get(list.get(i)-1) != list.get(i)) {
+        Collections.swap(list, i, list.get(i)-1);
+      } else i++;
+    }
+    // search for list.get(i) != i+1, indicating that i+1 is absent
+    for (i = 0; i < list.size(); i++) {
+      if (list.get(i) != i+1) return i+1;
+    }
+    return list.size() + 1;
+  }
+  static {
+    List<Integer> list = Arrays.asList(3, 4, 0, 2);
+    int i = findFirstMissingPositive(list);
+    int j = 0;
+  }
{code}

It looks like a findbugs warning. Could we add a suppression instead? 
{code}
+        while (!stopped && processor.process(inputProtocol, outputProtocol)) {
+          stopped = stopped;
+        }
{code}

> Fix checkstyle error in hbase-thrift module
> -------------------------------------------
>
>                 Key: HBASE-19733
>                 URL: https://issues.apache.org/jira/browse/HBASE-19733
>             Project: HBase
>          Issue Type: Bug
>            Reporter: Ted Yu
>            Assignee: Ted Yu
>             Fix For: 2.0.0-beta-1
>
>         Attachments: 19733.txt
>
>
> Currently build is failing 
> (https://builds.apache.org/job/HBase-TRUNK_matrix/4363/jdk=JDK%201.8%20(latest),label=(Hadoop%20&&%20!H5)/console)
>  due to:
> {code}
> [ERROR] 
> src/main/java/org/apache/hadoop/hbase/thrift/TBoundedThreadPoolServer.java:[291,78]
>  (blocks) EmptyBlock: Must have at least one statement.
> ...
> [ERROR] Failed to execute goal 
> org.apache.maven.plugins:maven-checkstyle-plugin:2.17:check (checkstyle) on 
> project hbase-thrift: You have 1 Checkstyle violation. -> [Help 1]
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to