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 2024/03/04 09:16:02 UTC

(camel) branch main updated: Fix setting type converter registry to keep backwards behaviour. CEQ depends on this to set its custom type converter registry at build time. (#13374)

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 4c7720b3224 Fix setting type converter registry to keep backwards behaviour. CEQ depends on this to set its custom type converter registry at build time. (#13374)
4c7720b3224 is described below

commit 4c7720b3224e98b57312de08f1ca2ac6cb6a10d0
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Mon Mar 4 10:15:55 2024 +0100

    Fix setting type converter registry to keep backwards behaviour. CEQ depends on this to set its custom type converter registry at build time. (#13374)
---
 .../apache/camel/impl/engine/DefaultCamelContextExtension.java   | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/core/camel-base-engine/src/main/java/org/apache/camel/impl/engine/DefaultCamelContextExtension.java b/core/camel-base-engine/src/main/java/org/apache/camel/impl/engine/DefaultCamelContextExtension.java
index 7708db01495..a19eb8f7548 100644
--- a/core/camel-base-engine/src/main/java/org/apache/camel/impl/engine/DefaultCamelContextExtension.java
+++ b/core/camel-base-engine/src/main/java/org/apache/camel/impl/engine/DefaultCamelContextExtension.java
@@ -791,11 +791,6 @@ class DefaultCamelContextExtension implements ExtendedCamelContext {
             synchronized (lock) {
                 if (typeConverterRegistry == null) {
                     setTypeConverterRegistry(camelContext.createTypeConverterRegistry());
-
-                    // some registries are also a type converter implementation
-                    if (typeConverterRegistry instanceof TypeConverter newTypeConverter) {
-                        setTypeConverter(newTypeConverter);
-                    }
                 }
             }
         }
@@ -804,6 +799,10 @@ class DefaultCamelContextExtension implements ExtendedCamelContext {
 
     void setTypeConverterRegistry(TypeConverterRegistry typeConverterRegistry) {
         this.typeConverterRegistry = camelContext.getInternalServiceManager().addService(camelContext, typeConverterRegistry);
+        // some registries are also a type converter implementation
+        if (typeConverterRegistry instanceof TypeConverter newTypeConverter) {
+            setTypeConverter(newTypeConverter);
+        }
     }
 
     void stopTypeConverter() {