cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject [2/2] cxf-fediz git commit: Updating PMD
Date Tue, 15 Dec 2015 13:06:13 GMT
Updating 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/6068e648
Tree: http://git-wip-us.apache.org/repos/asf/cxf-fediz/tree/6068e648
Diff: http://git-wip-us.apache.org/repos/asf/cxf-fediz/diff/6068e648

Branch: refs/heads/master
Commit: 6068e648cf5cf4416f179fff88f8b813809ae5d4
Parents: 743930a
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 13:04:09 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                                                 |  7 +------
 .../idp/kerberos/KerberosServiceRequestToken.java       |  2 +-
 .../jpa/ApplicationIdpProtocolSupportValidator.java     |  6 +-----
 .../service/jpa/TrustedIdpProtocolSupportValidator.java |  6 +-----
 7 files changed, 9 insertions(+), 35 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/6068e648/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 4e07e76..2344ecb 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/6068e648/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/6068e648/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 9ece30b..04f2112 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/6068e648/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index c47ceb8..8a86875 100644
--- a/pom.xml
+++ b/pom.xml
@@ -516,18 +516,13 @@
                 <plugin>
                     <groupId>org.apache.maven.plugins</groupId>
                     <artifactId>maven-pmd-plugin</artifactId>
-                    <version>3.1</version>
+                    <version>3.5</version>
                     <dependencies>
                         <dependency>
                             <groupId>org.apache.cxf.build-utils</groupId>
                             <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/6068e648/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;

http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/6068e648/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/service/jpa/ApplicationIdpProtocolSupportValidator.java
----------------------------------------------------------------------
diff --git a/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/service/jpa/ApplicationIdpProtocolSupportValidator.java
b/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/service/jpa/ApplicationIdpProtocolSupportValidator.java
index edeafe5..5a999e9 100644
--- a/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/service/jpa/ApplicationIdpProtocolSupportValidator.java
+++ b/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/service/jpa/ApplicationIdpProtocolSupportValidator.java
@@ -44,11 +44,7 @@ public class ApplicationIdpProtocolSupportValidator
     public boolean isValid(String object, ConstraintValidatorContext constraintContext) {
         
         List<String> protocols = applicationProtocolHandlers.getProtocols();
-        if (protocols.contains(object)) {
-            return true;
-        }
-        
-        return false;
+        return protocols.contains(object);
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/6068e648/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/service/jpa/TrustedIdpProtocolSupportValidator.java
----------------------------------------------------------------------
diff --git a/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/service/jpa/TrustedIdpProtocolSupportValidator.java
b/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/service/jpa/TrustedIdpProtocolSupportValidator.java
index 98d4cd2..75ac2ec 100644
--- a/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/service/jpa/TrustedIdpProtocolSupportValidator.java
+++ b/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/service/jpa/TrustedIdpProtocolSupportValidator.java
@@ -44,11 +44,7 @@ public class TrustedIdpProtocolSupportValidator implements ConstraintValidator<T
     public boolean isValid(String object, ConstraintValidatorContext constraintContext) {
         
         List<String> protocols = trustedIdpProtocolHandlers.getProtocols();
-        if (protocols.contains(object)) {
-            return true;
-        }
-        
-        return false;
+        return protocols.contains(object);
     }
 
     @Override


Mime
View raw message