cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject [2/3] cxf git commit: Replace .size() > 0 with !isEmpty() for collections
Date Wed, 15 Feb 2017 11:35:55 GMT
http://git-wip-us.apache.org/repos/asf/cxf/blob/003fb1e7/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/StaxSymmetricBindingHandler.java
----------------------------------------------------------------------
diff --git a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/StaxSymmetricBindingHandler.java b/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/StaxSymmetricBindingHandler.java
index e314760..bd4b807 100644
--- a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/StaxSymmetricBindingHandler.java
+++ b/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/StaxSymmetricBindingHandler.java
@@ -227,7 +227,7 @@ public class StaxSymmetricBindingHandler extends AbstractStaxBindingHandler {
 
             addSupportingTokens();
 
-            if (encryptionToken != null && encrParts.size() > 0) {
+            if (encryptionToken != null && !encrParts.isEmpty()) {
                 if (isRequestor()) {
                     encrParts.addAll(encryptedTokensList);
                 }
@@ -255,7 +255,7 @@ public class StaxSymmetricBindingHandler extends AbstractStaxBindingHandler {
             }
             sigParts.addAll(this.getSignedParts());
 
-            if (sigParts.size() > 0) {
+            if (!sigParts.isEmpty()) {
                 AbstractTokenWrapper sigAbstractTokenWrapper = getSignatureToken();
                 if (sigAbstractTokenWrapper != null) {
                     AbstractToken sigToken = sigAbstractTokenWrapper.getToken();

http://git-wip-us.apache.org/repos/asf/cxf/blob/003fb1e7/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/SymmetricBindingHandler.java
----------------------------------------------------------------------
diff --git a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/SymmetricBindingHandler.java b/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/SymmetricBindingHandler.java
index ffa7add..aa66be3 100644
--- a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/SymmetricBindingHandler.java
+++ b/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/SymmetricBindingHandler.java
@@ -213,7 +213,7 @@ public class SymmetricBindingHandler extends AbstractBindingBuilder {
 
                 //Sign the message
                 //We should use the same key in the case of EncryptBeforeSig
-                if (sigParts.size() > 0) {
+                if (!sigParts.isEmpty()) {
                     addSig(this.doSignature(sigParts, encryptionWrapper, encryptionToken,
                                                     tok, attached));
                 }
@@ -224,7 +224,7 @@ public class SymmetricBindingHandler extends AbstractBindingBuilder {
 
                 //Check for signature protection and encryption of UsernameToken
                 if (sbinding.isEncryptSignature()
-                    || encryptedTokensList.size() > 0 && isRequestor()) {
+                    || !encryptedTokensList.isEmpty() && isRequestor()) {
                     List<WSEncryptionPart> secondEncrParts = new ArrayList<>();
 
                     //Now encrypt the signature using the above token
@@ -509,7 +509,7 @@ public class SymmetricBindingHandler extends AbstractBindingBuilder {
                                    List<WSEncryptionPart> encrParts,
                                    boolean atEnd) {
         //Do encryption
-        if (recToken != null && recToken.getToken() != null && encrParts.size() > 0) {
+        if (recToken != null && recToken.getToken() != null && !encrParts.isEmpty()) {
             AbstractToken encrToken = recToken.getToken();
             assertPolicy(recToken);
             assertPolicy(encrToken);

http://git-wip-us.apache.org/repos/asf/cxf/blob/003fb1e7/rt/wsdl/src/main/java/org/apache/cxf/wsdl/interceptors/BareInInterceptor.java
----------------------------------------------------------------------
diff --git a/rt/wsdl/src/main/java/org/apache/cxf/wsdl/interceptors/BareInInterceptor.java b/rt/wsdl/src/main/java/org/apache/cxf/wsdl/interceptors/BareInInterceptor.java
index 0c6a751..953b59a 100644
--- a/rt/wsdl/src/main/java/org/apache/cxf/wsdl/interceptors/BareInInterceptor.java
+++ b/rt/wsdl/src/main/java/org/apache/cxf/wsdl/interceptors/BareInInterceptor.java
@@ -148,7 +148,7 @@ public class BareInInterceptor extends AbstractInDatabindingInterceptor {
             }
             paramNum++;
         }
-        if (parameters.size() > 0) {
+        if (!parameters.isEmpty()) {
             message.setContent(List.class, parameters);
         }
     }

http://git-wip-us.apache.org/repos/asf/cxf/blob/003fb1e7/rt/wsdl/src/main/java/org/apache/cxf/wsdl11/SchemaUtil.java
----------------------------------------------------------------------
diff --git a/rt/wsdl/src/main/java/org/apache/cxf/wsdl11/SchemaUtil.java b/rt/wsdl/src/main/java/org/apache/cxf/wsdl11/SchemaUtil.java
index b49bbf8..9a01416 100644
--- a/rt/wsdl/src/main/java/org/apache/cxf/wsdl11/SchemaUtil.java
+++ b/rt/wsdl/src/main/java/org/apache/cxf/wsdl11/SchemaUtil.java
@@ -197,7 +197,7 @@ public final class SchemaUtil {
         }
 
         Map<String, List<?>> imports = CastUtils.cast(schema.getImports());
-        if (imports != null && imports.size() > 0) {
+        if (imports != null && !imports.isEmpty()) {
             for (Map.Entry<String, List<?>> entry : imports.entrySet()) {
                 String importNamespace = entry.getKey();
                 List<SchemaImport> schemaImports = CastUtils.cast(entry.getValue());

http://git-wip-us.apache.org/repos/asf/cxf/blob/003fb1e7/rt/wsdl/src/main/java/org/apache/cxf/wsdl11/WSDLServiceBuilder.java
----------------------------------------------------------------------
diff --git a/rt/wsdl/src/main/java/org/apache/cxf/wsdl11/WSDLServiceBuilder.java b/rt/wsdl/src/main/java/org/apache/cxf/wsdl11/WSDLServiceBuilder.java
index 31c764a..494643b 100644
--- a/rt/wsdl/src/main/java/org/apache/cxf/wsdl11/WSDLServiceBuilder.java
+++ b/rt/wsdl/src/main/java/org/apache/cxf/wsdl11/WSDLServiceBuilder.java
@@ -412,7 +412,7 @@ public class WSDLServiceBuilder {
         DestinationFactory factory = null;
         EndpointInfo ei = null;
 
-        if (null != elements && elements.size() > 0) {
+        if (null != elements && !elements.isEmpty()) {
             for (ExtensibilityElement el : CastUtils.cast(elements, ExtensibilityElement.class)) {
                 ns = el.getElementType().getNamespaceURI();
                 try {
@@ -431,7 +431,7 @@ public class WSDLServiceBuilder {
 
         if (factory == null) { // get the transport id from bindingInfo
             elements = port.getBinding().getExtensibilityElements();
-            if (null != elements && elements.size() > 0) {
+            if (null != elements && !elements.isEmpty()) {
                 for (ExtensibilityElement el : CastUtils.cast(elements, ExtensibilityElement.class)) {
                     if (el instanceof SOAPBinding) {
                         ns = ((SOAPBinding)el).getTransportURI();

http://git-wip-us.apache.org/repos/asf/cxf/blob/003fb1e7/rt/wsdl/src/test/java/org/apache/cxf/wsdl11/WSDLServiceBuilderTest.java
----------------------------------------------------------------------
diff --git a/rt/wsdl/src/test/java/org/apache/cxf/wsdl11/WSDLServiceBuilderTest.java b/rt/wsdl/src/test/java/org/apache/cxf/wsdl11/WSDLServiceBuilderTest.java
index 04c7100..0594e2e 100644
--- a/rt/wsdl/src/test/java/org/apache/cxf/wsdl11/WSDLServiceBuilderTest.java
+++ b/rt/wsdl/src/test/java/org/apache/cxf/wsdl11/WSDLServiceBuilderTest.java
@@ -160,7 +160,7 @@ public class WSDLServiceBuilderTest extends Assert {
 
         control.replay();
         serviceInfos = wsdlServiceBuilder.buildServices(def, service, endpointName);
-        if (serviceInfos.size() > 0) {
+        if (!serviceInfos.isEmpty()) {
             serviceInfo = serviceInfos.get(0);
         } else {
             serviceInfo = null;

http://git-wip-us.apache.org/repos/asf/cxf/blob/003fb1e7/services/sts/sts-core/src/main/java/org/apache/cxf/sts/claims/LdapClaimsHandler.java
----------------------------------------------------------------------
diff --git a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/claims/LdapClaimsHandler.java b/services/sts/sts-core/src/main/java/org/apache/cxf/sts/claims/LdapClaimsHandler.java
index 9329fa7..c89df6c 100644
--- a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/claims/LdapClaimsHandler.java
+++ b/services/sts/sts-core/src/main/java/org/apache/cxf/sts/claims/LdapClaimsHandler.java
@@ -209,7 +209,7 @@ public class LdapClaimsHandler implements ClaimsHandler, RealmSupport {
                 for (String userBase : userBaseDNs) {
                     ldapAttributes = LdapUtils.getAttributesOfEntry(ldap, userBase, this.getObjectClass(), this
                         .getUserNameAttribute(), user, searchAttributes);
-                    if (ldapAttributes != null && ldapAttributes.size() > 0) {
+                    if (ldapAttributes != null && !ldapAttributes.isEmpty()) {
                         break; // User found
                     }
                 }

http://git-wip-us.apache.org/repos/asf/cxf/blob/003fb1e7/services/sts/sts-core/src/main/java/org/apache/cxf/sts/claims/LdapUtils.java
----------------------------------------------------------------------
diff --git a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/claims/LdapUtils.java b/services/sts/sts-core/src/main/java/org/apache/cxf/sts/claims/LdapUtils.java
index bbd23c2..b453ae6 100644
--- a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/claims/LdapUtils.java
+++ b/services/sts/sts-core/src/main/java/org/apache/cxf/sts/claims/LdapUtils.java
@@ -85,7 +85,7 @@ public final class LdapUtils {
 
         result = ldapTemplate.search((baseDN == null) ? "" : baseDN, filter.toString(),
             SearchControls.SUBTREE_SCOPE, searchAttributes, mapper);
-        if (result != null && result.size() > 0) {
+        if (result != null && !result.isEmpty()) {
             ldapAttributes = CastUtils.cast((Map<?, ?>)result.get(0));
         }
 
@@ -133,7 +133,7 @@ public final class LdapUtils {
 
         result = ldapTemplate.search((baseDN == null) ? "" : baseDN, filter.toString(),
             SearchControls.SUBTREE_SCOPE, searchAttributes, mapper);
-        if (result != null && result.size() > 0) {
+        if (result != null && !result.isEmpty()) {
             ldapAttributes = CastUtils.cast((List<?>)result);
         }
 
@@ -158,7 +158,7 @@ public final class LdapUtils {
         List<Name> result = ldapTemplate.search((baseDN == null) ? "" : baseDN, filter.toString(),
             SearchControls.SUBTREE_SCOPE, mapper);
 
-        if (result != null && result.size() > 0) {
+        if (result != null && !result.isEmpty()) {
             //not only the first one....
             return result.get(0);
         }

http://git-wip-us.apache.org/repos/asf/cxf/blob/003fb1e7/services/sts/sts-core/src/main/java/org/apache/cxf/sts/claims/mapper/ClaimUtils.java
----------------------------------------------------------------------
diff --git a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/claims/mapper/ClaimUtils.java b/services/sts/sts-core/src/main/java/org/apache/cxf/sts/claims/mapper/ClaimUtils.java
index 21827d8..75a4415 100644
--- a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/claims/mapper/ClaimUtils.java
+++ b/services/sts/sts-core/src/main/java/org/apache/cxf/sts/claims/mapper/ClaimUtils.java
@@ -225,7 +225,7 @@ public class ClaimUtils {
             ProcessedClaim c = get(processedClaims, sc);
             if (c != null) {
                 List<Object> values = c.getValues();
-                if (values != null && values.size() > 0) {
+                if (values != null && !values.isEmpty()) {
                     if (mergedProcessedClaim == null) {
                         // First match TODO refactor for better method override
                         mergedProcessedClaim = c.clone();

http://git-wip-us.apache.org/repos/asf/cxf/blob/003fb1e7/services/sts/sts-core/src/main/java/org/apache/cxf/sts/operation/TokenIssueOperation.java
----------------------------------------------------------------------
diff --git a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/operation/TokenIssueOperation.java b/services/sts/sts-core/src/main/java/org/apache/cxf/sts/operation/TokenIssueOperation.java
index 74675c9..d38eecf 100644
--- a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/operation/TokenIssueOperation.java
+++ b/services/sts/sts-core/src/main/java/org/apache/cxf/sts/operation/TokenIssueOperation.java
@@ -383,7 +383,7 @@ public class TokenIssueOperation extends AbstractOperation implements IssueOpera
             CastUtils.cast((List<?>) messageContext.get(WSHandlerConstants.RECV_RESULTS));
 
         // Try DOM results first
-        if (handlerResults != null && handlerResults.size() > 0) {
+        if (handlerResults != null && !handlerResults.isEmpty()) {
             WSHandlerResult handlerResult = handlerResults.get(0);
             List<WSSecurityEngineResult> engineResults = handlerResult.getResults();
 

http://git-wip-us.apache.org/repos/asf/cxf/blob/003fb1e7/services/sts/sts-core/src/main/java/org/apache/cxf/sts/request/RequestParser.java
----------------------------------------------------------------------
diff --git a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/request/RequestParser.java b/services/sts/sts-core/src/main/java/org/apache/cxf/sts/request/RequestParser.java
index 907dc59..fdd3169 100644
--- a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/request/RequestParser.java
+++ b/services/sts/sts-core/src/main/java/org/apache/cxf/sts/request/RequestParser.java
@@ -728,7 +728,7 @@ public class RequestParser {
         final List<WSHandlerResult> handlerResults =
             CastUtils.cast((List<?>) messageContext.get(WSHandlerConstants.RECV_RESULTS));
 
-        if (handlerResults != null && handlerResults.size() > 0) {
+        if (handlerResults != null && !handlerResults.isEmpty()) {
             WSHandlerResult handlerResult = handlerResults.get(0);
             List<WSSecurityEngineResult> engineResults = handlerResult.getResults();
 

http://git-wip-us.apache.org/repos/asf/cxf/blob/003fb1e7/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/canceller/SCTCanceller.java
----------------------------------------------------------------------
diff --git a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/canceller/SCTCanceller.java b/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/canceller/SCTCanceller.java
index 2def957..c7700b4 100644
--- a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/canceller/SCTCanceller.java
+++ b/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/canceller/SCTCanceller.java
@@ -155,7 +155,7 @@ public class SCTCanceller implements TokenCanceller {
         final List<WSHandlerResult> handlerResults =
             CastUtils.cast((List<?>) messageContext.get(WSHandlerConstants.RECV_RESULTS));
 
-        if (handlerResults != null && handlerResults.size() > 0) {
+        if (handlerResults != null && !handlerResults.isEmpty()) {
             WSHandlerResult handlerResult = handlerResults.get(0);
             List<WSSecurityEngineResult> signedResults =
                 handlerResult.getActionResults().get(WSConstants.SIGN);

http://git-wip-us.apache.org/repos/asf/cxf/blob/003fb1e7/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/provider/SAMLTokenProvider.java
----------------------------------------------------------------------
diff --git a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/provider/SAMLTokenProvider.java b/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/provider/SAMLTokenProvider.java
index da4a01b..310a9a1 100644
--- a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/provider/SAMLTokenProvider.java
+++ b/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/provider/SAMLTokenProvider.java
@@ -329,7 +329,7 @@ public class SAMLTokenProvider extends AbstractSAMLTokenProvider implements Toke
 
         // Parse the AttributeStatements
         List<AttributeStatementBean> attrBeanList = null;
-        if (attributeStatementProviders != null && attributeStatementProviders.size() > 0) {
+        if (attributeStatementProviders != null && !attributeStatementProviders.isEmpty()) {
             attrBeanList = new ArrayList<>();
             for (AttributeStatementProvider statementProvider : attributeStatementProviders) {
                 AttributeStatementBean statementBean = statementProvider.getStatement(tokenParameters);
@@ -349,7 +349,7 @@ public class SAMLTokenProvider extends AbstractSAMLTokenProvider implements Toke
 
         // Parse the AuthenticationStatements
         List<AuthenticationStatementBean> authBeanList = null;
-        if (authenticationStatementProviders != null && authenticationStatementProviders.size() > 0) {
+        if (authenticationStatementProviders != null && !authenticationStatementProviders.isEmpty()) {
             authBeanList = new ArrayList<>();
             for (AuthenticationStatementProvider statementProvider : authenticationStatementProviders) {
                 AuthenticationStatementBean statementBean = statementProvider.getStatement(tokenParameters);
@@ -370,7 +370,7 @@ public class SAMLTokenProvider extends AbstractSAMLTokenProvider implements Toke
         // Parse the AuthDecisionStatements
         List<AuthDecisionStatementBean> authDecisionBeanList = null;
         if (authDecisionStatementProviders != null
-            && authDecisionStatementProviders.size() > 0) {
+            && !authDecisionStatementProviders.isEmpty()) {
             authDecisionBeanList = new ArrayList<>();
             for (AuthDecisionStatementProvider statementProvider : authDecisionStatementProviders) {
                 AuthDecisionStatementBean statementBean = statementProvider.getStatement(tokenParameters);

http://git-wip-us.apache.org/repos/asf/cxf/blob/003fb1e7/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/renewer/SAMLTokenRenewer.java
----------------------------------------------------------------------
diff --git a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/renewer/SAMLTokenRenewer.java b/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/renewer/SAMLTokenRenewer.java
index eaa8322..fb7906a 100644
--- a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/renewer/SAMLTokenRenewer.java
+++ b/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/renewer/SAMLTokenRenewer.java
@@ -554,7 +554,7 @@ public class SAMLTokenRenewer extends AbstractSAMLTokenProvider implements Token
                 CastUtils.cast((List<?>) messageContext.get(WSHandlerConstants.RECV_RESULTS));
 
             List<WSSecurityEngineResult> signedResults = new ArrayList<>();
-            if (handlerResults != null && handlerResults.size() > 0) {
+            if (handlerResults != null && !handlerResults.isEmpty()) {
                 WSHandlerResult handlerResult = handlerResults.get(0);
 
                 if (handlerResult.getActionResults().containsKey(WSConstants.SIGN)) {

http://git-wip-us.apache.org/repos/asf/cxf/blob/003fb1e7/services/sts/sts-core/src/test/java/org/apache/cxf/sts/common/CustomClaimsHandler.java
----------------------------------------------------------------------
diff --git a/services/sts/sts-core/src/test/java/org/apache/cxf/sts/common/CustomClaimsHandler.java b/services/sts/sts-core/src/test/java/org/apache/cxf/sts/common/CustomClaimsHandler.java
index d4c6a5f..4fb46a4 100644
--- a/services/sts/sts-core/src/test/java/org/apache/cxf/sts/common/CustomClaimsHandler.java
+++ b/services/sts/sts-core/src/test/java/org/apache/cxf/sts/common/CustomClaimsHandler.java
@@ -62,7 +62,7 @@ public class CustomClaimsHandler implements ClaimsHandler {
     public ProcessedClaimCollection retrieveClaimValues(
             ClaimCollection claims, ClaimsParameters parameters) {
 
-        if (claims != null && claims.size() > 0) {
+        if (claims != null && !claims.isEmpty()) {
             ProcessedClaimCollection claimCollection = new ProcessedClaimCollection();
             for (Claim requestClaim : claims) {
                 ProcessedClaim claim = new ProcessedClaim();

http://git-wip-us.apache.org/repos/asf/cxf/blob/003fb1e7/services/sts/sts-core/src/test/java/org/apache/cxf/sts/common/CustomUserClaimsHandler.java
----------------------------------------------------------------------
diff --git a/services/sts/sts-core/src/test/java/org/apache/cxf/sts/common/CustomUserClaimsHandler.java b/services/sts/sts-core/src/test/java/org/apache/cxf/sts/common/CustomUserClaimsHandler.java
index 80cdba2..67243ed 100644
--- a/services/sts/sts-core/src/test/java/org/apache/cxf/sts/common/CustomUserClaimsHandler.java
+++ b/services/sts/sts-core/src/test/java/org/apache/cxf/sts/common/CustomUserClaimsHandler.java
@@ -48,7 +48,7 @@ public class CustomUserClaimsHandler implements ClaimsHandler {
     public ProcessedClaimCollection retrieveClaimValues(
             ClaimCollection claims, ClaimsParameters parameters) {
 
-        if (claims != null && claims.size() > 0) {
+        if (claims != null && !claims.isEmpty()) {
             ProcessedClaimCollection claimCollection = new ProcessedClaimCollection();
             for (Claim requestClaim : claims) {
                 ProcessedClaim claim = new ProcessedClaim();

http://git-wip-us.apache.org/repos/asf/cxf/blob/003fb1e7/services/sts/sts-core/src/test/java/org/apache/cxf/sts/common/RealmSupportClaimsHandler.java
----------------------------------------------------------------------
diff --git a/services/sts/sts-core/src/test/java/org/apache/cxf/sts/common/RealmSupportClaimsHandler.java b/services/sts/sts-core/src/test/java/org/apache/cxf/sts/common/RealmSupportClaimsHandler.java
index 65ddc6b..412d996 100644
--- a/services/sts/sts-core/src/test/java/org/apache/cxf/sts/common/RealmSupportClaimsHandler.java
+++ b/services/sts/sts-core/src/test/java/org/apache/cxf/sts/common/RealmSupportClaimsHandler.java
@@ -75,7 +75,7 @@ public class RealmSupportClaimsHandler implements ClaimsHandler, RealmSupport {
                     + "' not in supportedRealm list: " + supportedRealms);
         }
 
-        if (claims != null && claims.size() > 0) {
+        if (claims != null && !claims.isEmpty()) {
             ProcessedClaimCollection claimCollection = new ProcessedClaimCollection();
             for (Claim requestClaim : claims) {
                 if (getSupportedClaimTypes().indexOf(requestClaim.getClaimType()) != -1) {

http://git-wip-us.apache.org/repos/asf/cxf/blob/003fb1e7/services/sts/systests/advanced/src/test/java/org/apache/cxf/systest/sts/custom/CustomClaimsHandler.java
----------------------------------------------------------------------
diff --git a/services/sts/systests/advanced/src/test/java/org/apache/cxf/systest/sts/custom/CustomClaimsHandler.java b/services/sts/systests/advanced/src/test/java/org/apache/cxf/systest/sts/custom/CustomClaimsHandler.java
index d486b11..fc43ed8 100644
--- a/services/sts/systests/advanced/src/test/java/org/apache/cxf/systest/sts/custom/CustomClaimsHandler.java
+++ b/services/sts/systests/advanced/src/test/java/org/apache/cxf/systest/sts/custom/CustomClaimsHandler.java
@@ -47,7 +47,7 @@ public class CustomClaimsHandler implements ClaimsHandler {
     public ProcessedClaimCollection retrieveClaimValues(
             ClaimCollection claims, ClaimsParameters parameters) {
 
-        if (claims != null && claims.size() > 0) {
+        if (claims != null && !claims.isEmpty()) {
             ProcessedClaimCollection claimCollection = new ProcessedClaimCollection();
             List<Element> customContent = parameters.getTokenRequirements().getCustomContent();
             boolean foundContent = false;

http://git-wip-us.apache.org/repos/asf/cxf/blob/003fb1e7/services/sts/systests/advanced/src/test/java/org/apache/cxf/systest/sts/deployment/CustomClaimsHandler.java
----------------------------------------------------------------------
diff --git a/services/sts/systests/advanced/src/test/java/org/apache/cxf/systest/sts/deployment/CustomClaimsHandler.java b/services/sts/systests/advanced/src/test/java/org/apache/cxf/systest/sts/deployment/CustomClaimsHandler.java
index 4b866f4..25092b8 100644
--- a/services/sts/systests/advanced/src/test/java/org/apache/cxf/systest/sts/deployment/CustomClaimsHandler.java
+++ b/services/sts/systests/advanced/src/test/java/org/apache/cxf/systest/sts/deployment/CustomClaimsHandler.java
@@ -44,7 +44,7 @@ public class CustomClaimsHandler implements ClaimsHandler {
     public ProcessedClaimCollection retrieveClaimValues(
             ClaimCollection claims, ClaimsParameters parameters) {
 
-        if (claims != null && claims.size() > 0) {
+        if (claims != null && !claims.isEmpty()) {
             ProcessedClaimCollection claimCollection = new ProcessedClaimCollection();
             for (Claim requestClaim : claims) {
                 ProcessedClaim claim = new ProcessedClaim();

http://git-wip-us.apache.org/repos/asf/cxf/blob/003fb1e7/services/sts/systests/advanced/src/test/java/org/apache/cxf/systest/sts/secure_conv/SCTSAMLTokenProvider.java
----------------------------------------------------------------------
diff --git a/services/sts/systests/advanced/src/test/java/org/apache/cxf/systest/sts/secure_conv/SCTSAMLTokenProvider.java b/services/sts/systests/advanced/src/test/java/org/apache/cxf/systest/sts/secure_conv/SCTSAMLTokenProvider.java
index 6023fd9..f0db501 100644
--- a/services/sts/systests/advanced/src/test/java/org/apache/cxf/systest/sts/secure_conv/SCTSAMLTokenProvider.java
+++ b/services/sts/systests/advanced/src/test/java/org/apache/cxf/systest/sts/secure_conv/SCTSAMLTokenProvider.java
@@ -226,7 +226,7 @@ public class SCTSAMLTokenProvider implements TokenProvider {
     ) throws Exception {
         // Parse the AttributeStatements
         List<AttributeStatementBean> attrBeanList = null;
-        if (attributeStatementProviders != null && attributeStatementProviders.size() > 0) {
+        if (attributeStatementProviders != null && !attributeStatementProviders.isEmpty()) {
             attrBeanList = new ArrayList<>();
             for (AttributeStatementProvider statementProvider : attributeStatementProviders) {
                 AttributeStatementBean statementBean = statementProvider.getStatement(tokenParameters);

http://git-wip-us.apache.org/repos/asf/cxf/blob/003fb1e7/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/deployment/CustomClaimsHandler.java
----------------------------------------------------------------------
diff --git a/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/deployment/CustomClaimsHandler.java b/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/deployment/CustomClaimsHandler.java
index 1e9068e..7c96b31 100644
--- a/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/deployment/CustomClaimsHandler.java
+++ b/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/deployment/CustomClaimsHandler.java
@@ -44,7 +44,7 @@ public class CustomClaimsHandler implements ClaimsHandler {
     public ProcessedClaimCollection retrieveClaimValues(
             ClaimCollection claims, ClaimsParameters parameters) {
 
-        if (claims != null && claims.size() > 0) {
+        if (claims != null && !claims.isEmpty()) {
             ProcessedClaimCollection claimCollection = new ProcessedClaimCollection();
             for (Claim requestClaim : claims) {
                 ProcessedClaim claim = new ProcessedClaim();

http://git-wip-us.apache.org/repos/asf/cxf/blob/003fb1e7/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/issueunit/IssueUnitTest.java
----------------------------------------------------------------------
diff --git a/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/issueunit/IssueUnitTest.java b/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/issueunit/IssueUnitTest.java
index 65399a3..d172474 100644
--- a/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/issueunit/IssueUnitTest.java
+++ b/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/issueunit/IssueUnitTest.java
@@ -165,7 +165,7 @@ public class IssueUnitTest extends AbstractBusClientServerTestBase {
 
         List<String> methods = assertion.getConfirmationMethods();
         String confirmMethod = null;
-        if (methods != null && methods.size() > 0) {
+        if (methods != null && !methods.isEmpty()) {
             confirmMethod = methods.get(0);
         }
         assertTrue(OpenSAMLUtil.isMethodHolderOfKey(confirmMethod));
@@ -205,7 +205,7 @@ public class IssueUnitTest extends AbstractBusClientServerTestBase {
 
         List<String> methods = assertion.getConfirmationMethods();
         String confirmMethod = null;
-        if (methods != null && methods.size() > 0) {
+        if (methods != null && !methods.isEmpty()) {
             confirmMethod = methods.get(0);
         }
         assertTrue(OpenSAMLUtil.isMethodHolderOfKey(confirmMethod));
@@ -244,7 +244,7 @@ public class IssueUnitTest extends AbstractBusClientServerTestBase {
 
         List<String> methods = assertion.getConfirmationMethods();
         String confirmMethod = null;
-        if (methods != null && methods.size() > 0) {
+        if (methods != null && !methods.isEmpty()) {
             confirmMethod = methods.get(0);
         }
         assertTrue(confirmMethod != null && confirmMethod.contains("bearer"));
@@ -283,7 +283,7 @@ public class IssueUnitTest extends AbstractBusClientServerTestBase {
 
         List<String> methods = assertion.getConfirmationMethods();
         String confirmMethod = null;
-        if (methods != null && methods.size() > 0) {
+        if (methods != null && !methods.isEmpty()) {
             confirmMethod = methods.get(0);
         }
         assertNotNull(confirmMethod);
@@ -343,7 +343,7 @@ public class IssueUnitTest extends AbstractBusClientServerTestBase {
 
         List<String> methods = assertion.getConfirmationMethods();
         String confirmMethod = null;
-        if (methods != null && methods.size() > 0) {
+        if (methods != null && !methods.isEmpty()) {
             confirmMethod = methods.get(0);
         }
         assertTrue(confirmMethod != null && confirmMethod.contains("bearer"));
@@ -380,7 +380,7 @@ public class IssueUnitTest extends AbstractBusClientServerTestBase {
 
         List<String> methods = assertion.getConfirmationMethods();
         String confirmMethod = null;
-        if (methods != null && methods.size() > 0) {
+        if (methods != null && !methods.isEmpty()) {
             confirmMethod = methods.get(0);
         }
         assertTrue(confirmMethod != null && confirmMethod.contains("bearer"));
@@ -447,7 +447,7 @@ public class IssueUnitTest extends AbstractBusClientServerTestBase {
 
         List<String> methods = assertion.getConfirmationMethods();
         String confirmMethod = null;
-        if (methods != null && methods.size() > 0) {
+        if (methods != null && !methods.isEmpty()) {
             confirmMethod = methods.get(0);
         }
         assertTrue(confirmMethod != null && confirmMethod.contains("bearer"));

http://git-wip-us.apache.org/repos/asf/cxf/blob/003fb1e7/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/rest/STSRESTTest.java
----------------------------------------------------------------------
diff --git a/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/rest/STSRESTTest.java b/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/rest/STSRESTTest.java
index 6780e7d..cb04f82 100644
--- a/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/rest/STSRESTTest.java
+++ b/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/rest/STSRESTTest.java
@@ -206,7 +206,7 @@ public class STSRESTTest extends AbstractBusClientServerTestBase {
 
         List<String> methods = assertion.getConfirmationMethods();
         String confirmMethod = null;
-        if (methods != null && methods.size() > 0) {
+        if (methods != null && !methods.isEmpty()) {
             confirmMethod = methods.get(0);
         }
         assertTrue(OpenSAMLUtil.isMethodHolderOfKey(confirmMethod));
@@ -248,7 +248,7 @@ public class STSRESTTest extends AbstractBusClientServerTestBase {
 
         List<String> methods = assertion.getConfirmationMethods();
         String confirmMethod = null;
-        if (methods != null && methods.size() > 0) {
+        if (methods != null && !methods.isEmpty()) {
             confirmMethod = methods.get(0);
         }
         assertTrue(OpenSAMLUtil.isMethodHolderOfKey(confirmMethod));
@@ -290,7 +290,7 @@ public class STSRESTTest extends AbstractBusClientServerTestBase {
 
         List<String> methods = assertion.getConfirmationMethods();
         String confirmMethod = null;
-        if (methods != null && methods.size() > 0) {
+        if (methods != null && !methods.isEmpty()) {
             confirmMethod = methods.get(0);
         }
         assertTrue(OpenSAMLUtil.isMethodHolderOfKey(confirmMethod));
@@ -332,7 +332,7 @@ public class STSRESTTest extends AbstractBusClientServerTestBase {
 
         List<String> methods = assertion.getConfirmationMethods();
         String confirmMethod = null;
-        if (methods != null && methods.size() > 0) {
+        if (methods != null && !methods.isEmpty()) {
             confirmMethod = methods.get(0);
         }
         assertTrue(OpenSAMLUtil.isMethodHolderOfKey(confirmMethod));
@@ -374,7 +374,7 @@ public class STSRESTTest extends AbstractBusClientServerTestBase {
 
         List<String> methods = assertion.getConfirmationMethods();
         String confirmMethod = null;
-        if (methods != null && methods.size() > 0) {
+        if (methods != null && !methods.isEmpty()) {
             confirmMethod = methods.get(0);
         }
         assertTrue(confirmMethod.contains("bearer"));
@@ -414,7 +414,7 @@ public class STSRESTTest extends AbstractBusClientServerTestBase {
 
         List<String> methods = assertion.getConfirmationMethods();
         String confirmMethod = null;
-        if (methods != null && methods.size() > 0) {
+        if (methods != null && !methods.isEmpty()) {
             confirmMethod = methods.get(0);
         }
         assertTrue(confirmMethod.contains("bearer"));

http://git-wip-us.apache.org/repos/asf/cxf/blob/003fb1e7/services/sts/systests/sts-itests/src/test/java/org/apache/cxf/systest/sts/itests/unit/STSUnitTest.java
----------------------------------------------------------------------
diff --git a/services/sts/systests/sts-itests/src/test/java/org/apache/cxf/systest/sts/itests/unit/STSUnitTest.java b/services/sts/systests/sts-itests/src/test/java/org/apache/cxf/systest/sts/itests/unit/STSUnitTest.java
index e0b4836..b8ab009 100644
--- a/services/sts/systests/sts-itests/src/test/java/org/apache/cxf/systest/sts/itests/unit/STSUnitTest.java
+++ b/services/sts/systests/sts-itests/src/test/java/org/apache/cxf/systest/sts/itests/unit/STSUnitTest.java
@@ -77,7 +77,7 @@ public class STSUnitTest extends BasicSTSIntegrationTest {
 
         List<String> methods = assertion.getConfirmationMethods();
         String confirmMethod = null;
-        if (methods != null && methods.size() > 0) {
+        if (methods != null && !methods.isEmpty()) {
             confirmMethod = methods.get(0);
         }
         Assert.assertTrue(confirmMethod.contains("bearer"));

http://git-wip-us.apache.org/repos/asf/cxf/blob/003fb1e7/systests/databinding/src/test/java/org/apache/cxf/systest/jaxb/HashMapAdapter.java
----------------------------------------------------------------------
diff --git a/systests/databinding/src/test/java/org/apache/cxf/systest/jaxb/HashMapAdapter.java b/systests/databinding/src/test/java/org/apache/cxf/systest/jaxb/HashMapAdapter.java
index 9c85416..a5adcbe 100644
--- a/systests/databinding/src/test/java/org/apache/cxf/systest/jaxb/HashMapAdapter.java
+++ b/systests/databinding/src/test/java/org/apache/cxf/systest/jaxb/HashMapAdapter.java
@@ -75,7 +75,7 @@ public class HashMapAdapter extends XmlAdapter<HashMapAdapter.HashMapType, Map<S
 
     public HashMapType marshal(Map<String, byte[]> arg0) throws Exception {
         HashMapType myHashMapType = new HashMapType();
-        if (arg0 != null && arg0.size() > 0) {
+        if (arg0 != null && !arg0.isEmpty()) {
             for (Map.Entry<String, byte[]> entry : arg0.entrySet()) {
                 if (entry != null) {
                     HashMapEntryType myHashEntryType = new HashMapEntryType();

http://git-wip-us.apache.org/repos/asf/cxf/blob/003fb1e7/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerBookTest.java
----------------------------------------------------------------------
diff --git a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerBookTest.java b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerBookTest.java
index 8311508..013f573 100644
--- a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerBookTest.java
+++ b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerBookTest.java
@@ -756,7 +756,7 @@ public class JAXRSClientServerBookTest extends AbstractBusClientServerTestBase {
         assertEquals(200, wc.getResponse().getStatus());
         assertEquals(123L, book.getId());
         MultivaluedMap<String, Object> headers = wc.getResponse().getMetadata();
-        assertTrue(headers.size() > 0);
+        assertTrue(!headers.isEmpty());
         Object etag = headers.getFirst("ETag");
         assertNotNull(etag);
         assertTrue(etag.toString().startsWith("\""));

http://git-wip-us.apache.org/repos/asf/cxf/blob/003fb1e7/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerStreamingTest.java
----------------------------------------------------------------------
diff --git a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerStreamingTest.java b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerStreamingTest.java
index bc04e9e..f766bd3 100644
--- a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerStreamingTest.java
+++ b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerStreamingTest.java
@@ -162,7 +162,7 @@ public class JAXRSClientServerStreamingTest extends AbstractBusClientServerTestB
         public void writeTo(Object obj, Class<?> cls, Type genericType, Annotation[] anns,
             MediaType m, MultivaluedMap<String, Object> headers, OutputStream os) throws IOException {
             List<String> failHeaders = getContext().getHttpHeaders().getRequestHeader("fail-write");
-            if (failHeaders != null && failHeaders.size() > 0) {
+            if (failHeaders != null && !failHeaders.isEmpty()) {
                 os.write("fail".getBytes());
                 throw new IOException();
             } else {

http://git-wip-us.apache.org/repos/asf/cxf/blob/003fb1e7/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/tokens/DoubleItBSTImpl.java
----------------------------------------------------------------------
diff --git a/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/tokens/DoubleItBSTImpl.java b/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/tokens/DoubleItBSTImpl.java
index 1cac266..30213f6 100644
--- a/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/tokens/DoubleItBSTImpl.java
+++ b/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/tokens/DoubleItBSTImpl.java
@@ -52,12 +52,12 @@ public class DoubleItBSTImpl implements DoubleItPortType {
         List<WSHandlerResult> results =
             CastUtils.cast((List<?>)wsContext.getMessageContext().get(WSHandlerConstants.RECV_RESULTS));
         Assert.assertNotNull("Security Results cannot be null", results);
-        Assert.assertTrue(results.size() > 0);
+        Assert.assertTrue(!results.isEmpty());
 
         WSHandlerResult result = results.get(0);
         List<WSSecurityEngineResult> securityResults = result.getResults();
         Assert.assertNotNull("Security Results cannot be null", securityResults);
-        Assert.assertTrue(securityResults.size() > 0);
+        Assert.assertTrue(!securityResults.isEmpty());
 
         WSSecurityEngineResult securityResult = securityResults.get(0);
         BinarySecurity binarySecurityToken =

http://git-wip-us.apache.org/repos/asf/cxf/blob/003fb1e7/tools/common/src/main/java/org/apache/cxf/tools/common/ToolContext.java
----------------------------------------------------------------------
diff --git a/tools/common/src/main/java/org/apache/cxf/tools/common/ToolContext.java b/tools/common/src/main/java/org/apache/cxf/tools/common/ToolContext.java
index 8420e34..98bbea0 100644
--- a/tools/common/src/main/java/org/apache/cxf/tools/common/ToolContext.java
+++ b/tools/common/src/main/java/org/apache/cxf/tools/common/ToolContext.java
@@ -246,7 +246,7 @@ public class ToolContext {
     }
 
     public boolean isExcludeNamespaceEnabled() {
-        return excludeNamespacePackageMap.size() > 0;
+        return !excludeNamespacePackageMap.isEmpty();
     }
 
     public List<String> getExcludePkgList() {

http://git-wip-us.apache.org/repos/asf/cxf/blob/003fb1e7/tools/common/src/main/java/org/apache/cxf/tools/common/toolspec/ToolSpec.java
----------------------------------------------------------------------
diff --git a/tools/common/src/main/java/org/apache/cxf/tools/common/toolspec/ToolSpec.java b/tools/common/src/main/java/org/apache/cxf/tools/common/toolspec/ToolSpec.java
index bc077fb..d244592 100644
--- a/tools/common/src/main/java/org/apache/cxf/tools/common/toolspec/ToolSpec.java
+++ b/tools/common/src/main/java/org/apache/cxf/tools/common/toolspec/ToolSpec.java
@@ -167,7 +167,7 @@ public class ToolSpec {
         List<Element> elemList = DOMUtils.findAllElementsByTagNameNS(doc.getDocumentElement(),
                                                                      Tool.TOOL_SPEC_PUBLIC_ID,
                                                                      "streams");
-        if (elemList.size() > 0) {
+        if (!elemList.isEmpty()) {
             return elemList.get(0);
         } else {
             return null;
@@ -223,7 +223,7 @@ public class ToolSpec {
         List<Element> elemList = DOMUtils.findAllElementsByTagNameNS(doc.getDocumentElement(),
                                             Tool.TOOL_SPEC_PUBLIC_ID,
                                             "pipeline");
-        if (elemList.size() > 0) {
+        if (!elemList.isEmpty()) {
             return elemList.get(0);
         } else {
             return null;
@@ -283,7 +283,7 @@ public class ToolSpec {
                     DOMUtils.findAllElementsByTagNameNS(el,
                                                         "http://cxf.apache.org/Xpipe/ToolSpecification",
                                                         "associatedArgument");
-                if (elemList.size() > 0) {
+                if (!elemList.isEmpty()) {
                     Element assArg = elemList.get(0);
                     if (assArg.hasAttribute("default")) {
                         return assArg.getAttribute("default");

http://git-wip-us.apache.org/repos/asf/cxf/blob/003fb1e7/tools/common/src/main/java/org/apache/cxf/tools/common/toolspec/parser/CommandLineParser.java
----------------------------------------------------------------------
diff --git a/tools/common/src/main/java/org/apache/cxf/tools/common/toolspec/parser/CommandLineParser.java b/tools/common/src/main/java/org/apache/cxf/tools/common/toolspec/parser/CommandLineParser.java
index 9f8f6ec..a1f0b06 100644
--- a/tools/common/src/main/java/org/apache/cxf/tools/common/toolspec/parser/CommandLineParser.java
+++ b/tools/common/src/main/java/org/apache/cxf/tools/common/toolspec/parser/CommandLineParser.java
@@ -121,7 +121,7 @@ public class CommandLineParser {
             LOG.fine("Found " + usageForms.size()
                       + " alternative forms of usage, will use default form");
         }
-        if (usageForms.size() > 0) {
+        if (!usageForms.isEmpty()) {
             ErrorVisitor errors = new ErrorVisitor();
 
             for (Element elem : usageForms) {
@@ -333,7 +333,7 @@ public class CommandLineParser {
                                                                      "annotation");
 
 
-        if ((annotations != null) && (annotations.size() > 0)) {
+        if ((annotations != null) && (!annotations.isEmpty())) {
             result = annotations.get(0).getFirstChild().getNodeValue();
         }
         return result;

http://git-wip-us.apache.org/repos/asf/cxf/blob/003fb1e7/tools/common/src/main/java/org/apache/cxf/tools/common/toolspec/parser/Option.java
----------------------------------------------------------------------
diff --git a/tools/common/src/main/java/org/apache/cxf/tools/common/toolspec/parser/Option.java b/tools/common/src/main/java/org/apache/cxf/tools/common/toolspec/parser/Option.java
index fb22a56..c8b531e 100644
--- a/tools/common/src/main/java/org/apache/cxf/tools/common/toolspec/parser/Option.java
+++ b/tools/common/src/main/java/org/apache/cxf/tools/common/toolspec/parser/Option.java
@@ -48,21 +48,21 @@ public class Option implements TokenConsumer {
         List<Element> elemList = DOMUtils.findAllElementsByTagNameNS(element,
                                                                      Tool.TOOL_SPEC_PUBLIC_ID,
                                                                      "associatedArgument");
-        if (elemList != null && elemList.size() > 0) {
+        if (elemList != null && !elemList.isEmpty()) {
             argument = elemList.get(0);
         }
 
         elemList = DOMUtils.findAllElementsByTagNameNS(element,
                                                        Tool.TOOL_SPEC_PUBLIC_ID,
                                                        "annotation");
-        if (elemList != null && elemList.size() > 0) {
+        if (elemList != null && !elemList.isEmpty()) {
             annotation = elemList.get(0);
         }
 
         if (annotation == null && argument != null) {
             elemList = DOMUtils.findAllElementsByTagNameNS(argument, Tool.TOOL_SPEC_PUBLIC_ID, "annotation");
 
-            if (elemList != null && elemList.size() > 0) {
+            if (elemList != null && !elemList.isEmpty()) {
                 annotation = elemList.get(0);
             }
         }
@@ -165,7 +165,7 @@ public class Option implements TokenConsumer {
         //NodeList list = argument.getElementsByTagNameNS(Tool.TOOL_SPEC_PUBLIC_ID, "valuetype");
         String valuetypeStr = null;
 
-        if (list != null && list.size() > 0) {
+        if (list != null && !list.isEmpty()) {
             valueType = list.get(0);
             valuetypeStr = valueType.getFirstChild().getNodeValue();
 

http://git-wip-us.apache.org/repos/asf/cxf/blob/003fb1e7/tools/common/src/main/java/org/apache/cxf/tools/util/JAXBUtils.java
----------------------------------------------------------------------
diff --git a/tools/common/src/main/java/org/apache/cxf/tools/util/JAXBUtils.java b/tools/common/src/main/java/org/apache/cxf/tools/util/JAXBUtils.java
index 6ca750c..cb21444 100644
--- a/tools/common/src/main/java/org/apache/cxf/tools/util/JAXBUtils.java
+++ b/tools/common/src/main/java/org/apache/cxf/tools/util/JAXBUtils.java
@@ -43,7 +43,7 @@ public final class JAXBUtils {
         String schemaNamespace = schema.getNamespaceURI();
         List<Element> annoList = DOMUtils.findAllElementsByTagNameNS(schema, schemaNamespace, "annotation");
         Element annotation = null;
-        if (annoList.size() > 0) {
+        if (!annoList.isEmpty()) {
             annotation = annoList.get(0);
         } else {
             annotation = schema.getOwnerDocument().createElementNS(schemaNamespace, "annotation");
@@ -52,7 +52,7 @@ public final class JAXBUtils {
                                                                     schemaNamespace,
                                                                     "appinfo");
         Element appInfo = null;
-        if (appList.size() > 0) {
+        if (!appList.isEmpty()) {
             appInfo = appList.get(0);
         } else {
             appInfo = schema.getOwnerDocument().createElementNS(schemaNamespace, "appinfo");
@@ -63,7 +63,7 @@ public final class JAXBUtils {
         List<Element> jaxbList = DOMUtils.findAllElementsByTagNameNS(schema,
                                                                      ToolConstants.NS_JAXB_BINDINGS,
                                                                      "schemaBindings");
-        if (jaxbList.size() > 0) {
+        if (!jaxbList.isEmpty()) {
             jaxbBindings = jaxbList.get(0);
         } else {
             jaxbBindings = schema.getOwnerDocument().createElementNS(ToolConstants.NS_JAXB_BINDINGS,
@@ -91,7 +91,7 @@ public final class JAXBUtils {
                                                                     ToolConstants.NS_JAXB_BINDINGS,
                                                                     "package");
         Element packagename = null;
-        if (pkgList.size() > 0) {
+        if (!pkgList.isEmpty()) {
             packagename = pkgList.get(0);
         } else {
             packagename = doc.createElementNS(ToolConstants.NS_JAXB_BINDINGS, "package");

http://git-wip-us.apache.org/repos/asf/cxf/blob/003fb1e7/tools/corba/src/main/java/org/apache/cxf/tools/corba/common/ProcessorEnvironment.java
----------------------------------------------------------------------
diff --git a/tools/corba/src/main/java/org/apache/cxf/tools/corba/common/ProcessorEnvironment.java b/tools/corba/src/main/java/org/apache/cxf/tools/corba/common/ProcessorEnvironment.java
index 2bbf10d..3c676e9 100644
--- a/tools/corba/src/main/java/org/apache/cxf/tools/corba/common/ProcessorEnvironment.java
+++ b/tools/corba/src/main/java/org/apache/cxf/tools/corba/common/ProcessorEnvironment.java
@@ -163,6 +163,6 @@ public class ProcessorEnvironment {
     }
 
     public boolean isExcludeNamespaceEnabled() {
-        return excludeNamespacePackageMap.size() > 0;
+        return !excludeNamespacePackageMap.isEmpty();
     }
 }

http://git-wip-us.apache.org/repos/asf/cxf/blob/003fb1e7/tools/corba/src/main/java/org/apache/cxf/tools/corba/common/idltypes/IdlRoot.java
----------------------------------------------------------------------
diff --git a/tools/corba/src/main/java/org/apache/cxf/tools/corba/common/idltypes/IdlRoot.java b/tools/corba/src/main/java/org/apache/cxf/tools/corba/common/idltypes/IdlRoot.java
index 7c42840..11f6f47 100644
--- a/tools/corba/src/main/java/org/apache/cxf/tools/corba/common/idltypes/IdlRoot.java
+++ b/tools/corba/src/main/java/org/apache/cxf/tools/corba/common/idltypes/IdlRoot.java
@@ -80,7 +80,7 @@ public final class IdlRoot extends IdlScopeBase {
             pw.println("#include " + s);
         }
 
-        if (includeList.size() > 0) {
+        if (!includeList.isEmpty()) {
             pw.println();
         }
 

http://git-wip-us.apache.org/repos/asf/cxf/blob/003fb1e7/tools/corba/src/main/java/org/apache/cxf/tools/corba/idlpreprocessor/IdlPreprocessorReader.java
----------------------------------------------------------------------
diff --git a/tools/corba/src/main/java/org/apache/cxf/tools/corba/idlpreprocessor/IdlPreprocessorReader.java b/tools/corba/src/main/java/org/apache/cxf/tools/corba/idlpreprocessor/IdlPreprocessorReader.java
index baa34a6..f13a421 100644
--- a/tools/corba/src/main/java/org/apache/cxf/tools/corba/idlpreprocessor/IdlPreprocessorReader.java
+++ b/tools/corba/src/main/java/org/apache/cxf/tools/corba/idlpreprocessor/IdlPreprocessorReader.java
@@ -336,7 +336,7 @@ public final class IdlPreprocessorReader extends Reader {
             buf.append(LF);
         }
         try {
-            if (includeStack.size() > 0) {
+            if (!includeStack.isEmpty()) {
                 final IncludeStackEntry newTopEntry = includeStack.peek();
                 final LineNumberReader reader = getReader();
                 final int lineNumber = reader.getLineNumber();

http://git-wip-us.apache.org/repos/asf/cxf/blob/003fb1e7/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/wsdl/WSDLParameter.java
----------------------------------------------------------------------
diff --git a/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/wsdl/WSDLParameter.java b/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/wsdl/WSDLParameter.java
index a2e23f9..a770242 100644
--- a/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/wsdl/WSDLParameter.java
+++ b/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/wsdl/WSDLParameter.java
@@ -302,7 +302,7 @@ public final class WSDLParameter {
 
     private void processReturnParams(List<ParamType> outputs, List<ArgType> returns) {
 
-        if (outputs.size() > 0) {
+        if (!outputs.isEmpty()) {
             ParamType d2 = outputs.get(0);
 
             if (d2.getMode().value().equals("out")) {

http://git-wip-us.apache.org/repos/asf/cxf/blob/003fb1e7/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/wsdl/WSDLToCorbaBinding.java
----------------------------------------------------------------------
diff --git a/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/wsdl/WSDLToCorbaBinding.java b/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/wsdl/WSDLToCorbaBinding.java
index d471369..9c85845 100644
--- a/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/wsdl/WSDLToCorbaBinding.java
+++ b/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/wsdl/WSDLToCorbaBinding.java
@@ -138,7 +138,7 @@ public class WSDLToCorbaBinding {
         helper.setXMLSchemaList(xmlSchemaList);
 
         List<PortType> intfs = null;
-        if (interfaceNames.size() > 0) {
+        if (!interfaceNames.isEmpty()) {
             intfs = new ArrayList<>(interfaceNames.size());
 
             for (String interfaceName : interfaceNames) {

http://git-wip-us.apache.org/repos/asf/cxf/blob/003fb1e7/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/wsdl/WSDLToCorbaProcessor.java
----------------------------------------------------------------------
diff --git a/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/wsdl/WSDLToCorbaProcessor.java b/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/wsdl/WSDLToCorbaProcessor.java
index c314666..ea67dfc 100644
--- a/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/wsdl/WSDLToCorbaProcessor.java
+++ b/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/wsdl/WSDLToCorbaProcessor.java
@@ -167,7 +167,7 @@ public class WSDLToCorbaProcessor extends WSDLToProcessor {
                 } else {
                     //try to get the binding name from the wsdlToCorbaBinding
                     java.util.List<String> bindingNames = wsdlToCorbaBinding.getGeneratedBindingNames();
-                    if ((bindingNames != null) && (bindingNames.size() > 0)) {
+                    if ((bindingNames != null) && (!bindingNames.isEmpty())) {
                         idlAction.setBindingName(bindingNames.get(0));
                         if (bindingNames.size() > 1) {
                             System.err.println("Warning: Generating idl only for the binding "

http://git-wip-us.apache.org/repos/asf/cxf/blob/003fb1e7/tools/validator/src/main/java/org/apache/cxf/tools/validator/internal/ValidationResult.java
----------------------------------------------------------------------
diff --git a/tools/validator/src/main/java/org/apache/cxf/tools/validator/internal/ValidationResult.java b/tools/validator/src/main/java/org/apache/cxf/tools/validator/internal/ValidationResult.java
index 7535555..b1eff09 100644
--- a/tools/validator/src/main/java/org/apache/cxf/tools/validator/internal/ValidationResult.java
+++ b/tools/validator/src/main/java/org/apache/cxf/tools/validator/internal/ValidationResult.java
@@ -52,7 +52,7 @@ public final class ValidationResult {
     }
 
     public boolean hasWarnings() {
-        return warnings.size() > 0;
+        return !warnings.isEmpty();
     }
 
     public boolean isSuccessful() {
@@ -66,14 +66,14 @@ public final class ValidationResult {
         sb.append(errors.size());
         sb.append(", Warnings: ");
         sb.append(warnings.size());
-        if (errors.size() > 0) {
+        if (!errors.isEmpty()) {
             sb.append("\n\n <<< ERROR! \n");
             while (!errors.empty()) {
                 sb.append(errors.pop());
                 sb.append("\n");
             }
         }
-        if (warnings.size() > 0) {
+        if (!warnings.isEmpty()) {
             sb.append("\n <<< WARNING! \n");
             while (!warnings.empty()) {
                 sb.append(warnings.pop());

http://git-wip-us.apache.org/repos/asf/cxf/blob/003fb1e7/tools/wadlto/jaxrs/src/main/java/org/apache/cxf/tools/wadlto/jaxrs/SourceGenerator.java
----------------------------------------------------------------------
diff --git a/tools/wadlto/jaxrs/src/main/java/org/apache/cxf/tools/wadlto/jaxrs/SourceGenerator.java b/tools/wadlto/jaxrs/src/main/java/org/apache/cxf/tools/wadlto/jaxrs/SourceGenerator.java
index 4a8a3c5..4dc3619 100644
--- a/tools/wadlto/jaxrs/src/main/java/org/apache/cxf/tools/wadlto/jaxrs/SourceGenerator.java
+++ b/tools/wadlto/jaxrs/src/main/java/org/apache/cxf/tools/wadlto/jaxrs/SourceGenerator.java
@@ -1148,7 +1148,7 @@ public class SourceGenerator {
         if (!suspendedAsync && !responseRequired && responseEls.size() == 1 && generateResponseIfHeadersSet) {
             List<Element> outResponseParamElements =
                 getParameters(responseEls.get(0), Collections.<Element>emptyList(), false);
-            if (outResponseParamElements.size() > 0) {
+            if (!outResponseParamElements.isEmpty()) {
                 writeJaxrResponse(sbCode, imports);
                 return true;
             }
@@ -1268,7 +1268,7 @@ public class SourceGenerator {
             if (generateEnums) {
                 List<Element> options =
                     DOMUtils.findAllElementsByTagNameNS(paramEl, getWadlNamespace(), "option");
-                if (options.size() > 0) {
+                if (!options.isEmpty()) {
                     generateEnumClass(getTypicalClassName(name), options, info.getSrcDir(), classPackage);
                     enumCreated = true;
                 }
@@ -1353,7 +1353,7 @@ public class SourceGenerator {
             elementParamName = !multipart ? "map" : "body";
         }
         if (elementParamType != null) {
-            if (inParamEls.size() > 0) {
+            if (!inParamEls.isEmpty()) {
                 sbCode.append(", ");
             }
             if (writeBeanValidation) {
@@ -1367,7 +1367,7 @@ public class SourceGenerator {
             writeMethodParamDocs(repElement, elementParamName, sbMethodDocs);
         }
         if (suspendedAsync) {
-            if (inParamEls.size() > 0 || elementParamType != null) {
+            if (!inParamEls.isEmpty() || elementParamType != null) {
                 sbCode.append(", ");
             }
             if (writeAnnotations) {
@@ -1883,7 +1883,7 @@ public class SourceGenerator {
         compiler.setErrorListener(elForRun);
         compiler.setEntityResolver(OASISCatalogManager.getCatalogManager(bus)
                                        .getEntityResolver());
-        if (compilerArgs.size() > 0) {
+        if (!compilerArgs.isEmpty()) {
             compiler.getOptions().addGrammar(new InputSource("null"));
             compiler.getOptions().parseArguments(compilerArgs.toArray(new String[compilerArgs.size()]));
         }

http://git-wip-us.apache.org/repos/asf/cxf/blob/003fb1e7/tools/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/core/PluginLoader.java
----------------------------------------------------------------------
diff --git a/tools/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/core/PluginLoader.java b/tools/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/core/PluginLoader.java
index e1e73b3..3d83608 100644
--- a/tools/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/core/PluginLoader.java
+++ b/tools/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/core/PluginLoader.java
@@ -56,8 +56,8 @@ import org.apache.cxf.tools.plugin.Generator;
 import org.apache.cxf.tools.plugin.Plugin;
 
 public final class PluginLoader {
-    private static final Logger LOG = LogUtils.getL7dLogger(PluginLoader.class);
     public static final String DEFAULT_PROVIDER_NAME = "cxf.apache.org";
+    public static final Logger LOG = LogUtils.getL7dLogger(PluginLoader.class);
     private static PluginLoader pluginLoader;
     private static final String PLUGIN_FILE_NAME = "META-INF/tools-plugin.xml";
 

http://git-wip-us.apache.org/repos/asf/cxf/blob/003fb1e7/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/HandlerConfigGenerator.java
----------------------------------------------------------------------
diff --git a/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/HandlerConfigGenerator.java b/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/HandlerConfigGenerator.java
index f5e0be3..ba3d76a 100644
--- a/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/HandlerConfigGenerator.java
+++ b/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/HandlerConfigGenerator.java
@@ -75,7 +75,7 @@ public class HandlerConfigGenerator extends AbstractJAXWSGenerator {
         List<Element> elemList = DOMUtils.findAllElementsByTagNameNS(e,
                                                                      ToolConstants.HANDLER_CHAINS_URI,
                                                                      ToolConstants.HANDLER_CHAIN);
-        if (elemList.size() > 0) {
+        if (!elemList.isEmpty()) {
             String fName = ProcessorUtil.getHandlerConfigFileName(this.intf.getName());
             handlerChainAnnotation = new JAnnotation(HandlerChain.class);
             handlerChainAnnotation.addElement(new JAnnotationElement("name",

http://git-wip-us.apache.org/repos/asf/cxf/blob/003fb1e7/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/ParameterProcessor.java
----------------------------------------------------------------------
diff --git a/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/ParameterProcessor.java b/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/ParameterProcessor.java
index ce72ea6..59ee6ce 100644
--- a/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/ParameterProcessor.java
+++ b/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/ParameterProcessor.java
@@ -601,7 +601,7 @@ public class ParameterProcessor extends AbstractProcessor {
 
             if (inputMessage != null) {
                 List<MessagePartInfo> inputParts = inputMessage.getMessageParts();
-                MessagePartInfo inputPart = inputParts.size() > 0 ? inputParts.iterator().next() : null;
+                MessagePartInfo inputPart = !inputParts.isEmpty() ? inputParts.iterator().next() : null;
                 List<QName> inputWrapElement = null;
                 if (inputPart != null && inputPart.isElement()) {
                     inputWrapElement = ProcessorUtil.getWrappedElementQNames(context,
@@ -620,7 +620,7 @@ public class ParameterProcessor extends AbstractProcessor {
             }
             if (outputMessage != null) {
                 List<MessagePartInfo> outputParts = outputMessage.getMessageParts();
-                MessagePartInfo outputPart = outputParts.size() > 0 ? outputParts.iterator().next() : null;
+                MessagePartInfo outputPart = !outputParts.isEmpty() ? outputParts.iterator().next() : null;
                 List<QName> outputWrapElement = null;
                 if (outputPart != null && outputPart.isElement()) {
                     outputWrapElement = ProcessorUtil.getWrappedElementQNames(context,

http://git-wip-us.apache.org/repos/asf/cxf/blob/003fb1e7/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/validator/UniqueBodyValidator.java
----------------------------------------------------------------------
diff --git a/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/validator/UniqueBodyValidator.java b/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/validator/UniqueBodyValidator.java
index f0baa66..db434f3 100644
--- a/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/validator/UniqueBodyValidator.java
+++ b/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/validator/UniqueBodyValidator.java
@@ -40,7 +40,7 @@ import org.apache.cxf.service.model.ServiceInfo;
 import org.apache.cxf.tools.validator.ServiceValidator;
 
 public class UniqueBodyValidator extends ServiceValidator {
-    private static final Logger LOG = LogUtils.getL7dLogger(UniqueBodyValidator.class);
+    public static final Logger LOG = LogUtils.getL7dLogger(UniqueBodyValidator.class);
 
     public UniqueBodyValidator() {
     }

http://git-wip-us.apache.org/repos/asf/cxf/blob/003fb1e7/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/JAXWSContainerTest.java
----------------------------------------------------------------------
diff --git a/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/JAXWSContainerTest.java b/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/JAXWSContainerTest.java
index c375ab0..582fd65 100644
--- a/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/JAXWSContainerTest.java
+++ b/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/JAXWSContainerTest.java
@@ -226,7 +226,7 @@ public class JAXWSContainerTest extends ProcessorTestBase {
         JAXWSContainer container = new JAXWSContainer(null);
         List<ServiceValidator> validators = container.getServiceValidators();
         assertNotNull(validators);
-        assertTrue(validators.size() > 0);
+        assertTrue(!validators.isEmpty());
     }
 
     protected String getLocation(String wsdlFile) throws URISyntaxException {


Mime
View raw message