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

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

The change introduced by https://issues.apache.org/jira/browse/HBASE-19497 is 
reverted by this patch. The findbugs may complain this change again.
{code}
     @Override
-    public synchronized void write(byte[] b, int off, int len) {
+    public void write(byte[] b, int off, int len) {
       this.ourBytes = b;
     }
+
+
+    @Override
+    public byte[] toByteArray() {
+      return ourBytes;
+    }
   }
{code}
 
good one.
{code}
-      l = (short) (l ^ (ByteBufferUtils.toByte(item, i) & 0xFF));
+      l = (short) (l ^ (ByteBufferUtils.toByte(nextItem, i) & 0xFF));
{code}

Is it possible to pass a RegionStateNode carrying null RegionInfo? It seems to 
me it is like a bug.
{code}
+    if (parentHRI == null) {
+      LOG.info("Unsplittable; parent region is null; node={}", node);
+      return false;
+    }
{code}

Could we use anonymous class instead if we want to build SINGLETON class.
{code}
   /**
+   * Singleton instance of this class inserted into flush queue.
+   */
+  private static final WakeupFlushThread WAKEUPFLUSH_INSTANCE = new 
WakeupFlushThread();
+
+  /**
+   * Marker class used as a token inserted into flush queue that ensures the 
flusher does not sleep.
+   * Create a single instance only.
+   */
+  private static final class WakeupFlushThread implements FlushQueueEntry {
+    private WakeupFlushThread() {}
+
+    @Override
+    public long getDelay(TimeUnit unit) {
+      return 0;
+    }
+
+    @Override
+    public int compareTo(Delayed o) {
+      return -1;
+    }
+
+    @Override
+    public boolean equals(Object obj) {
+      return obj == this;
+    }
+
+    @Override
+    public int hashCode() {
+      return 42;
+    }
+  }
{code}


 

> fix existing findbugs errors in hbase-server
> --------------------------------------------
>
>                 Key: HBASE-20069
>                 URL: https://issues.apache.org/jira/browse/HBASE-20069
>             Project: HBase
>          Issue Type: Sub-task
>          Components: findbugs
>            Reporter: Sean Busbey
>            Assignee: stack
>            Priority: Critical
>         Attachments: FindBugs Report.htm, HBASE-20069.branch-2.001.patch, 
> HBASE-20069.branch-2.002.patch, HBASE-20069.branch-2.003.patch
>
>
> now that findbugs is running on precommit we have some cleanup to do.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to