Skip to content

Commit

Permalink
Merge pull request #11015 from stuartwdouglas/11007
Browse files Browse the repository at this point in the history
Fix Qute ValueResolver generated in wrong CL
  • Loading branch information
gsmet authored Jul 29, 2020
2 parents 3edd874 + 35d94fc commit 599e79a
Showing 1 changed file with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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();
}
});

Expand Down

0 comments on commit 599e79a

Please sign in to comment.