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/08/29 07:58:56 UTC
(camel) 02/03: CAMEL-21137: camel-core - Add lazy option to @BindToRegistry
This is an automated email from the ASF dual-hosted git repository.
davsclaus pushed a commit to branch lazy
in repository https://gitbox.apache.org/repos/asf/camel.git
commit 4cdcd0c386a602ff91086e7d6d8601633e64b46c
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Thu Aug 29 09:37:07 2024 +0200
CAMEL-21137: camel-core - Add lazy option to @BindToRegistry
---
.../camel/impl/engine/DefaultDependencyInjectionAnnotationFactory.java | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/core/camel-base-engine/src/main/java/org/apache/camel/impl/engine/DefaultDependencyInjectionAnnotationFactory.java b/core/camel-base-engine/src/main/java/org/apache/camel/impl/engine/DefaultDependencyInjectionAnnotationFactory.java
index 83cf5fed04d..4994eaafa53 100644
--- a/core/camel-base-engine/src/main/java/org/apache/camel/impl/engine/DefaultDependencyInjectionAnnotationFactory.java
+++ b/core/camel-base-engine/src/main/java/org/apache/camel/impl/engine/DefaultDependencyInjectionAnnotationFactory.java
@@ -61,8 +61,7 @@ public class DefaultDependencyInjectionAnnotationFactory
}
}
CamelContextAware.trySetCamelContext(bean, camelContext);
- if (bean instanceof Supplier) {
- Supplier<Object> sup = (Supplier<Object>) bean;
+ if (bean instanceof Supplier<?> sup) {
camelContext.getRegistry().bind(id, beanType, sup);
} else {
camelContext.getRegistry().bind(id, bean);