| Package | Description |
|---|---|
| org.dromara.hutool.core.reflect.lookup |
MethodHandles.Lookup 创建封装,以根据不同的条件查找MethodHandlesjdk8中如果直接调用 MethodHandles.lookup()获取到的MethodHandles.Lookup在调用findSpecial和unreflectSpecial
时会出现权限不够问题,抛出"no private access for invokespecial"异常,因此针对JDK8及JDK9+分别封装lookup方法。 |
| Modifier and Type | Class and Description |
|---|---|
class |
ConstructorLookupFactory
jdk8中如果直接调用
MethodHandles.lookup()获取到的MethodHandles.Lookup在调用findSpecial和unreflectSpecial时会出现权限不够问题,抛出"no private access for invokespecial"异常 所以通过反射创建MethodHandles.Lookup解决该问题。 |
class |
MethodLookupFactory
jdk11中直接调用MethodHandles.lookup()获取到的MethodHandles.Lookup只能对接口类型才会权限获取方法的方法句柄MethodHandle。
|
Copyright © 2025. All rights reserved.