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: Fixing PMD
Date Tue, 15 Dec 2015 14:53:30 GMT
Repository: cxf-fediz
Updated Branches:
  refs/heads/1.2.x-fixes 6bdaf927b -> b6026725d


Fixing PMD


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

Branch: refs/heads/1.2.x-fixes
Commit: b6026725d38dcd9040a024c76bf2e7809ab61290
Parents: 6bdaf92
Author: Colm O hEigeartaigh <coheigea@apache.org>
Authored: Tue Dec 15 13:04:09 2015 +0000
Committer: Colm O hEigeartaigh <coheigea@apache.org>
Committed: Tue Dec 15 14:53:18 2015 +0000

----------------------------------------------------------------------
 .../apache/cxf/fediz/core/saml/SAMLTokenValidator.java  | 12 +++---------
 .../org/apache/cxf/fediz/core/util/CookieUtils.java     |  6 +-----
 .../org/apache/cxf/fediz/core/util/StringUtils.java     |  5 +----
 pom.xml                                                 |  5 -----
 .../idp/kerberos/KerberosServiceRequestToken.java       |  2 +-
 5 files changed, 6 insertions(+), 24 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/b6026725/plugins/core/src/main/java/org/apache/cxf/fediz/core/saml/SAMLTokenValidator.java
----------------------------------------------------------------------
diff --git a/plugins/core/src/main/java/org/apache/cxf/fediz/core/saml/SAMLTokenValidator.java
b/plugins/core/src/main/java/org/apache/cxf/fediz/core/saml/SAMLTokenValidator.java
index 81f73f8..7174afc 100644
--- a/plugins/core/src/main/java/org/apache/cxf/fediz/core/saml/SAMLTokenValidator.java
+++ b/plugins/core/src/main/java/org/apache/cxf/fediz/core/saml/SAMLTokenValidator.java
@@ -71,20 +71,14 @@ public class SAMLTokenValidator implements TokenValidator {
 
     @Override
     public boolean canHandleTokenType(String tokenType) {
-        if (WSConstants.WSS_SAML2_TOKEN_TYPE.equals(tokenType) || WSConstants.SAML2_NS.equals(tokenType)
-            || WSConstants.WSS_SAML_TOKEN_TYPE.equals(tokenType) || WSConstants.SAML_NS.equals(tokenType))
{
-            return true;
-        }
-        return false;
+        return WSConstants.WSS_SAML2_TOKEN_TYPE.equals(tokenType) || WSConstants.SAML2_NS.equals(tokenType)
+            || WSConstants.WSS_SAML_TOKEN_TYPE.equals(tokenType) || WSConstants.SAML_NS.equals(tokenType);
     }
 
     @Override
     public boolean canHandleToken(Element token) {
         String ns = token.getNamespaceURI();
-        if (WSConstants.SAML2_NS.equals(ns) || WSConstants.SAML_NS.equals(ns)) {
-            return true;
-        }
-        return false;
+        return WSConstants.SAML2_NS.equals(ns) || WSConstants.SAML_NS.equals(ns);
     }
     
     public TokenValidatorResponse validateAndProcessToken(TokenValidatorRequest request,

http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/b6026725/plugins/core/src/main/java/org/apache/cxf/fediz/core/util/CookieUtils.java
----------------------------------------------------------------------
diff --git a/plugins/core/src/main/java/org/apache/cxf/fediz/core/util/CookieUtils.java b/plugins/core/src/main/java/org/apache/cxf/fediz/core/util/CookieUtils.java
index d99a9c2..232514d 100644
--- a/plugins/core/src/main/java/org/apache/cxf/fediz/core/util/CookieUtils.java
+++ b/plugins/core/src/main/java/org/apache/cxf/fediz/core/util/CookieUtils.java
@@ -80,11 +80,7 @@ public final class CookieUtils  {
             return true;
         }
         
-        if (detectExpiredTokens && expiresAt > 0 && currentTime.after(new
Date(expiresAt))) {
-            return true;
-        }
-        
-        return false;
+        return detectExpiredTokens && expiresAt > 0 && currentTime.after(new
Date(expiresAt));
     }
     
 }

http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/b6026725/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 6f5d0b3..cb07403 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
@@ -89,10 +89,7 @@ public final class StringUtils {
         if (list == null || list.size() == 0) {
             return true;
         }
-        if (list.size() == 1 && isEmpty(list.get(0))) {
-            return true;
-        }
-        return false;
+        return list.size() == 1 && isEmpty(list.get(0));
     }
 
     public static boolean isEqualUri(String uri1, String uri2) {

http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/b6026725/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index f3eb9d9..0a7a610 100644
--- a/pom.xml
+++ b/pom.xml
@@ -517,11 +517,6 @@
                             <artifactId>cxf-buildtools</artifactId>
                             <version>${cxf.build-utils.version}</version>
                         </dependency>
-                        <dependency>
-                            <groupId>net.sourceforge.pmd</groupId>
-                            <artifactId>pmd</artifactId>
-                            <version>5.0.4</version>
-                        </dependency>
                     </dependencies>
                     <configuration>
                         <rulesets>

http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/b6026725/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/kerberos/KerberosServiceRequestToken.java
----------------------------------------------------------------------
diff --git a/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/kerberos/KerberosServiceRequestToken.java
b/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/kerberos/KerberosServiceRequestToken.java
index ecee024..40308e4 100644
--- a/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/kerberos/KerberosServiceRequestToken.java
+++ b/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/kerberos/KerberosServiceRequestToken.java
@@ -111,7 +111,7 @@ public class KerberosServiceRequestToken extends AbstractAuthenticationToken
{
             return false;
         }
         KerberosServiceRequestToken other = (KerberosServiceRequestToken) obj;
-        if (!Arrays.equals(token, other.token)) {
+        if (!Arrays.equals(token, other.token)) {       //NOPMD
             return false;
         }
         return true;


Mime
View raw message