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

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


The following commit(s) were added to refs/heads/main by this push:
     new b1c787bc6f Remove registration of Servlet classes with 
AdditionalBeanBuildItem
b1c787bc6f is described below

commit b1c787bc6f8b936e25304272bbf47b51335171c6
Author: James Netherton <jamesnether...@gmail.com>
AuthorDate: Fri Mar 1 13:48:20 2024 +0000

    Remove registration of Servlet classes with AdditionalBeanBuildItem
    
    Fixes #3204
---
 .../component/servlet/deployment/ServletProcessor.java        | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git 
a/extensions/servlet/deployment/src/main/java/org/apache/camel/quarkus/component/servlet/deployment/ServletProcessor.java
 
b/extensions/servlet/deployment/src/main/java/org/apache/camel/quarkus/component/servlet/deployment/ServletProcessor.java
index 308f5489db..7e21a43adb 100644
--- 
a/extensions/servlet/deployment/src/main/java/org/apache/camel/quarkus/component/servlet/deployment/ServletProcessor.java
+++ 
b/extensions/servlet/deployment/src/main/java/org/apache/camel/quarkus/component/servlet/deployment/ServletProcessor.java
@@ -20,7 +20,6 @@ import java.util.List;
 import java.util.Map.Entry;
 import java.util.Optional;
 
-import io.quarkus.arc.deployment.AdditionalBeanBuildItem;
 import io.quarkus.deployment.annotations.BuildProducer;
 import io.quarkus.deployment.annotations.BuildStep;
 import io.quarkus.deployment.builditem.FeatureBuildItem;
@@ -42,11 +41,11 @@ class ServletProcessor {
     }
 
     @BuildStep
-    void build(BuildProducer<ServletBuildItem> servlet, 
BuildProducer<AdditionalBeanBuildItem> additionalBean) {
+    void build(BuildProducer<ServletBuildItem> servlet) {
         boolean servletCreated = false;
         if (camelServletConfig.defaultServlet.isValid()) {
             servlet.produce(
-                    newServlet(ServletConfig.DEFAULT_SERVLET_NAME, 
camelServletConfig.defaultServlet, additionalBean));
+                    newServlet(ServletConfig.DEFAULT_SERVLET_NAME, 
camelServletConfig.defaultServlet));
             servletCreated = true;
         }
 
@@ -56,7 +55,7 @@ class ServletProcessor {
                         String.format("Use quarkus.camel.servlet.url-patterns 
instead of quarkus.camel.servlet.%s.url-patterns",
                                 ServletConfig.DEFAULT_SERVLET_NAME));
             }
-            servlet.produce(newServlet(e.getKey(), e.getValue(), 
additionalBean));
+            servlet.produce(newServlet(e.getKey(), e.getValue()));
             servletCreated = true;
         }
 
@@ -67,8 +66,7 @@ class ServletProcessor {
 
     }
 
-    static ServletBuildItem newServlet(String key, ServletConfig servletConfig,
-            BuildProducer<AdditionalBeanBuildItem> additionalBean) {
+    static ServletBuildItem newServlet(String key, ServletConfig 
servletConfig) {
         final String servletName = servletConfig.getEffectiveServletName(key);
         final Optional<List<String>> urlPatterns = servletConfig.urlPatterns;
         if (!urlPatterns.isPresent() || urlPatterns.get().isEmpty()) {
@@ -78,7 +76,6 @@ class ServletProcessor {
         }
 
         final Builder builder = ServletBuildItem.builder(servletName, 
servletConfig.servletClass);
-        additionalBean.produce(new 
AdditionalBeanBuildItem(servletConfig.servletClass));
         for (String pattern : urlPatterns.get()) {
             builder.addMapping(pattern);
         }

Reply via email to