You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by GitBox <gi...@apache.org> on 2020/09/24 13:03:30 UTC

[GitHub] [camel-quarkus] JiriOndrusek commented on a change in pull request #1828: String template native support #1694

JiriOndrusek commented on a change in pull request #1828:
URL: https://github.com/apache/camel-quarkus/pull/1828#discussion_r494298738



##########
File path: extensions/stringtemplate/deployment/src/main/java/org/apache/camel/quarkus/component/stringtemplate/deployment/StringtemplateProcessor.java
##########
@@ -17,30 +17,23 @@
 package org.apache.camel.quarkus.component.stringtemplate.deployment;
 
 import io.quarkus.deployment.annotations.BuildStep;
-import io.quarkus.deployment.annotations.ExecutionTime;
-import io.quarkus.deployment.annotations.Record;
 import io.quarkus.deployment.builditem.FeatureBuildItem;
-import io.quarkus.deployment.pkg.steps.NativeBuild;
-import org.apache.camel.quarkus.core.JvmOnlyRecorder;
-import org.jboss.logging.Logger;
+import io.quarkus.deployment.builditem.nativeimage.ReflectiveClassBuildItem;
+import org.apache.camel.support.DefaultExchange;
 
 class StringtemplateProcessor {
 
-    private static final Logger LOG = Logger.getLogger(StringtemplateProcessor.class);
     private static final String FEATURE = "camel-stringtemplate";
 
     @BuildStep
     FeatureBuildItem feature() {
         return new FeatureBuildItem(FEATURE);
     }
 
-    /**
-     * Remove this once this extension starts supporting the native mode.
-     */
-    @BuildStep(onlyIf = NativeBuild.class)
-    @Record(value = ExecutionTime.RUNTIME_INIT)
-    void warnJvmInNative(JvmOnlyRecorder recorder) {
-        JvmOnlyRecorder.warnJvmInNative(LOG, FEATURE); // warn at build time
-        recorder.warnJvmInNative(FEATURE); // warn at runtime
+    @BuildStep
+    ReflectiveClassBuildItem registerForReflectionWithMethods() {
+        return new ReflectiveClassBuildItem(true, false,
+                //required for values in properties
+                DefaultExchange.class.getName());

Review comment:
       If it may be security vulnerability, I'll remove corresponding test, I'll remove this build item and add into limitations, that this feature is not supported in native mode. @jamesnetherton Do you agree?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org