From 35d94fca7bc310925bfda9d5517bb935871facd1 Mon Sep 17 00:00:00 2001 From: Stuart Douglas Date: Tue, 28 Jul 2020 13:19:07 +1000 Subject: [PATCH] Fix Qute ValueResolver generated in wrong CL Fixes #11007 --- .../io/quarkus/qute/deployment/QuteProcessor.java | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/extensions/qute/deployment/src/main/java/io/quarkus/qute/deployment/QuteProcessor.java b/extensions/qute/deployment/src/main/java/io/quarkus/qute/deployment/QuteProcessor.java index 5efef354c22ee..24fc53d6f551d 100644 --- a/extensions/qute/deployment/src/main/java/io/quarkus/qute/deployment/QuteProcessor.java +++ b/extensions/qute/deployment/src/main/java/io/quarkus/qute/deployment/QuteProcessor.java @@ -56,6 +56,7 @@ import io.quarkus.arc.processor.BuildExtension; import io.quarkus.arc.processor.DotNames; import io.quarkus.arc.processor.InjectionPointInfo; +import io.quarkus.bootstrap.classloading.QuarkusClassLoader; import io.quarkus.deployment.ApplicationArchive; import io.quarkus.deployment.Feature; import io.quarkus.deployment.GeneratedClassGizmoAdaptor; @@ -700,15 +701,13 @@ public boolean test(String name) { if (idx == -1) { idx = name.lastIndexOf(ValueResolverGenerator.SUFFIX); } - String className = name.substring(0, idx).replace("/", "."); + String className = name.substring(0, idx); if (className.contains(ValueResolverGenerator.NESTED_SEPARATOR)) { className = className.replace(ValueResolverGenerator.NESTED_SEPARATOR, "$"); } - if (applicationArchivesBuildItem.getRootArchive().getIndex() - .getClassByName(DotName.createSimple(className)) != null) { - return true; - } - return false; + //if the class is (directly) in the TCCL (and not its parent) then it is an application class + QuarkusClassLoader cl = (QuarkusClassLoader) Thread.currentThread().getContextClassLoader(); + return !cl.getElementsWithResource(className + ".class", true).isEmpty(); } });