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 43c96a9b95 Fix Arc warnings for ApplicationScoped beans produced for 
JDK classes with final methods
43c96a9b95 is described below

commit 43c96a9b9503f80af0cd8df46b1953f17cd15c10
Author: James Netherton <[email protected]>
AuthorDate: Tue Aug 4 07:04:24 2026 +0100

    Fix Arc warnings for ApplicationScoped beans produced for JDK classes with 
final methods
    
    Fixes #8928
---
 .../component/scheduler/it/SchedulerProducers.java | 61 ++++++++++++++++++++++
 .../component/scheduler/it/SchedulerResource.java  | 35 -------------
 .../quarkus/test/support/kafka/KafkaProducers.java |  6 +--
 3 files changed, 64 insertions(+), 38 deletions(-)

diff --git 
a/integration-test-groups/foundation/scheduler/src/main/java/org/apache/camel/quarkus/component/scheduler/it/SchedulerProducers.java
 
b/integration-test-groups/foundation/scheduler/src/main/java/org/apache/camel/quarkus/component/scheduler/it/SchedulerProducers.java
new file mode 100644
index 0000000000..db9dad69c7
--- /dev/null
+++ 
b/integration-test-groups/foundation/scheduler/src/main/java/org/apache/camel/quarkus/component/scheduler/it/SchedulerProducers.java
@@ -0,0 +1,61 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.quarkus.component.scheduler.it;
+
+import java.util.concurrent.atomic.AtomicInteger;
+
+import jakarta.enterprise.inject.Produces;
+import jakarta.inject.Named;
+import jakarta.inject.Singleton;
+
+public class SchedulerProducers {
+
+    @Produces
+    @Singleton
+    @Named("schedulerCounter")
+    AtomicInteger schedulerCounter() {
+        return new AtomicInteger();
+    }
+
+    @Produces
+    @Singleton
+    @Named("withDelayRepeatCounter")
+    AtomicInteger withDelayRepeatCounter() {
+        return new AtomicInteger();
+    }
+
+    @Produces
+    @Singleton
+    @Named("withDelayCounter")
+    AtomicInteger withDelayCounter() {
+        return new AtomicInteger();
+    }
+
+    @Produces
+    @Singleton
+    @Named("useFixedDelayCounter")
+    AtomicInteger useFixedDelayCounter() {
+        return new AtomicInteger();
+    }
+
+    @Produces
+    @Singleton
+    @Named("greedyCounter")
+    AtomicInteger greedyCounter() {
+        return new AtomicInteger();
+    }
+}
diff --git 
a/integration-test-groups/foundation/scheduler/src/main/java/org/apache/camel/quarkus/component/scheduler/it/SchedulerResource.java
 
b/integration-test-groups/foundation/scheduler/src/main/java/org/apache/camel/quarkus/component/scheduler/it/SchedulerResource.java
index b33c5b9091..94c692afa0 100644
--- 
a/integration-test-groups/foundation/scheduler/src/main/java/org/apache/camel/quarkus/component/scheduler/it/SchedulerResource.java
+++ 
b/integration-test-groups/foundation/scheduler/src/main/java/org/apache/camel/quarkus/component/scheduler/it/SchedulerResource.java
@@ -90,41 +90,6 @@ public class SchedulerResource {
         return greedyCounter.get();
     }
 
-    @jakarta.enterprise.inject.Produces
-    @ApplicationScoped
-    @Named("schedulerCounter")
-    AtomicInteger schedulerCounter() {
-        return new AtomicInteger();
-    }
-
-    @jakarta.enterprise.inject.Produces
-    @ApplicationScoped
-    @Named("withDelayRepeatCounter")
-    AtomicInteger withDelayRepeatCounter() {
-        return new AtomicInteger();
-    }
-
-    @jakarta.enterprise.inject.Produces
-    @ApplicationScoped
-    @Named("withDelayCounter")
-    AtomicInteger withDelayCounter() {
-        return new AtomicInteger();
-    }
-
-    @jakarta.enterprise.inject.Produces
-    @ApplicationScoped
-    @Named("useFixedDelayCounter")
-    AtomicInteger useFixedDelayCounter() {
-        return new AtomicInteger();
-    }
-
-    @jakarta.enterprise.inject.Produces
-    @ApplicationScoped
-    @Named("greedyCounter")
-    AtomicInteger greedyCounter() {
-        return new AtomicInteger();
-    }
-
     @POST
     @Path("route/{route}/{enable}")
     public void mangeRoutes(@PathParam("route") String route, 
@PathParam("enable") boolean enable) throws Exception {
diff --git 
a/integration-tests-support/kafka/src/main/java/org/apache/camel/quarkus/test/support/kafka/KafkaProducers.java
 
b/integration-tests-support/kafka/src/main/java/org/apache/camel/quarkus/test/support/kafka/KafkaProducers.java
index a8c4463635..97af7069e4 100644
--- 
a/integration-tests-support/kafka/src/main/java/org/apache/camel/quarkus/test/support/kafka/KafkaProducers.java
+++ 
b/integration-tests-support/kafka/src/main/java/org/apache/camel/quarkus/test/support/kafka/KafkaProducers.java
@@ -18,8 +18,8 @@ package org.apache.camel.quarkus.test.support.kafka;
 
 import java.util.Properties;
 
-import jakarta.enterprise.context.ApplicationScoped;
 import jakarta.inject.Named;
+import jakarta.inject.Singleton;
 import org.apache.kafka.clients.CommonClientConfigs;
 import org.apache.kafka.clients.consumer.ConsumerConfig;
 import org.apache.kafka.clients.producer.ProducerConfig;
@@ -30,7 +30,7 @@ import org.apache.kafka.common.serialization.StringSerializer;
 
 public class KafkaProducers {
 
-    @ApplicationScoped
+    @Singleton
     @Named("kafka-consumer-properties")
     public Properties kafkaConsumerProperties() {
         Properties props = createBaseConfiguration();
@@ -41,7 +41,7 @@ public class KafkaProducers {
         return props;
     }
 
-    @ApplicationScoped
+    @Singleton
     @Named("kafka-producer-properties")
     public Properties kafkaProducerProperties() {
         Properties props = createBaseConfiguration();

Reply via email to