This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/main by this push:
     new e61d7c00e87 CAMEL-20013: AdviceWith should have model dumper as 
optional in case its not on classpath.
e61d7c00e87 is described below

commit e61d7c00e87ba687156f2fcbc4319532f1a7f7e1
Author: Claus Ibsen <[email protected]>
AuthorDate: Wed Oct 18 16:18:18 2023 +0200

    CAMEL-20013: AdviceWith should have model dumper as optional in case its 
not on classpath.
---
 .../src/main/java/org/apache/camel/builder/AdviceWith.java             | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git 
a/core/camel-core-model/src/main/java/org/apache/camel/builder/AdviceWith.java 
b/core/camel-core-model/src/main/java/org/apache/camel/builder/AdviceWith.java
index 63ddec47054..4b210df3f82 100644
--- 
a/core/camel-core-model/src/main/java/org/apache/camel/builder/AdviceWith.java
+++ 
b/core/camel-core-model/src/main/java/org/apache/camel/builder/AdviceWith.java
@@ -239,9 +239,9 @@ public final class AdviceWith {
         }
 
         String beforeAsXml = null;
-        final ModelToXMLDumper modelToXMLDumper = 
PluginHelper.getModelToXMLDumper(ecc);
         if (logRoutesAsXml && LOG.isInfoEnabled()) {
             try {
+                ModelToXMLDumper modelToXMLDumper = 
PluginHelper.getModelToXMLDumper(ecc);
                 beforeAsXml = modelToXMLDumper.dumpModelAsXml(camelContext, 
definition);
             } catch (Exception e) {
                 // ignore, it may be due jaxb is not on classpath etc
@@ -278,6 +278,7 @@ public final class AdviceWith {
 
         if (beforeAsXml != null && logRoutesAsXml && LOG.isInfoEnabled()) {
             try {
+                ModelToXMLDumper modelToXMLDumper = 
PluginHelper.getModelToXMLDumper(ecc);
                 String afterAsXml = 
modelToXMLDumper.dumpModelAsXml(camelContext, merged);
                 LOG.info("Adviced route before/after as XML:\n{}\n\n{}", 
beforeAsXml, afterAsXml);
             } catch (Exception e) {

Reply via email to