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

rzo1 pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tomee.git

commit 8d6f46fefcb6a4fb47070f736fe27019c454acfc
Author: Markus Jung <[email protected]>
AuthorDate: Wed Jun 5 16:37:05 2024 +0200

    TOMEE-4350 add qualifier for produced Jsonb
---
 .../org/apache/tomee/microprofile/jwt/cdi/ClaimBean.java   |  1 +
 .../apache/tomee/microprofile/jwt/cdi/JsonbProducer.java   |  2 +-
 .../org/apache/tomee/microprofile/jwt/cdi/TomeeMpJwt.java  | 14 ++++++++++++++
 3 files changed, 16 insertions(+), 1 deletion(-)

diff --git 
a/mp-jwt/src/main/java/org/apache/tomee/microprofile/jwt/cdi/ClaimBean.java 
b/mp-jwt/src/main/java/org/apache/tomee/microprofile/jwt/cdi/ClaimBean.java
index 5ff9daa994..aa826135df 100644
--- a/mp-jwt/src/main/java/org/apache/tomee/microprofile/jwt/cdi/ClaimBean.java
+++ b/mp-jwt/src/main/java/org/apache/tomee/microprofile/jwt/cdi/ClaimBean.java
@@ -67,6 +67,7 @@ public class ClaimBean<T> implements Bean<T>, 
PassivationCapable {
     }
 
     @Inject
+    @TomeeMpJwt
     private Jsonb jsonb;
 
     private final BeanManager bm;
diff --git 
a/mp-jwt/src/main/java/org/apache/tomee/microprofile/jwt/cdi/JsonbProducer.java 
b/mp-jwt/src/main/java/org/apache/tomee/microprofile/jwt/cdi/JsonbProducer.java
index fc16202c59..c905b4fc6a 100644
--- 
a/mp-jwt/src/main/java/org/apache/tomee/microprofile/jwt/cdi/JsonbProducer.java
+++ 
b/mp-jwt/src/main/java/org/apache/tomee/microprofile/jwt/cdi/JsonbProducer.java
@@ -25,12 +25,12 @@ import java.util.logging.Level;
 import java.util.logging.Logger;
 
 @ApplicationScoped
-// todo add a qualifier here so we isolate our instance from what applications 
would do
 public class JsonbProducer {
 
     private static final Logger log = 
Logger.getLogger(MPJWTCDIExtension.class.getName());
 
     @Produces
+    @TomeeMpJwt
     public Jsonb create() {
         return JsonbProvider.provider().create().build();
     }
diff --git 
a/mp-jwt/src/main/java/org/apache/tomee/microprofile/jwt/cdi/TomeeMpJwt.java 
b/mp-jwt/src/main/java/org/apache/tomee/microprofile/jwt/cdi/TomeeMpJwt.java
new file mode 100644
index 0000000000..9eb42dbe4f
--- /dev/null
+++ b/mp-jwt/src/main/java/org/apache/tomee/microprofile/jwt/cdi/TomeeMpJwt.java
@@ -0,0 +1,14 @@
+package org.apache.tomee.microprofile.jwt.cdi;
+
+import jakarta.inject.Qualifier;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+@Qualifier
+@Retention(RetentionPolicy.RUNTIME)
+@Target({ ElementType.PARAMETER, ElementType.FIELD, ElementType.METHOD })
+public @interface TomeeMpJwt {
+}

Reply via email to