You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by zh...@apache.org on 2022/04/03 15:20:30 UTC

[hbase] 03/04: HBASE-26920 Fix missing braces warnings in TestProcedureMember (#4315)

This is an automated email from the ASF dual-hosted git repository.

zhangduo pushed a commit to branch branch-2.4
in repository https://gitbox.apache.org/repos/asf/hbase.git

commit 1b768cd48d2367727499fd57a80f34e9d4360ed6
Author: Duo Zhang <zh...@apache.org>
AuthorDate: Sun Apr 3 22:53:50 2022 +0800

    HBASE-26920 Fix missing braces warnings in TestProcedureMember (#4315)
    
    Signed-off-by: Xiaolin Ha <ha...@apache.org>
    (cherry picked from commit 78676bb85e826314e2ebd11524b05428481a0b51)
---
 .../hadoop/hbase/procedure/TestProcedureMember.java       | 15 ++++++---------
 1 file changed, 6 insertions(+), 9 deletions(-)

diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/procedure/TestProcedureMember.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/procedure/TestProcedureMember.java
index 61146a6..a4423aa 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/procedure/TestProcedureMember.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/procedure/TestProcedureMember.java
@@ -48,6 +48,8 @@ import org.mockito.Mockito;
 import org.mockito.invocation.InvocationOnMock;
 import org.mockito.stubbing.Answer;
 
+import org.apache.hbase.thirdparty.com.google.common.io.Closeables;
+
 /**
  * Test the procedure member, and it's error handling mechanisms.
  */
@@ -77,14 +79,9 @@ public class TestProcedureMember {
    * Reset all the mock objects
    */
   @After
-  public void resetTest() {
+  public void resetTest() throws IOException {
     reset(mockListener, mockBuilder, mockMemberComms);
-    if (member != null)
-      try {
-        member.close();
-      } catch (IOException e) {
-        e.printStackTrace();
-      }
+    Closeables.close(member, true);
   }
 
   /**
@@ -273,7 +270,7 @@ public class TestProcedureMember {
 
   /**
    * Handle failures if a member's commit phase fails.
-   *
+   * <p/>
    * NOTE: This is the core difference that makes this different from traditional 2PC.  In true
    * 2PC the transaction is committed just before the coordinator sends commit messages to the
    * member.  Members are then responsible for reading its TX log.  This implementation actually
@@ -314,7 +311,7 @@ public class TestProcedureMember {
 
   /**
    * Handle Failures if a member's commit phase succeeds but notification to coordinator fails
-   *
+   * <p/>
    * NOTE: This is the core difference that makes this different from traditional 2PC.  In true
    * 2PC the transaction is committed just before the coordinator sends commit messages to the
    * member.  Members are then responsible for reading its TX log.  This implementation actually