HBASE-22870 reflection fails to access a private nested class

Signed-off-by Reid Chan <reidchan@apache.org>

(cherry picked from commit 7697d48cd7)
This commit is contained in:
satanson 2019-08-18 09:47:06 +08:00 committed by Bharath Vissapragada
parent 81ee344439
commit 5d64f062d8
1 changed files with 4 additions and 2 deletions

View File

@ -1073,9 +1073,11 @@ public class HRegionServer extends HasThread implements
Timer abortMonitor = new Timer("Abort regionserver monitor", true);
TimerTask abortTimeoutTask = null;
try {
abortTimeoutTask =
Constructor<? extends TimerTask> timerTaskCtor =
Class.forName(conf.get(ABORT_TIMEOUT_TASK, SystemExitWhenAbortTimeout.class.getName()))
.asSubclass(TimerTask.class).getDeclaredConstructor().newInstance();
.asSubclass(TimerTask.class).getDeclaredConstructor();
timerTaskCtor.setAccessible(true);
abortTimeoutTask = timerTaskCtor.newInstance();
} catch (Exception e) {
LOG.warn("Initialize abort timeout task failed", e);
}