You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ja...@apache.org on 2023/10/09 10:39:49 UTC
[camel-quarkus] 02/03: Remove inImageBuildtimeCode check in XmlJaxbRecorder when creating JAXBContext
This is an automated email from the ASF dual-hosted git repository.
jamesnetherton pushed a commit to branch 3.2.x
in repository https://gitbox.apache.org/repos/asf/camel-quarkus.git
commit 9b92cee1e5dcac6daf6892e22add6832df10fc4d
Author: James Netherton <ja...@gmail.com>
AuthorDate: Fri Oct 6 13:16:50 2023 +0100
Remove inImageBuildtimeCode check in XmlJaxbRecorder when creating JAXBContext
Fixes #5407
---
.../camel/quarkus/component/xml/jaxb/XmlJaxbRecorder.java | 11 ++++-------
1 file changed, 4 insertions(+), 7 deletions(-)
diff --git a/extensions-core/xml-jaxb/runtime/src/main/java/org/apache/camel/quarkus/component/xml/jaxb/XmlJaxbRecorder.java b/extensions-core/xml-jaxb/runtime/src/main/java/org/apache/camel/quarkus/component/xml/jaxb/XmlJaxbRecorder.java
index db9bc6ed32..80acfbae9e 100644
--- a/extensions-core/xml-jaxb/runtime/src/main/java/org/apache/camel/quarkus/component/xml/jaxb/XmlJaxbRecorder.java
+++ b/extensions-core/xml-jaxb/runtime/src/main/java/org/apache/camel/quarkus/component/xml/jaxb/XmlJaxbRecorder.java
@@ -16,7 +16,6 @@
*/
package org.apache.camel.quarkus.component.xml.jaxb;
-import io.quarkus.runtime.ImageMode;
import io.quarkus.runtime.RuntimeValue;
import io.quarkus.runtime.annotations.Recorder;
import jakarta.xml.bind.JAXBException;
@@ -31,12 +30,10 @@ public class XmlJaxbRecorder {
public RuntimeValue<ModelJAXBContextFactory> newContextFactory() {
DefaultModelJAXBContextFactory factory = new DefaultModelJAXBContextFactory();
- if (ImageMode.current() == ImageMode.NATIVE_BUILD) {
- try {
- factory.newJAXBContext();
- } catch (JAXBException e) {
- throw new RuntimeCamelException("Unable to initialize Camel JAXBContext", e);
- }
+ try {
+ factory.newJAXBContext();
+ } catch (JAXBException e) {
+ throw new RuntimeCamelException("Unable to initialize Camel JAXBContext", e);
}
return new RuntimeValue<>(factory);
}