tomee-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From radcor...@apache.org
Subject [tomee] 03/12: use lambdas
Date Fri, 04 Jan 2019 13:30:52 GMT
This is an automated email from the ASF dual-hosted git repository.

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

commit 1dc3fb71e8ab1582ac48439b5f5533a3143d58e4
Author: ivanjunckes <ijunckes@tomitribe.com>
AuthorDate: Thu Jan 3 11:15:47 2019 -0200

    use lambdas
---
 .../tomee/microprofile/jwt/cdi/ClaimBean.java      | 37 +++++++---------------
 1 file changed, 12 insertions(+), 25 deletions(-)

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 1f5e2ed..1b895bd 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
@@ -23,7 +23,6 @@ import org.eclipse.microprofile.jwt.Claims;
 import org.eclipse.microprofile.jwt.JsonWebToken;
 
 import javax.enterprise.context.Dependent;
-import javax.enterprise.context.RequestScoped;
 import javax.enterprise.context.spi.CreationalContext;
 import javax.enterprise.inject.Instance;
 import javax.enterprise.inject.Vetoed;
@@ -196,39 +195,27 @@ public class ClaimBean<T> implements Bean<T>, PassivationCapable
{
 
                     final ClaimValueWrapper claimValueWrapper = new ClaimValueWrapper(key);
                     if (ParameterizedType.class.isInstance(claimValueType) && isOptional(ParameterizedType.class.cast(claimValueType)))
{
-                        claimValueWrapper.setValue(new Supplier() {
-                            @Override
-                            public Object get() {
-                                final T claimValue = ClaimBean.this.getClaimValue(key);
-                                return Optional.ofNullable(claimValue);
-                            }
+                        claimValueWrapper.setValue(() -> {
+                            final T claimValue = ClaimBean.this.getClaimValue(key);
+                            return Optional.ofNullable(claimValue);
                         });
 
                     } else if (ParameterizedType.class.isInstance(claimValueType) &&
isSet(ParameterizedType.class.cast(claimValueType))) {
-                        claimValueWrapper.setValue(new Supplier() {
-                            @Override
-                            public Object get() {
-                                final T claimValue = ClaimBean.this.getClaimValue(key);
-                                return claimValue;
-                            }
+                        claimValueWrapper.setValue(() -> {
+                            final T claimValue = ClaimBean.this.getClaimValue(key);
+                            return claimValue;
                         });
 
                     } else if (ParameterizedType.class.isInstance(claimValueType) &&
isList(ParameterizedType.class.cast(claimValueType))) {
-                        claimValueWrapper.setValue(new Supplier() {
-                            @Override
-                            public Object get() {
-                                final T claimValue = ClaimBean.this.getClaimValue(key);
-                                return claimValue;
-                            }
+                        claimValueWrapper.setValue(() -> {
+                            final T claimValue = ClaimBean.this.getClaimValue(key);
+                            return claimValue;
                         });
 
                     } else if (Class.class.isInstance(claimValueType)) {
-                        claimValueWrapper.setValue(new Supplier() {
-                            @Override
-                            public Object get() {
-                                final T claimValue = ClaimBean.this.getClaimValue(key);
-                                return claimValue;
-                            }
+                        claimValueWrapper.setValue(() -> {
+                            final T claimValue = ClaimBean.this.getClaimValue(key);
+                            return claimValue;
                         });
 
                     } else {


Mime
View raw message