directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject directory-kerby git commit: More PMD work
Date Tue, 21 Apr 2015 10:18:00 GMT
Repository: directory-kerby
Updated Branches:
  refs/heads/master 46bfd66c1 -> 358277ee7


More PMD work


Project: http://git-wip-us.apache.org/repos/asf/directory-kerby/repo
Commit: http://git-wip-us.apache.org/repos/asf/directory-kerby/commit/358277ee
Tree: http://git-wip-us.apache.org/repos/asf/directory-kerby/tree/358277ee
Diff: http://git-wip-us.apache.org/repos/asf/directory-kerby/diff/358277ee

Branch: refs/heads/master
Commit: 358277ee7b2377167fe05527b0cc7afbee033acb
Parents: 46bfd66
Author: Colm O hEigeartaigh <coheigea@apache.org>
Authored: Tue Apr 21 11:17:52 2015 +0100
Committer: Colm O hEigeartaigh <coheigea@apache.org>
Committed: Tue Apr 21 11:17:52 2015 +0100

----------------------------------------------------------------------
 .../apache/kerby/kerberos/kerb/KrbCodec.java    |  1 -
 .../apache/kerby/kerberos/kerb/KrbConstant.java |  4 +--
 .../kerby/kerberos/kerb/provider/PkiLoader.java |  8 ++---
 .../kerberos/kerb/provider/PkiProvider.java     |  2 +-
 .../kerberos/kerb/provider/TokenDecoder.java    |  4 +--
 .../kerberos/kerb/provider/TokenEncoder.java    |  4 +--
 .../kerberos/kerb/provider/TokenProvider.java   |  6 ++--
 .../kerby/kerberos/kerb/spec/KrbEnum.java       |  2 +-
 .../kerberos/kerb/spec/base/AuthToken.java      | 36 ++++++++++----------
 .../kerby/kerberos/kerb/spec/base/CheckSum.java | 12 +++++++
 .../kerberos/kerb/spec/base/EncryptedData.java  | 12 +++++++
 .../kerberos/kerb/spec/base/EncryptionKey.java  | 12 +++++++
 12 files changed, 69 insertions(+), 34 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/358277ee/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/KrbCodec.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/KrbCodec.java
b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/KrbCodec.java
index 6992dd5..22aef0f 100644
--- a/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/KrbCodec.java
+++ b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/KrbCodec.java
@@ -22,7 +22,6 @@ package org.apache.kerby.kerberos.kerb;
 import org.apache.kerby.asn1.LimitedByteBuffer;
 import org.apache.kerby.asn1.type.AbstractAsn1Type;
 import org.apache.kerby.asn1.type.Asn1Type;
