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 2023/02/17 13:12:42 UTC

[hbase] branch branch-2 updated: HBASE-27645 [JDK17] Use ReflectionUtils#getModifiersField in UT (#5029)

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

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


The following commit(s) were added to refs/heads/branch-2 by this push:
     new 3b8d7ad5121 HBASE-27645 [JDK17] Use ReflectionUtils#getModifiersField in UT (#5029)
3b8d7ad5121 is described below

commit 3b8d7ad51219c98d586b31c02dd58aaa8a7696cf
Author: tianhang <ta...@gmail.com>
AuthorDate: Fri Feb 17 21:12:33 2023 +0800

    HBASE-27645 [JDK17] Use ReflectionUtils#getModifiersField in UT (#5029)
    
    Signed-off-by: Duo Zhang <zh...@apache.org>
---
 .../org/apache/hadoop/hbase/client/TestConnectionImplementation.java   | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestConnectionImplementation.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestConnectionImplementation.java
index cbd83ef2c3e..71a56c19418 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestConnectionImplementation.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestConnectionImplementation.java
@@ -70,6 +70,7 @@ import org.apache.hadoop.hbase.util.Bytes;
 import org.apache.hadoop.hbase.util.EnvironmentEdgeManager;
 import org.apache.hadoop.hbase.util.JVMClusterUtil;
 import org.apache.hadoop.hbase.util.ManualEnvironmentEdge;
+import org.apache.hadoop.hbase.util.ReflectionUtils;
 import org.apache.hadoop.hbase.util.Threads;
 import org.junit.After;
 import org.junit.AfterClass;
@@ -850,7 +851,7 @@ public class TestConnectionImplementation {
   private int setNumTries(ConnectionImplementation hci, int newVal) throws Exception {
     Field numTries = hci.getClass().getDeclaredField("numTries");
     numTries.setAccessible(true);
-    Field modifiersField = Field.class.getDeclaredField("modifiers");
+    Field modifiersField = ReflectionUtils.getModifiersField();
     modifiersField.setAccessible(true);
     modifiersField.setInt(numTries, numTries.getModifiers() & ~Modifier.FINAL);
     final int prevNumRetriesVal = (Integer) numTries.get(hci);