You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tomee.apache.org by jl...@apache.org on 2018/08/03 19:57:12 UTC

[1/2] tomee git commit: adding enum conversion

Repository: tomee
Updated Branches:
  refs/heads/master bf929780a -> 8ae2401b8


adding enum conversion


Project: http://git-wip-us.apache.org/repos/asf/tomee/repo
Commit: http://git-wip-us.apache.org/repos/asf/tomee/commit/87ea7cca
Tree: http://git-wip-us.apache.org/repos/asf/tomee/tree/87ea7cca
Diff: http://git-wip-us.apache.org/repos/asf/tomee/diff/87ea7cca

Branch: refs/heads/master
Commit: 87ea7cca88f1c0b05a8e110900bffce1e6f6b4c5
Parents: bf92978
Author: ivanjunckes <ij...@tomitribe.com>
Authored: Thu Aug 2 11:55:26 2018 -0300
Committer: ivanjunckes <ij...@tomitribe.com>
Committed: Fri Aug 3 15:34:55 2018 -0300

----------------------------------------------------------------------
 .../java/org/apache/tomee/microprofile/jwt/cdi/ClaimBean.java   | 5 +++++
 1 file changed, 5 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tomee/blob/87ea7cca/mp-jwt/src/main/java/org/apache/tomee/microprofile/jwt/cdi/ClaimBean.java
----------------------------------------------------------------------
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 be83a9b..f36405b 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
@@ -256,6 +256,11 @@ public class ClaimBean<T> implements Bean<T>, PassivationCapable {
             // handle JsonValue<T> (number, string, etc)
             return (T) toJson(key);
 
+        } else if (((Class<?>) ip.getType()).isEnum()) {
+            try {
+                return (T) ((Class<?>) ip.getType()).getMethod("valueOf", String.class).invoke(null, getClaimValue(key).toString());
+            } catch (Exception e) {
+            }
         } else {
             // handle Raw types
             return getClaimValue(key);


[2/2] tomee git commit: This closes pull request #143. Thanks Ivan for the contribution

Posted by jl...@apache.org.
This closes pull request #143. Thanks Ivan for the contribution


Project: http://git-wip-us.apache.org/repos/asf/tomee/repo
Commit: http://git-wip-us.apache.org/repos/asf/tomee/commit/8ae2401b
Tree: http://git-wip-us.apache.org/repos/asf/tomee/tree/8ae2401b
Diff: http://git-wip-us.apache.org/repos/asf/tomee/diff/8ae2401b

Branch: refs/heads/master
Commit: 8ae2401b8764154d8ec98e1565f88d1335b05ee0
Parents: 87ea7cc
Author: Jean-Louis Monteiro <je...@gmail.com>
Authored: Fri Aug 3 21:56:46 2018 +0200
Committer: Jean-Louis Monteiro <je...@gmail.com>
Committed: Fri Aug 3 21:56:46 2018 +0200

----------------------------------------------------------------------

----------------------------------------------------------------------