-import org.apache.kerby.kerberos.kerb.KrbException;
 import org.apache.kerby.kerberos.kerb.spec.ap.ApReq;
 import org.apache.kerby.kerberos.kerb.spec.base.KrbMessage;
 import org.apache.kerby.kerberos.kerb.spec.base.KrbMessageType;

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/358277ee/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/KrbConstant.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/KrbConstant.java
b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/KrbConstant.java
index e6eabcb..a41f2a6 100644
--- a/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/KrbConstant.java
+++ b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/KrbConstant.java
@@ -20,7 +20,7 @@
 package org.apache.kerby.kerberos.kerb;
 
 public interface KrbConstant {
-    public final static int KRB_V5 = 5;
+    int KRB_V5 = 5;
 
-    public final static String TGS_PRINCIPAL = "krbtgt";
+    String TGS_PRINCIPAL = "krbtgt";
 }

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/358277ee/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/provider/PkiLoader.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/provider/PkiLoader.java
b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/provider/PkiLoader.java
index d2a7dd0..42e232f 100644
--- a/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/provider/PkiLoader.java
+++ b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/provider/PkiLoader.java
@@ -37,7 +37,7 @@ public interface PkiLoader {
      * @return
      * @throws KrbException
      */
-    public List<Certificate> loadCerts(String certFile) throws KrbException;
+    List<Certificate> loadCerts(String certFile) throws KrbException;
 
     /**
      * Load certificates from an input stream.
@@ -45,7 +45,7 @@ public interface PkiLoader {
      * @return
      * @throws KrbException
      */
-    public List<Certificate> loadCerts(InputStream inputStream) throws KrbException;
+    List<Certificate> loadCerts(InputStream inputStream) throws KrbException;
 
     /**
      * Load private key from a key file with a password.
@@ -54,7 +54,7 @@ public interface PkiLoader {
      * @return private key
      * @throws KrbException
      */
-    public PrivateKey loadPrivateKey(String keyFile,
+    PrivateKey loadPrivateKey(String keyFile,
                                     String password) throws KrbException;
 
     /**
@@ -64,7 +64,7 @@ public interface PkiLoader {
      * @return private key
      * @throws KrbException
      */
-    public PrivateKey loadPrivateKey(InputStream inputStream,
+    PrivateKey loadPrivateKey(InputStream inputStream,
                                     String password) throws KrbException;
 
 }

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/358277ee/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/provider/PkiProvider.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/provider/PkiProvider.java
b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/provider/PkiProvider.java
index f1f2b4e..70edeac 100644
--- a/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/provider/PkiProvider.java
+++ b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/provider/PkiProvider.java
@@ -28,6 +28,6 @@ public interface PkiProvider extends KrbProvider {
      * Create a pki loader.
      * @return pki loader
      */
-    public PkiLoader createPkiLoader();
+    PkiLoader createPkiLoader();
 
 }

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/358277ee/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/provider/TokenDecoder.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/provider/TokenDecoder.java
b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/provider/TokenDecoder.java
index 847dec6..90e9260 100644
--- a/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/provider/TokenDecoder.java
+++ b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/provider/TokenDecoder.java
@@ -33,12 +33,12 @@ public interface TokenDecoder {
      * @param content
      * @return token
      */
-    public AuthToken decodeFromBytes(byte[] content) throws IOException;
+    AuthToken decodeFromBytes(byte[] content) throws IOException;
 
     /**
      * Decode a token from a string.
      * @param content
      * @return token
      */
-    public AuthToken decodeFromString(String content) throws IOException;
+    AuthToken decodeFromString(String content) throws IOException;
 }

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/358277ee/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/provider/TokenEncoder.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/provider/TokenEncoder.java
b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/provider/TokenEncoder.java
index 879dea2..15d1483 100644
--- a/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/provider/TokenEncoder.java
+++ b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/provider/TokenEncoder.java
@@ -32,14 +32,14 @@ public interface TokenEncoder {
      * @param token
      * @return bytes array
      */
-    public byte[] encodeAsBytes(AuthToken token) throws KrbException;
+    byte[] encodeAsBytes(AuthToken token) throws KrbException;
 
     /**
      * Encode a token resulting in a string.
      * @param token
      * @return string representation
      */
-    public String encodeAsString(AuthToken token) throws KrbException;
+    String encodeAsString(AuthToken token) throws KrbException;
 
 
 }

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/358277ee/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/provider/TokenProvider.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/provider/TokenProvider.java
b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/provider/TokenProvider.java
index 54ae0b9..0ff548f 100644
--- a/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/provider/TokenProvider.java
+++ b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/provider/TokenProvider.java
@@ -30,18 +30,18 @@ public interface TokenProvider extends KrbProvider {
      * Create a token encoder.
      * @return token encoder
      */
-    public TokenEncoder createTokenEncoder();
+    TokenEncoder createTokenEncoder();
 
     /**
      * Create a token decoder.
      * @return token decoder
      */
-    public TokenDecoder createTokenDecoder();
+    TokenDecoder createTokenDecoder();
 
     /**
      * Create a token factory that can be used to construct concrete token.
      * @return token factory
      */
-    public TokenFactory createTokenFactory();
+    TokenFactory createTokenFactory();
 
 }

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/358277ee/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/spec/KrbEnum.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/spec/KrbEnum.java
b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/spec/KrbEnum.java
index 5eb184c..1cf379b 100644
--- a/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/spec/KrbEnum.java
+++ b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/spec/KrbEnum.java
@@ -20,5 +20,5 @@
 package org.apache.kerby.kerberos.kerb.spec;
 
 public interface KrbEnum {
-    public int getValue();
+    int getValue();
 }

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/358277ee/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/spec/base/AuthToken.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/spec/base/AuthToken.java
b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/spec/base/AuthToken.java
index c30c1b4..d94ec0f 100644
--- a/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/spec/base/AuthToken.java
+++ b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/spec/base/AuthToken.java
@@ -32,109 +32,109 @@ public interface AuthToken {
      * Get the token subject
      * @return token subject
      */
-    public String getSubject();
+    String getSubject();
 
     /**
      * Set token subject
      * @param sub
      */
-    public void setSubject(String sub);
+    void setSubject(String sub);
 
     /**
      * Get the token issuer
      * @return token issuer
      */
-    public String getIssuer();
+    String getIssuer();
 
     /**
      * Set token issuer
      * @param issuer
      */
-    public void setIssuer(String issuer);
+    void setIssuer(String issuer);
 
     /**
      * Get token audiences
      * @return token audiences
      */
-    public List<String> getAudiences();
+    List<String> getAudiences();
 
     /**
      * Set token audiences
      * @param audiences
      */
-    public void setAudiences(List<String> audiences);
+    void setAudiences(List<String> audiences);
 
     /**
      * Is an Identity Token ?
      * @return true if it's an identity token, false otherwise
      */
-    public boolean isIdToken();
+    boolean isIdToken();
 
     /**
      * Is an Access Token ?
      * @return true if it's an access token, false otherwise
      */
-    public boolean isAcToken();
+    boolean isAcToken();
 
     /**
      * Is a Bearer Token ?
      * @return true if it's an bearer token, false otherwise
      */
-    public boolean isBearerToken();
+    boolean isBearerToken();
 
     /**
      * Is an Holder-of-Key Token (HOK) ?
      * @return true if it's a HOK token, false otherwise
      */
-    public boolean isHolderOfKeyToken();
+    boolean isHolderOfKeyToken();
 
     /**
      * Get token expired data time.
      * @return expired time
      */
-    public Date getExpiredTime();
+    Date getExpiredTime();
 
     /**
      * Set token expired time
      * @param exp
      */
-    public void setExpirationTime(Date exp);
+    void setExpirationTime(Date exp);
 
     /**
      * Get token not before time.
      * @return not before time
      */
-    public Date getNotBeforeTime();
+    Date getNotBeforeTime();
 
     /**
      * Set token not before time.
      * @param nbt
      */
-    public void setNotBeforeTime(Date nbt);
+    void setNotBeforeTime(Date nbt);
 
     /**
      * Get token issued at time when the token is issued.
      * @return issued at time
      */
-    public Date getIssueTime();
+    Date getIssueTime();
 
     /**
      * Set token issued at time.
      * @param iat
      */
-    public void setIssueTime(Date iat);
+    void setIssueTime(Date iat);
 
     /**
      * Get token attributes.
      * @return token attributes
      */
-    public Map<String, Object> getAttributes();
+    Map<String, Object> getAttributes();
 
     /**
      * Add a token attribute.
      * @param name
      * @param value
      */
-    public void addAttribute(String name, Object value);
+    void addAttribute(String name, Object value);
 
 }

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/358277ee/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/spec/base/CheckSum.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/spec/base/CheckSum.java
b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/spec/base/CheckSum.java
index 060d537..86ab842 100644
--- a/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/spec/base/CheckSum.java
+++ b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/spec/base/CheckSum.java
@@ -90,6 +90,18 @@ public class CheckSum extends KrbSequenceType {
 
         return Arrays.equals(getChecksum(), that.getChecksum());
     }
+    
+    @Override
+    public int hashCode() {
+        int result = 0;
+        if (getCksumtype() != null) {
+            result = 31 * result + getCksumtype().hashCode();
+        }
+        if (getChecksum() != null) {
+            result = 31 * result + Arrays.hashCode(getChecksum());
+        }
+        return result;
+    }
 
     public boolean isEqual(CheckSum other) {
         return this.equals(other);

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/358277ee/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/spec/base/EncryptedData.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/spec/base/EncryptedData.java
b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/spec/base/EncryptedData.java
index 755a9a1..80f4e04 100644
--- a/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/spec/base/EncryptedData.java
+++ b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/spec/base/EncryptedData.java
@@ -99,4 +99,16 @@ public class EncryptedData extends KrbSequenceType {
 
         return Arrays.equals(getCipher(), that.getCipher());
     }
+    
+    @Override
+    public int hashCode() {
+        int result = 0;
+        if (getEType() != null) {
+            result = 31 * result + getEType().hashCode();
+        }
+        if (getCipher() != null) {
+            result = 31 * result + Arrays.hashCode(getCipher());
+        }
+        return result;
+    }
 }

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/358277ee/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/spec/base/EncryptionKey.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/spec/base/EncryptionKey.java
b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/spec/base/EncryptionKey.java
index 1f25eec..3f9465a 100644
--- a/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/spec/base/EncryptionKey.java
+++ b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/spec/base/EncryptionKey.java
@@ -112,4 +112,16 @@ public class EncryptionKey extends KrbSequenceType {
 
         return Arrays.equals(getKeyData(), that.getKeyData());
     }
+    
+    @Override
+    public int hashCode() {
+        int result = kvno;
+        if (getKeyType() != null) {
+            result = 31 * result + getKeyType().hashCode();
+        }
+        if (getKeyData() != null) {
+            result = 31 * result + Arrays.hashCode(getKeyData());
+        }
+        return result;
+    }
 }


Mime
View raw message