cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject cxf-fediz git commit: Using isEmpty instead of size()
Date Mon, 13 Feb 2017 13:01:46 GMT
Repository: cxf-fediz
Updated Branches:
  refs/heads/master 2ca318630 -> d18087dd4


Using isEmpty instead of size()


Project: http://git-wip-us.apache.org/repos/asf/cxf-fediz/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf-fediz/commit/d18087dd
Tree: http://git-wip-us.apache.org/repos/asf/cxf-fediz/tree/d18087dd
Diff: http://git-wip-us.apache.org/repos/asf/cxf-fediz/diff/d18087dd

Branch: refs/heads/master
Commit: d18087dd4081d932d57c8677880059d1c3472690
Parents: 2ca3186
Author: Colm O hEigeartaigh <coheigea@apache.org>
Authored: Mon Feb 13 12:47:45 2017 +0000
Committer: Colm O hEigeartaigh <coheigea@apache.org>
Committed: Mon Feb 13 12:47:45 2017 +0000

----------------------------------------------------------------------
 .../apache/cxf/fediz/core/metadata/MetadataWriter.java    |  2 +-
 .../cxf/fediz/core/processor/FederationProcessorImpl.java |  4 ++--
 .../java/org/apache/cxf/fediz/core/util/StringUtils.java  |  2 +-
 .../cxf/fediz/core/federation/TestSigninHandler.java      |  2 +-
 .../cxf/fediz/cxf/plugin/FedizRedirectBindingFilter.java  |  2 +-
 .../apache/cxf/fediz/jetty8/FederationLoginService.java   |  2 +-
 .../apache/cxf/fediz/jetty9/FederationLoginService.java   |  2 +-
 .../cxf/fediz/tomcat7/handler/TomcatSigninHandler.java    |  2 +-
 .../cxf/fediz/tomcat8/handler/TomcatSigninHandler.java    |  2 +-
 .../cxf/fediz/was/mapper/FileBasedRoleToGroupMapper.java  |  2 +-
 .../cxf/fediz/service/idp/beans/STSClientAction.java      |  6 +++---
 .../cxf/fediz/service/idp/metadata/IdpMetadataWriter.java |  2 +-
 .../fediz/service/idp/rest/ApplicationServiceImpl.java    |  6 +++---
 .../apache/cxf/fediz/service/idp/rest/IdpServiceImpl.java | 10 +++++-----
 .../cxf/fediz/service/idp/rest/RoleServiceImpl.java       |  6 +++---
 .../apache/cxf/fediz/service/sts/FileClaimsHandler.java   |  6 +++---
 .../service/sts/UsernamePasswordCallbackHandler.java      |  2 +-
 .../fediz/service/sts/realms/RealmFileClaimsHandler.java  |  6 +++---
 .../java/org/apache/cxf/fediz/sts/AbstractSTSTest.java    |  4 ++--
 .../custom/src/test/java/custom/CustomClaimsHandler.java  |  6 +++---
 20 files changed, 38 insertions(+), 38 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/d18087dd/plugins/core/src/main/java/org/apache/cxf/fediz/core/metadata/MetadataWriter.java
