diff --git a/java/src/main/java/io/github/toolfactory/jvm/function/catalog/ConstructorInvokeFunction.java b/java/src/main/java/io/github/toolfactory/jvm/function/catalog/ConstructorInvokeFunction.java index b4b195c6..81c5905a 100644 --- a/java/src/main/java/io/github/toolfactory/jvm/function/catalog/ConstructorInvokeFunction.java +++ b/java/src/main/java/io/github/toolfactory/jvm/function/catalog/ConstructorInvokeFunction.java @@ -53,10 +53,10 @@ public static class ForJava7 extends Abst { public ForJava7(Map context) throws Throwable { ObjectProvider functionProvider = ObjectProvider.get(context); - Class constructorAccessorImplClass = Class.forName("sun.reflect.NativeConstructorAccessorImpl"); - Method method = constructorAccessorImplClass.getDeclaredMethod("newInstance0", Constructor.class, Object[].class); + Class accessorImplClass = Class.forName("sun.reflect.NativeConstructorAccessorImpl"); + Method method = accessorImplClass.getDeclaredMethod("newInstance0", Constructor.class, Object[].class); ConsulterSupplyFunction getConsulterFunction = functionProvider.getOrBuildObject(ConsulterSupplyFunction.class, context); - MethodHandles.Lookup consulter = getConsulterFunction.apply(constructorAccessorImplClass); + MethodHandles.Lookup consulter = getConsulterFunction.apply(accessorImplClass); method.setAccessible(true); methodHandle = consulter.unreflect(method); } @@ -67,10 +67,10 @@ public static class ForJava9 extends Abst { public ForJava9(Map context) throws Throwable { ObjectProvider functionProvider = ObjectProvider.get(context); - Class constructorAccessorImplClass = Class.forName("jdk.internal.reflect.NativeConstructorAccessorImpl"); - Method method = constructorAccessorImplClass.getDeclaredMethod("newInstance0", Constructor.class, Object[].class); + Class accessorImplClass = Class.forName("jdk.internal.reflect.NativeConstructorAccessorImpl"); + Method method = accessorImplClass.getDeclaredMethod("newInstance0", Constructor.class, Object[].class); ConsulterSupplyFunction getConsulterFunction = functionProvider.getOrBuildObject(ConsulterSupplyFunction.class, context); - MethodHandles.Lookup consulter = getConsulterFunction.apply(constructorAccessorImplClass); + MethodHandles.Lookup consulter = getConsulterFunction.apply(accessorImplClass); methodHandle = consulter.unreflect(method); } @@ -80,10 +80,10 @@ public static class ForJava22 extends Abst { public ForJava22(Map context) throws Throwable { ObjectProvider functionProvider = ObjectProvider.get(context); - Class constructorAccessorImplClass = Class.forName("jdk.internal.reflect.DirectConstructorHandleAccessor$NativeAccessor"); - Method method = constructorAccessorImplClass.getDeclaredMethod("newInstance0", Constructor.class, Object[].class); + Class accessorImplClass = Class.forName("jdk.internal.reflect.DirectConstructorHandleAccessor$NativeAccessor"); + Method method = accessorImplClass.getDeclaredMethod("newInstance0", Constructor.class, Object[].class); ConsulterSupplyFunction getConsulterFunction = functionProvider.getOrBuildObject(ConsulterSupplyFunction.class, context); - MethodHandles.Lookup consulter = getConsulterFunction.apply(constructorAccessorImplClass); + MethodHandles.Lookup consulter = getConsulterFunction.apply(accessorImplClass); methodHandle = consulter.unreflect(method); } diff --git a/java/src/main/java/io/github/toolfactory/jvm/function/catalog/MethodInvokeFunction.java b/java/src/main/java/io/github/toolfactory/jvm/function/catalog/MethodInvokeFunction.java index 9b6995a5..bb6f3b29 100644 --- a/java/src/main/java/io/github/toolfactory/jvm/function/catalog/MethodInvokeFunction.java +++ b/java/src/main/java/io/github/toolfactory/jvm/function/catalog/MethodInvokeFunction.java @@ -51,11 +51,11 @@ public Object apply(Method method, Object target, Object[] params) throws Throwa public static class ForJava7 extends Abst { public ForJava7(Map context) throws Throwable { - Class nativeAccessorImplClass = Class.forName("sun.reflect.NativeMethodAccessorImpl"); - Method invoker = nativeAccessorImplClass.getDeclaredMethod("invoke0", Method.class, Object.class, Object[].class); + Class accessorImplClass = Class.forName("sun.reflect.NativeMethodAccessorImpl"); + Method invoker = accessorImplClass.getDeclaredMethod("invoke0", Method.class, Object.class, Object[].class); ObjectProvider functionProvider = ObjectProvider.get(context); ConsulterSupplyFunction consulterSupplyFunction = functionProvider.getOrBuildObject(ConsulterSupplyFunction.class, context); - MethodHandles.Lookup consulter = consulterSupplyFunction.apply(nativeAccessorImplClass); + MethodHandles.Lookup consulter = consulterSupplyFunction.apply(accessorImplClass); functionProvider.getOrBuildObject(SetAccessibleFunction.class, context).accept(invoker, true); methodHandle = consulter.unreflect(invoker); } @@ -65,11 +65,11 @@ public ForJava7(Map context) throws Throwable { public static class ForJava9 extends Abst { public ForJava9(Map context) throws Throwable { - Class nativeMethodAccessorImplClass = Class.forName("jdk.internal.reflect.NativeMethodAccessorImpl"); - Method invoker = nativeMethodAccessorImplClass.getDeclaredMethod("invoke0", Method.class, Object.class, Object[].class); + Class accessorImplClass = Class.forName("jdk.internal.reflect.NativeMethodAccessorImpl"); + Method invoker = accessorImplClass.getDeclaredMethod("invoke0", Method.class, Object.class, Object[].class); ObjectProvider functionProvider = ObjectProvider.get(context); ConsulterSupplyFunction consulterSupplyFunction = functionProvider.getOrBuildObject(ConsulterSupplyFunction.class, context); - MethodHandles.Lookup consulter = consulterSupplyFunction.apply(nativeMethodAccessorImplClass); + MethodHandles.Lookup consulter = consulterSupplyFunction.apply(accessorImplClass); functionProvider.getOrBuildObject(SetAccessibleFunction.class, context).accept(invoker, true); methodHandle = consulter.unreflect(invoker); } @@ -79,11 +79,11 @@ public ForJava9(Map context) throws Throwable { public static class ForJava22 extends Abst { public ForJava22(Map context) throws Throwable { - Class nativeMethodAccessorImplClass = Class.forName("jdk.internal.reflect.DirectMethodHandleAccessor$NativeAccessor"); - Method invoker = nativeMethodAccessorImplClass.getDeclaredMethod("invoke0", Method.class, Object.class, Object[].class); + Class accessorImplClass = Class.forName("jdk.internal.reflect.DirectMethodHandleAccessor$NativeAccessor"); + Method invoker = accessorImplClass.getDeclaredMethod("invoke0", Method.class, Object.class, Object[].class); ObjectProvider functionProvider = ObjectProvider.get(context); ConsulterSupplyFunction consulterSupplyFunction = functionProvider.getOrBuildObject(ConsulterSupplyFunction.class, context); - MethodHandles.Lookup consulter = consulterSupplyFunction.apply(nativeMethodAccessorImplClass); + MethodHandles.Lookup consulter = consulterSupplyFunction.apply(accessorImplClass); functionProvider.getOrBuildObject(SetAccessibleFunction.class, context).accept(invoker, true); methodHandle = consulter.unreflect(invoker); }