private Method getCreateInheritedMapMethod()

in core/src/main/java/com/alibaba/smart/framework/engine/util/InheritableTaskWithCache.java [71:86]


    private Method getCreateInheritedMapMethod(Class threadLocalMapClazz) {
        if (threadLocalMapClazz != null && createInheritedMapMethod == null) {
            synchronized (accessLock) {
                if (createInheritedMapMethod == null) {
                    try {
                        Method method = ThreadLocal.class.getDeclaredMethod("createInheritedMap", threadLocalMapClazz);
                        method.setAccessible(true);
                        createInheritedMapMethod = method;
                    } catch (Exception e) {
                        throw new IllegalStateException(e);
                    }
                }
            }
        }
        return createInheritedMapMethod;
    }