----------------------------------------------------------------------
diff --git a/plugins/core/src/main/java/org/apache/cxf/fediz/core/metadata/MetadataWriter.java
b/plugins/core/src/main/java/org/apache/cxf/fediz/core/metadata/MetadataWriter.java
index 0cb71f5..f5b2e77 100644
--- a/plugins/core/src/main/java/org/apache/cxf/fediz/core/metadata/MetadataWriter.java
+++ b/plugins/core/src/main/java/org/apache/cxf/fediz/core/metadata/MetadataWriter.java
@@ -180,7 +180,7 @@ public class MetadataWriter {
 
         FederationProtocol protocol = (FederationProtocol)config.getProtocol();
         List<Claim> claims = protocol.getClaimTypesRequested();
-        if (claims != null && claims.size() > 0) {
+        if (claims != null && !claims.isEmpty()) {
 
             // create ClaimsType section
             writer.writeStartElement("fed", "ClaimTypesRequested", WS_FEDERATION_NS);

http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/d18087dd/plugins/core/src/main/java/org/apache/cxf/fediz/core/processor/FederationProcessorImpl.java
----------------------------------------------------------------------
diff --git a/plugins/core/src/main/java/org/apache/cxf/fediz/core/processor/FederationProcessorImpl.java
b/plugins/core/src/main/java/org/apache/cxf/fediz/core/processor/FederationProcessorImpl.java
index cc03440..9e72080 100644
--- a/plugins/core/src/main/java/org/apache/cxf/fediz/core/processor/FederationProcessorImpl.java
+++ b/plugins/core/src/main/java/org/apache/cxf/fediz/core/processor/FederationProcessorImpl.java
@@ -284,11 +284,11 @@ public class FederationProcessorImpl extends AbstractFedizProcessor
{
         data.setCallbackHandler(new DecryptionCallbackHandler(keyPassword));
         try {
             List<WSSecurityEngineResult> result = proc.handleToken(encryptedRST, data,
docInfo);
-            if (result.size() > 0) {
+            if (!result.isEmpty()) {
                 @SuppressWarnings("unchecked")
                 List<WSDataRef> dataRefs = (List<WSDataRef>)result.get(result.size()
- 1)
                     .get(WSSecurityEngineResult.TAG_DATA_REF_URIS);
-                if (dataRefs != null && dataRefs.size() > 0) {
+                if (dataRefs != null && !dataRefs.isEmpty()) {
                     return dataRefs.get(0).getProtectedElement();
                 }
             }

http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/d18087dd/plugins/core/src/main/java/org/apache/cxf/fediz/core/util/StringUtils.java
----------------------------------------------------------------------
diff --git a/plugins/core/src/main/java/org/apache/cxf/fediz/core/util/StringUtils.java b/plugins/core/src/main/java/org/apache/cxf/fediz/core/util/StringUtils.java
index f23ee74..62d9e88 100644
--- a/plugins/core/src/main/java/org/apache/cxf/fediz/core/util/StringUtils.java
+++ b/plugins/core/src/main/java/org/apache/cxf/fediz/core/util/StringUtils.java
@@ -86,7 +86,7 @@ public final class StringUtils {
     }
 
     public static boolean isEmpty(List<String> list) {
-        if (list == null || list.size() == 0) {
+        if (list == null || list.isEmpty()) {
             return true;
         }
         return list.size() == 1 && isEmpty(list.get(0));

http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/d18087dd/plugins/core/src/test/java/org/apache/cxf/fediz/core/federation/TestSigninHandler.java
----------------------------------------------------------------------
diff --git a/plugins/core/src/test/java/org/apache/cxf/fediz/core/federation/TestSigninHandler.java
b/plugins/core/src/test/java/org/apache/cxf/fediz/core/federation/TestSigninHandler.java
index b4ced24..b7a5802 100644
--- a/plugins/core/src/test/java/org/apache/cxf/fediz/core/federation/TestSigninHandler.java
+++ b/plugins/core/src/test/java/org/apache/cxf/fediz/core/federation/TestSigninHandler.java
@@ -46,7 +46,7 @@ public class TestSigninHandler extends SigninHandler<FedizPrincipal>
{
         FedizResponse wfRes) {
 
         List<String> roles = wfRes.getRoles();
-        if (roles == null || roles.size() == 0) {
+        if (roles == null || roles.isEmpty()) {
             roles = Collections.singletonList("Authenticated");
         }
 

http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/d18087dd/plugins/cxf/src/main/java/org/apache/cxf/fediz/cxf/plugin/FedizRedirectBindingFilter.java
----------------------------------------------------------------------
diff --git a/plugins/cxf/src/main/java/org/apache/cxf/fediz/cxf/plugin/FedizRedirectBindingFilter.java
b/plugins/cxf/src/main/java/org/apache/cxf/fediz/cxf/plugin/FedizRedirectBindingFilter.java
index 5566c52..948ce8e 100644
--- a/plugins/cxf/src/main/java/org/apache/cxf/fediz/cxf/plugin/FedizRedirectBindingFilter.java
+++ b/plugins/cxf/src/main/java/org/apache/cxf/fediz/cxf/plugin/FedizRedirectBindingFilter.java
@@ -161,7 +161,7 @@ public class FedizRedirectBindingFilter extends AbstractServiceProviderFilter
             String token = DOM2Writer.nodeToString(wfRes.getToken());
             // Add "Authenticated" role
             List<String> roles = wfRes.getRoles();
-            if (roles == null || roles.size() == 0) {
+            if (roles == null || roles.isEmpty()) {
                 roles = Collections.singletonList("Authenticated");
             } else if (fedConfig.isAddAuthenticatedRole()) {
                 roles = new ArrayList<>(roles);

http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/d18087dd/plugins/jetty8/src/main/java/org/apache/cxf/fediz/jetty8/FederationLoginService.java
----------------------------------------------------------------------
diff --git a/plugins/jetty8/src/main/java/org/apache/cxf/fediz/jetty8/FederationLoginService.java
b/plugins/jetty8/src/main/java/org/apache/cxf/fediz/jetty8/FederationLoginService.java
index 9dfc105..353d946 100644
--- a/plugins/jetty8/src/main/java/org/apache/cxf/fediz/jetty8/FederationLoginService.java
+++ b/plugins/jetty8/src/main/java/org/apache/cxf/fediz/jetty8/FederationLoginService.java
@@ -117,7 +117,7 @@ public class FederationLoginService extends AbstractLifeCycle implements
LoginSe
 
             // Add "Authenticated" role
             List<String> roles = wfRes.getRoles();
-            if (roles == null || roles.size() == 0) {
+            if (roles == null || roles.isEmpty()) {
                 roles = Collections.singletonList("Authenticated");
             } else if (config.isAddAuthenticatedRole()) {
                 roles = new ArrayList<>(roles);

http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/d18087dd/plugins/jetty9/src/main/java/org/apache/cxf/fediz/jetty9/FederationLoginService.java
----------------------------------------------------------------------
diff --git a/plugins/jetty9/src/main/java/org/apache/cxf/fediz/jetty9/FederationLoginService.java
b/plugins/jetty9/src/main/java/org/apache/cxf/fediz/jetty9/FederationLoginService.java
index 6e666bd..79f333a 100644
--- a/plugins/jetty9/src/main/java/org/apache/cxf/fediz/jetty9/FederationLoginService.java
+++ b/plugins/jetty9/src/main/java/org/apache/cxf/fediz/jetty9/FederationLoginService.java
@@ -118,7 +118,7 @@ public class FederationLoginService extends AbstractLifeCycle implements
LoginSe
 
             // Add "Authenticated" role
             List<String> roles = wfRes.getRoles();
-            if (roles == null || roles.size() == 0) {
+            if (roles == null || roles.isEmpty()) {
                 roles = Collections.singletonList("Authenticated");
             } else if (config.isAddAuthenticatedRole()) {
                 roles = new ArrayList<>(roles);

http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/d18087dd/plugins/tomcat7/src/main/java/org/apache/cxf/fediz/tomcat7/handler/TomcatSigninHandler.java
----------------------------------------------------------------------
diff --git a/plugins/tomcat7/src/main/java/org/apache/cxf/fediz/tomcat7/handler/TomcatSigninHandler.java
b/plugins/tomcat7/src/main/java/org/apache/cxf/fediz/tomcat7/handler/TomcatSigninHandler.java
index 56fd6b8..b073624 100644
--- a/plugins/tomcat7/src/main/java/org/apache/cxf/fediz/tomcat7/handler/TomcatSigninHandler.java
+++ b/plugins/tomcat7/src/main/java/org/apache/cxf/fediz/tomcat7/handler/TomcatSigninHandler.java
@@ -52,7 +52,7 @@ public class TomcatSigninHandler extends SigninHandler<FedizPrincipal>
{
         FedizResponse wfRes) {
         // Add "Authenticated" role
         List<String> roles = wfRes.getRoles();
-        if (roles == null || roles.size() == 0) {
+        if (roles == null || roles.isEmpty()) {
             roles = Collections.singletonList("Authenticated");
         } else if (getFedizContext().isAddAuthenticatedRole()) {
             roles = new ArrayList<>(roles);

http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/d18087dd/plugins/tomcat8/src/main/java/org/apache/cxf/fediz/tomcat8/handler/TomcatSigninHandler.java
----------------------------------------------------------------------
diff --git a/plugins/tomcat8/src/main/java/org/apache/cxf/fediz/tomcat8/handler/TomcatSigninHandler.java
b/plugins/tomcat8/src/main/java/org/apache/cxf/fediz/tomcat8/handler/TomcatSigninHandler.java
index 66239ce..b9b9101 100644
--- a/plugins/tomcat8/src/main/java/org/apache/cxf/fediz/tomcat8/handler/TomcatSigninHandler.java
+++ b/plugins/tomcat8/src/main/java/org/apache/cxf/fediz/tomcat8/handler/TomcatSigninHandler.java
@@ -53,7 +53,7 @@ public class TomcatSigninHandler extends SigninHandler<FedizPrincipal>
{
 
         // Add "Authenticated" role
         List<String> roles = wfRes.getRoles();
-        if (roles == null || roles.size() == 0) {
+        if (roles == null || roles.isEmpty()) {
             roles = Collections.singletonList("Authenticated");
         } else if (getFedizContext().isAddAuthenticatedRole()) {
             roles = new ArrayList<>(roles);

http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/d18087dd/plugins/websphere/src/main/java/org/apache/cxf/fediz/was/mapper/FileBasedRoleToGroupMapper.java
----------------------------------------------------------------------
diff --git a/plugins/websphere/src/main/java/org/apache/cxf/fediz/was/mapper/FileBasedRoleToGroupMapper.java
b/plugins/websphere/src/main/java/org/apache/cxf/fediz/was/mapper/FileBasedRoleToGroupMapper.java
index 3374853..21edde5 100644
--- a/plugins/websphere/src/main/java/org/apache/cxf/fediz/was/mapper/FileBasedRoleToGroupMapper.java
+++ b/plugins/websphere/src/main/java/org/apache/cxf/fediz/was/mapper/FileBasedRoleToGroupMapper.java
@@ -140,7 +140,7 @@ public class FileBasedRoleToGroupMapper implements RoleToGroupMapper {
                     throw new FileNotFoundException(groupMappingFilename);
                 }
                 boolean update = false;
-                if (mappings.size() == 0) {
+                if (mappings.isEmpty()) {
                     mappingFileLastModificationDate = mappingFile.lastModified();
                     update = true;
                 } else {

http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/d18087dd/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/beans/STSClientAction.java
----------------------------------------------------------------------
diff --git a/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/beans/STSClientAction.java
b/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/beans/STSClientAction.java
index 5984fa4..88e2e69 100644
--- a/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/beans/STSClientAction.java
+++ b/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/beans/STSClientAction.java
@@ -271,7 +271,7 @@ public class STSClientAction {
             sts.setNamespace(HTTP_SCHEMAS_XMLSOAP_ORG_WS_2005_02_TRUST);
         }
 
-        if (serviceConfig.getRequestedClaims() != null && serviceConfig.getRequestedClaims().size()
> 0) {
+        if (serviceConfig.getRequestedClaims() != null && !serviceConfig.getRequestedClaims().isEmpty())
{
             addClaims(sts, serviceConfig.getRequestedClaims());
             LOG.debug("Requested claims set for {}", realm);
         }
@@ -377,7 +377,7 @@ public class STSClientAction {
 
     private Element createClaimsElement(List<RequestClaim> realmClaims)
         throws ParserConfigurationException, XMLStreamException {
-        if (realmClaims == null || realmClaims.size() == 0) {
+        if (realmClaims == null || realmClaims.isEmpty()) {
             return null;
         }
 
@@ -389,7 +389,7 @@ public class STSClientAction {
         writer.writeAttribute("Dialect",
                 HTTP_SCHEMAS_XMLSOAP_ORG_WS_2005_05_IDENTITY);
 
-        if (realmClaims.size() > 0) {
+        if (!realmClaims.isEmpty()) {
             for (RequestClaim item : realmClaims) {
                 LOG.debug("  {}", item.getClaimType().toString());
                 writer.writeStartElement("ic", "ClaimType",

http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/d18087dd/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/metadata/IdpMetadataWriter.java
----------------------------------------------------------------------
diff --git a/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/metadata/IdpMetadataWriter.java
b/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/metadata/IdpMetadataWriter.java
index d3f59d8..97bcfcb 100644
--- a/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/metadata/IdpMetadataWriter.java
+++ b/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/metadata/IdpMetadataWriter.java
@@ -160,7 +160,7 @@ public class IdpMetadataWriter {
 
 
         // create ClaimsType section
-        if (config.getClaimTypesOffered() != null && config.getClaimTypesOffered().size()
> 0) {
+        if (config.getClaimTypesOffered() != null && !config.getClaimTypesOffered().isEmpty())
{
             writer.writeStartElement("fed", "ClaimTypesOffered", WS_FEDERATION_NS);
             for (Claim claim : config.getClaimTypesOffered()) {
 

http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/d18087dd/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/rest/ApplicationServiceImpl.java
----------------------------------------------------------------------
diff --git a/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/rest/ApplicationServiceImpl.java
b/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/rest/ApplicationServiceImpl.java
index 8861744..1cd2cae 100644
--- a/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/rest/ApplicationServiceImpl.java
+++ b/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/rest/ApplicationServiceImpl.java
@@ -79,7 +79,7 @@ public class ApplicationServiceImpl implements ApplicationService {
     @Override
     public Response addApplication(UriInfo ui, Application application) {
         LOG.info("add Service config");
-        if (application.getRequestedClaims() != null && application.getRequestedClaims().size()
> 0) {
+        if (application.getRequestedClaims() != null && !application.getRequestedClaims().isEmpty())
{
             LOG.warn("Application resource contains sub resource 'claims'");
             throw new WebApplicationException(Status.BAD_REQUEST);
         }
@@ -96,7 +96,7 @@ public class ApplicationServiceImpl implements ApplicationService {
         if (!realm.equals(application.getRealm().toString())) {
             throw new BadRequestException();
         }
-        if (application.getRequestedClaims() != null && application.getRequestedClaims().size()
> 0) {
+        if (application.getRequestedClaims() != null && !application.getRequestedClaims().isEmpty())
{
             LOG.warn("Application resource contains sub resource 'claims'");
             throw new WebApplicationException(Status.BAD_REQUEST);
         }
@@ -148,4 +148,4 @@ public class ApplicationServiceImpl implements ApplicationService {
 
         return Response.noContent().build();
     }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/d18087dd/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/rest/IdpServiceImpl.java
----------------------------------------------------------------------
diff --git a/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/rest/IdpServiceImpl.java
b/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/rest/IdpServiceImpl.java
index 61dac14..c96d716 100644
--- a/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/rest/IdpServiceImpl.java
+++ b/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/rest/IdpServiceImpl.java
@@ -85,11 +85,11 @@ public class IdpServiceImpl implements IdpService {
     @Override
     public Response addIdp(UriInfo ui, Idp idp) {
         LOG.info("add IDP config");
-        if (idp.getApplications() != null && idp.getApplications().size() > 0)
{
+        if (idp.getApplications() != null && !idp.getApplications().isEmpty()) {
             LOG.warn("IDP resource contains sub resource 'applications'");
             throw new WebApplicationException(Status.BAD_REQUEST);
         }
-        if (idp.getTrustedIdps() != null && idp.getTrustedIdps().size() > 0) {
+        if (idp.getTrustedIdps() != null && !idp.getTrustedIdps().isEmpty()) {
             LOG.warn("IDP resource contains sub resource 'trusted-idps'");
             throw new WebApplicationException(Status.BAD_REQUEST);
         }
@@ -106,11 +106,11 @@ public class IdpServiceImpl implements IdpService {
         if (!realm.equals(idp.getRealm().toString())) {
             throw new BadRequestException();
         }
-        if (idp.getApplications() != null && idp.getApplications().size() > 0)
{
+        if (idp.getApplications() != null && !idp.getApplications().isEmpty()) {
             LOG.warn("IDP resource contains sub resource 'applications'");
             throw new WebApplicationException(Status.BAD_REQUEST);
         }
-        if (idp.getTrustedIdps() != null && idp.getTrustedIdps().size() > 0) {
+        if (idp.getTrustedIdps() != null && !idp.getTrustedIdps().isEmpty()) {
             LOG.warn("IDP resource contains sub resource 'trusted-idps'");
             throw new WebApplicationException(Status.BAD_REQUEST);
         }
@@ -237,4 +237,4 @@ public class IdpServiceImpl implements IdpService {
     }
 
 
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/d18087dd/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/rest/RoleServiceImpl.java
----------------------------------------------------------------------
diff --git a/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/rest/RoleServiceImpl.java
b/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/rest/RoleServiceImpl.java
index 58df748..d5227f0 100644
--- a/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/rest/RoleServiceImpl.java
+++ b/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/rest/RoleServiceImpl.java
@@ -72,7 +72,7 @@ public class RoleServiceImpl implements RoleService {
 
     @Override
     public Response addRole(UriInfo ui, Role role) {
-        if (role.getEntitlements() != null && role.getEntitlements().size() >
0) {
+        if (role.getEntitlements() != null && !role.getEntitlements().isEmpty())
{
             LOG.warn("Role resource contains sub resource 'entitlements'");
             throw new WebApplicationException(Status.BAD_REQUEST);
         }
@@ -91,7 +91,7 @@ public class RoleServiceImpl implements RoleService {
         if (!name.equals(role.getName().toString())) {
             throw new BadRequestException();
         }
-        if (role.getEntitlements() != null && role.getEntitlements().size() >
0) {
+        if (role.getEntitlements() != null && !role.getEntitlements().isEmpty())
{
             LOG.warn("Role resource contains sub resource 'entitlements'");
             throw new WebApplicationException(Status.BAD_REQUEST);
         }
@@ -131,4 +131,4 @@ public class RoleServiceImpl implements RoleService {
         return Response.noContent().build();
     }
 
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/d18087dd/services/sts/src/main/java/org/apache/cxf/fediz/service/sts/FileClaimsHandler.java
----------------------------------------------------------------------
diff --git a/services/sts/src/main/java/org/apache/cxf/fediz/service/sts/FileClaimsHandler.java
b/services/sts/src/main/java/org/apache/cxf/fediz/service/sts/FileClaimsHandler.java
index dcdb072..e77167f 100644
--- a/services/sts/src/main/java/org/apache/cxf/fediz/service/sts/FileClaimsHandler.java
+++ b/services/sts/src/main/java/org/apache/cxf/fediz/service/sts/FileClaimsHandler.java
@@ -67,16 +67,16 @@ public class FileClaimsHandler implements ClaimsHandler {
             return new ProcessedClaimCollection();
         }
 
-        if (claims == null || claims.size() == 0) {
+        if (claims == null || claims.isEmpty()) {
             return new ProcessedClaimCollection();
         }
 
         Map<String, String> claimMap = getUserClaims().get(parameters.getPrincipal().getName());
-        if (claimMap == null || claimMap.size() == 0) {
+        if (claimMap == null || claimMap.isEmpty()) {
             return new ProcessedClaimCollection();
         }
 
-        if (claims.size() > 0) {
+        if (!claims.isEmpty()) {
             ProcessedClaimCollection claimCollection = new ProcessedClaimCollection();
             for (Claim requestClaim : claims) {
                 String claimValue = claimMap.get(requestClaim.getClaimType().toString());

http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/d18087dd/services/sts/src/main/java/org/apache/cxf/fediz/service/sts/UsernamePasswordCallbackHandler.java
----------------------------------------------------------------------
diff --git a/services/sts/src/main/java/org/apache/cxf/fediz/service/sts/UsernamePasswordCallbackHandler.java
b/services/sts/src/main/java/org/apache/cxf/fediz/service/sts/UsernamePasswordCallbackHandler.java
index 96b0c8a..58c3768 100644
--- a/services/sts/src/main/java/org/apache/cxf/fediz/service/sts/UsernamePasswordCallbackHandler.java
+++ b/services/sts/src/main/java/org/apache/cxf/fediz/service/sts/UsernamePasswordCallbackHandler.java
@@ -41,7 +41,7 @@ public class UsernamePasswordCallbackHandler implements CallbackHandler
{
 
     public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException
{
 
-        if (getPasswords() == null || getPasswords().size() == 0) {
+        if (getPasswords() == null || getPasswords().isEmpty()) {
             return;
         }
 

http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/d18087dd/services/sts/src/main/java/org/apache/cxf/fediz/service/sts/realms/RealmFileClaimsHandler.java
----------------------------------------------------------------------
diff --git a/services/sts/src/main/java/org/apache/cxf/fediz/service/sts/realms/RealmFileClaimsHandler.java
b/services/sts/src/main/java/org/apache/cxf/fediz/service/sts/realms/RealmFileClaimsHandler.java
index accaa0d..4e64795 100644
--- a/services/sts/src/main/java/org/apache/cxf/fediz/service/sts/realms/RealmFileClaimsHandler.java
+++ b/services/sts/src/main/java/org/apache/cxf/fediz/service/sts/realms/RealmFileClaimsHandler.java
@@ -81,20 +81,20 @@ public class RealmFileClaimsHandler implements ClaimsHandler {
             return new ProcessedClaimCollection();
         }
 
-        if (claims == null || claims.size() == 0) {
+        if (claims == null || claims.isEmpty()) {
             LOG.fine("No claims requested");
             return new ProcessedClaimCollection();
         }
 
         Map<String, String> claimMap = getUserClaims().get(parameters.getPrincipal().getName());
-        if (claimMap == null || claimMap.size() == 0) {
+        if (claimMap == null || claimMap.isEmpty()) {
             LOG.fine("Claims requested for principal '" + parameters.getPrincipal().getName()
                      + "' but not found");
             return new ProcessedClaimCollection();
         }
         LOG.fine("Claims found for principal '" + parameters.getPrincipal().getName() + "'");
 
-        if (claims.size() > 0) {
+        if (!claims.isEmpty()) {
             ProcessedClaimCollection claimCollection = new ProcessedClaimCollection();
             for (Claim requestClaim : claims) {
                 String claimValue = claimMap.get(requestClaim.getClaimType().toString());

http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/d18087dd/services/sts/src/test/java/org/apache/cxf/fediz/sts/AbstractSTSTest.java
----------------------------------------------------------------------
diff --git a/services/sts/src/test/java/org/apache/cxf/fediz/sts/AbstractSTSTest.java b/services/sts/src/test/java/org/apache/cxf/fediz/sts/AbstractSTSTest.java
index 0e6b104..2e77c66 100644
--- a/services/sts/src/test/java/org/apache/cxf/fediz/sts/AbstractSTSTest.java
+++ b/services/sts/src/test/java/org/apache/cxf/fediz/sts/AbstractSTSTest.java
@@ -189,7 +189,7 @@ public abstract class AbstractSTSTest {
     }
 
     protected Element createClaimsElement(List<String> realmClaims) throws Exception
{
-        if (realmClaims == null || realmClaims.size() == 0) {
+        if (realmClaims == null || realmClaims.isEmpty()) {
             return null;
         }
 
@@ -199,7 +199,7 @@ public abstract class AbstractSTSTest {
         writer.writeNamespace("ic", "http://schemas.xmlsoap.org/ws/2005/05/identity");
         writer.writeAttribute("Dialect", "http://schemas.xmlsoap.org/ws/2005/05/identity");
 
-        if (realmClaims != null && realmClaims.size() > 0) {
+        if (realmClaims != null && !realmClaims.isEmpty()) {
             for (String item : realmClaims) {
                 writer.writeStartElement("ic", "ClaimType", "http://schemas.xmlsoap.org/ws/2005/05/identity");
                 writer.writeAttribute("Uri", item);

http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/d18087dd/systests/custom/src/test/java/custom/CustomClaimsHandler.java
----------------------------------------------------------------------
diff --git a/systests/custom/src/test/java/custom/CustomClaimsHandler.java b/systests/custom/src/test/java/custom/CustomClaimsHandler.java
index 9ae77b8..f87bd9d 100644
--- a/systests/custom/src/test/java/custom/CustomClaimsHandler.java
+++ b/systests/custom/src/test/java/custom/CustomClaimsHandler.java
@@ -98,20 +98,20 @@ public class CustomClaimsHandler implements ClaimsHandler {
             return new ProcessedClaimCollection();
         }
 
-        if (claims == null || claims.size() == 0) {
+        if (claims == null || claims.isEmpty()) {
             LOG.fine("No claims requested");
             return new ProcessedClaimCollection();
         }
 
         Map<String, String> claimMap = getUserClaims().get(parameters.getPrincipal().getName());
-        if (claimMap == null || claimMap.size() == 0) {
+        if (claimMap == null || claimMap.isEmpty()) {
             LOG.fine("Claims requested for principal '" + parameters.getPrincipal().getName()
                      + "' but not found");
             return new ProcessedClaimCollection();
         }
         LOG.fine("Claims found for principal '" + parameters.getPrincipal().getName() + "'");
 
-        if (claims.size() > 0) {
+        if (!claims.isEmpty()) {
             ProcessedClaimCollection claimCollection = new ProcessedClaimCollection();
             for (Claim requestClaim : claims) {
                 String claimValue = claimMap.get(requestClaim.getClaimType().toString());


Mime
View raw message