You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2023/09/22 20:45:46 UTC

[camel] branch main updated: Add debug message for missing JAXB XmlRootElement annotation (#11517)

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 bd2bb95c9fc Add debug message for missing JAXB XmlRootElement annotation (#11517)
bd2bb95c9fc is described below

commit bd2bb95c9fcec9c5c6e985f9f8ae0d78e67111ce
Author: Adriano Machado <60...@users.noreply.github.com>
AuthorDate: Fri Sep 22 16:45:41 2023 -0400

    Add debug message for missing JAXB XmlRootElement annotation (#11517)
    
    Co-authored-by: Adriano Machado <ad...@redhat.com>
---
 .../java/org/apache/camel/converter/jaxb/FallbackTypeConverter.java | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/components/camel-jaxb/src/main/java/org/apache/camel/converter/jaxb/FallbackTypeConverter.java b/components/camel-jaxb/src/main/java/org/apache/camel/converter/jaxb/FallbackTypeConverter.java
index bb8f83faf79..c3ff446b71b 100644
--- a/components/camel-jaxb/src/main/java/org/apache/camel/converter/jaxb/FallbackTypeConverter.java
+++ b/components/camel-jaxb/src/main/java/org/apache/camel/converter/jaxb/FallbackTypeConverter.java
@@ -148,7 +148,11 @@ public class FallbackTypeConverter {
     }
 
     private <T> boolean hasXmlRootElement(Class<T> type) {
-        return type.getAnnotation(XmlRootElement.class) != null;
+        boolean answer = type.getAnnotation(XmlRootElement.class) != null;
+        if (!answer && LOG.isTraceEnabled()) {
+            LOG.trace("Class {} is not annotated with @{}", type.getName(), XmlRootElement.class.getName());
+        }
+        return answer;
     }
 
     protected <T> boolean isJaxbType(Class<T> type, Exchange exchange, boolean objectFactory) {