From 6f97b00a75e12ace7e3e21363c14bee917ea5b69 Mon Sep 17 00:00:00 2001 From: Roberto Cortez Date: Tue, 27 Oct 2020 16:07:37 +0000 Subject: [PATCH] Support SmallRye Config 1.9.3. --- bom/application/pom.xml | 2 +- .../runtime/configuration/Substitutions.java | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/bom/application/pom.xml b/bom/application/pom.xml index ef2a6a530050e..a44128e3262dc 100644 --- a/bom/application/pom.xml +++ b/bom/application/pom.xml @@ -35,7 +35,7 @@ 1.0.1 1.4.1 1.4.1 - 1.9.2 + 1.9.3 2.2.5 2.4.4 2.0.13 diff --git a/core/runtime/src/main/java/io/quarkus/runtime/configuration/Substitutions.java b/core/runtime/src/main/java/io/quarkus/runtime/configuration/Substitutions.java index 237f70a3cc1ef..3a35bda308015 100644 --- a/core/runtime/src/main/java/io/quarkus/runtime/configuration/Substitutions.java +++ b/core/runtime/src/main/java/io/quarkus/runtime/configuration/Substitutions.java @@ -13,6 +13,7 @@ import com.oracle.svm.core.threadlocal.FastThreadLocalInt; import io.smallrye.common.constraint.Assert; +import io.smallrye.config.ConfigMappingMetadata; import io.smallrye.config.Expressions; /** @@ -56,6 +57,15 @@ public static T withoutExpansion(Supplier supplier) { @TargetClass(className = "io.smallrye.config.ConfigMappingLoader") static final class Target_ConfigMappingLoader { + @Substitute + static Class loadClass(final Class parent, final ConfigMappingMetadata configMappingMetadata) { + try { + return parent.getClassLoader().loadClass(configMappingMetadata.getClassName()); + } catch (ClassNotFoundException e) { + return null; + } + } + @Substitute private static Class defineClass(final Class parent, final String className, final byte[] classBytes) { return null; @@ -77,5 +87,11 @@ public static Target_ConfigMappingInterface getConfigurationInterface(Class i return null; } } + + // This should not be called, but we substitute it anyway to make sure we remove any references to ASM classes. + @Substitute + public byte[] getClassBytes() { + return null; + } } }