Skip to content

Commit

Permalink
Use io.quarkus.runtime.ReflectionUtil#lookupMethod
Browse files Browse the repository at this point in the history
Reduces the complexity of the NativeImageFeatureStep by invoking the
equivalent helper method.
  • Loading branch information
zakkak committed Sep 5, 2022
1 parent c06224e commit 1eb4fc0
Showing 1 changed file with 2 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -355,11 +355,8 @@ public void write(String s, byte[] bytes) {
ResultHandle locClass = overallCatch.loadClassFromTCCL(LOCALIZATION_FEATURE);
ResultHandle newParams = overallCatch.marshalAsArray(Class.class, overallCatch.loadClassFromTCCL(String.class));
ResultHandle registerMethod = overallCatch.invokeVirtualMethod(
ofMethod(Class.class, "getDeclaredMethod", Method.class, String.class, Class[].class), locClass,
overallCatch.load("prepareBundle"), newParams);

overallCatch.invokeVirtualMethod(ofMethod(AccessibleObject.class, "setAccessible", void.class, boolean.class),
registerMethod, overallCatch.load(true));
LOOKUP_METHOD,
locClass, overallCatch.load("prepareBundle"), newParams);

ResultHandle locSupport = overallCatch.invokeStaticMethod(
IMAGE_SINGLETONS_LOOKUP,
Expand Down

0 comments on commit 1eb4fc0

Please sign in to comment.