You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tomee.apache.org by ra...@apache.org on 2019/01/04 13:30:54 UTC

[tomee] 05/12: collection improvements

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 6ac5a5dcd6a32aabeaeda6d266ea83b5971f5bd7
Author: ivanjunckes <ij...@tomitribe.com>
AuthorDate: Thu Jan 3 11:22:27 2019 -0200

    collection improvements
---
 .../jwt/jaxrs/MPJWTSecurityAnnotationsInterceptorsFeature.java    | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/mp-jwt/src/main/java/org/apache/tomee/microprofile/jwt/jaxrs/MPJWTSecurityAnnotationsInterceptorsFeature.java b/mp-jwt/src/main/java/org/apache/tomee/microprofile/jwt/jaxrs/MPJWTSecurityAnnotationsInterceptorsFeature.java
index 58b3203..9267473 100644
--- a/mp-jwt/src/main/java/org/apache/tomee/microprofile/jwt/jaxrs/MPJWTSecurityAnnotationsInterceptorsFeature.java
+++ b/mp-jwt/src/main/java/org/apache/tomee/microprofile/jwt/jaxrs/MPJWTSecurityAnnotationsInterceptorsFeature.java
@@ -59,7 +59,7 @@ public class MPJWTSecurityAnnotationsInterceptorsFeature implements DynamicFeatu
         final List<Class<? extends Annotation>[]> methodSecurityAnnotations = hasMethodLevelAnnotations(method,
                 RolesAllowed.class, PermitAll.class, DenyAll.class);
 
-        if (classSecurityAnnotations.size() == 0 && methodSecurityAnnotations.size() == 0) {
+        if (classSecurityAnnotations.isEmpty() && methodSecurityAnnotations.isEmpty()) {
             return false; // nothing to do
         }
 
@@ -74,13 +74,13 @@ public class MPJWTSecurityAnnotationsInterceptorsFeature implements DynamicFeatu
             throw new IllegalStateException(method.toString() + " has more than one security annotation (RolesAllowed, PermitAll, DenyAll).");
         }
 
-        if (methodSecurityAnnotations.size() == 0) { // no need to deal with class level annotations if the method has some
+        if (methodSecurityAnnotations.isEmpty()) { // no need to deal with class level annotations if the method has some
             final RolesAllowed classRolesAllowed = (RolesAllowed) clazz.getAnnotation(RolesAllowed.class);
             final PermitAll classPermitAll = (PermitAll) clazz.getAnnotation(PermitAll.class);
             final DenyAll classDenyAll = (DenyAll) clazz.getAnnotation(DenyAll.class);
 
             if (classRolesAllowed != null) {
-                Set<String> roles = new HashSet<String>();
+                Set<String> roles = new HashSet<>();
                 final Set<String> previous = rolesAllowed.putIfAbsent(method, roles);
                 if (previous != null) {
                     roles = previous;
@@ -102,7 +102,7 @@ public class MPJWTSecurityAnnotationsInterceptorsFeature implements DynamicFeatu
         final DenyAll mthdDenyAll = method.getAnnotation(DenyAll.class);
 
         if (mthdRolesAllowed != null) {
-            Set<String> roles = new HashSet<String>();
+            Set<String> roles = new HashSet<>();
             final Set<String> previous = rolesAllowed.putIfAbsent(method, roles);
             if (previous != null) {
                 roles = previous;