From 787cc877943324a37cab89e109c00a96816bdaee Mon Sep 17 00:00:00 2001 From: Duo Zhang Date: Sun, 3 Apr 2022 22:53:50 +0800 Subject: [PATCH] HBASE-26920 Fix missing braces warnings in TestProcedureMember (#4315) Signed-off-by: Xiaolin Ha (cherry picked from commit 78676bb85e826314e2ebd11524b05428481a0b51) --- .../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 61146a6c707..a4423aafdb7 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. - * + *

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

* 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