diff --git a/amoro-common/src/main/java/org/apache/amoro/utils/ReflectionUtils.java b/amoro-common/src/main/java/org/apache/amoro/utils/ReflectionUtils.java index e53e6555eb..a60e4c3f7e 100644 --- a/amoro-common/src/main/java/org/apache/amoro/utils/ReflectionUtils.java +++ b/amoro-common/src/main/java/org/apache/amoro/utils/ReflectionUtils.java @@ -18,7 +18,6 @@ package org.apache.amoro.utils; -import org.apache.amoro.table.TableMetaStore; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -30,27 +29,27 @@ public class ReflectionUtils { - private static final Logger LOG = LoggerFactory.getLogger(ReflectionUtils.class); - private static final Map CLASS_MAP = new HashMap<>(); + private static final Logger LOG = LoggerFactory.getLogger(ReflectionUtils.class); + private static final Map CLASS_MAP = new HashMap<>(); - public static Object invoke(String className, String methodName) - throws InvocationTargetException, IllegalAccessException, NoSuchMethodException { - Class classRef = - CLASS_MAP.computeIfAbsent( - className, - key -> { - try { - return Class.forName(className); - } catch (ClassNotFoundException e) { - //ignore error - return null; - } - }); - if (Objects.isNull(classRef)) { - LOG.warn("cannot load class {}, skip execute method {}" ,className, methodName); - return null; - } - Method method = classRef.getDeclaredMethod(methodName); - return method.invoke(null); + public static Object invoke(String className, String methodName) + throws InvocationTargetException, IllegalAccessException, NoSuchMethodException { + Class classRef = + CLASS_MAP.computeIfAbsent( + className, + key -> { + try { + return Class.forName(className); + } catch (ClassNotFoundException e) { + // ignore error + return null; + } + }); + if (Objects.isNull(classRef)) { + LOG.warn("cannot load class {}, skip execute method {}", className, methodName); + return null; } + Method method = classRef.getDeclaredMethod(methodName); + return method.invoke(null); + } }