diff --git a/extensions/resteasy-reactive/quarkus-resteasy-reactive/runtime/src/main/java/io/quarkus/resteasy/reactive/server/runtime/ResteasyReactiveRecorder.java b/extensions/resteasy-reactive/quarkus-resteasy-reactive/runtime/src/main/java/io/quarkus/resteasy/reactive/server/runtime/ResteasyReactiveRecorder.java index b32ea256221b4..1ab27aef29823 100644 --- a/extensions/resteasy-reactive/quarkus-resteasy-reactive/runtime/src/main/java/io/quarkus/resteasy/reactive/server/runtime/ResteasyReactiveRecorder.java +++ b/extensions/resteasy-reactive/quarkus-resteasy-reactive/runtime/src/main/java/io/quarkus/resteasy/reactive/server/runtime/ResteasyReactiveRecorder.java @@ -70,8 +70,13 @@ public Executor get() { public static final Supplier VIRTUAL_EXECUTOR_SUPPLIER = new Supplier() { Executor current = null; - //This method is used to specify a custom executor to dispatch virtual threads on carrier threads - //It is used for test purposes for now + /** + * This method is used to specify a custom executor to dispatch virtual threads on carrier threads + * We need reflection for both ease of use (see {@link #get() Get} method) but also because we call methods + * of private classes from the java.lang package. + * + * It is used for testing purposes only for now + */ private Executor setVirtualThreadCustomScheduler(Executor executor) throws ClassNotFoundException, InvocationTargetException, InstantiationException, IllegalAccessException, NoSuchMethodException { var vtf = Class.forName("java.lang.ThreadBuilders").getDeclaredClasses()[0]; @@ -85,11 +90,13 @@ private Executor setVirtualThreadCustomScheduler(Executor executor) throws Class .invoke(this, tf); } + /** + * This method uses reflection in order to allow developers to quickly test quarkus-loom without needing to + * change --release, --source, --target flags and to enable previews. + * Since we try to load the "Loom-preview" classes/methods at runtime, the application can even be compiled + * using java 11 and executed with a loom-compliant JDK. + */ @Override - //This method uses reflection in order to allow developers to quickly test quarkus-loom without needing to - //change --release, --source, --target flags and to enable previews - //Since we try to load the "Loom-preview" classes/methods at runtime, the application can even be compiled using - //java 11 and executed with a loom-compliant JDK. public Executor get() { if (current == null) { try {