directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From plusplusjia...@apache.org
Subject [31/36] directory-kerby git commit: Fix some findbugs.
Date Mon, 15 Feb 2016 02:42:55 GMT
Fix some findbugs.


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

Branch: refs/heads/kadmin-remote
Commit: 82fd585e001fe7ecb162764be3698b4adce5b8c3
Parents: 6c744f3
Author: plusplusjiajia <jiajia.li@intel.com>
Authored: Fri Jan 29 10:29:25 2016 +0800
Committer: plusplusjiajia <jiajia.li@intel.com>
Committed: Fri Jan 29 10:29:25 2016 +0800

----------------------------------------------------------------------
 .../src/main/java/org/apache/kerby/config/Conf.java     |  2 +-
 .../kerberos/kerb/identity/backend/BackendTestBase.java |  2 +-
 .../kerby/kerberos/provider/token/JwtTokenDecoder.java  | 12 ++++++++++--
 .../kerby/kerberos/provider/token/JwtTokenEncoder.java  | 12 ++++++++++--
 4 files changed, 22 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/82fd585e/kerby-common/kerby-config/src/main/java/org/apache/kerby/config/Conf.java
----------------------------------------------------------------------
diff --git a/kerby-common/kerby-config/src/main/java/org/apache/kerby/config/Conf.java b/kerby-common/kerby-config/src/main/java/org/apache/kerby/config/Conf.java
index c0bea4b..a715089 100644
--- a/kerby-common/kerby-config/src/main/java/org/apache/kerby/config/Conf.java
+++ b/kerby-common/kerby-config/src/main/java/org/apache/kerby/config/Conf.java
@@ -129,7 +129,7 @@ public class Conf implements Config {
     }
 
     @Override
-    public String getString(String name, String defaultValue) {
+    public synchronized String getString(String name, String defaultValue) {
         return config.getString(name, defaultValue);
     }
 

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/82fd585e/kerby-kerb/kerb-identity-test/src/main/java/org/apache/kerby/kerberos/kerb/identity/backend/BackendTestBase.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-identity-test/src/main/java/org/apache/kerby/kerberos/kerb/identity/backend/BackendTestBase.java
b/kerby-kerb/kerb-identity-test/src/main/java/org/apache/kerby/kerberos/kerb/identity/backend/BackendTestBase.java
index 2efbcf2..28f3a2d 100644
--- a/kerby-kerb/kerb-identity-test/src/main/java/org/apache/kerby/kerberos/kerb/identity/backend/BackendTestBase.java
+++ b/kerby-kerb/kerb-identity-test/src/main/java/org/apache/kerby/kerberos/kerb/identity/backend/BackendTestBase.java
@@ -36,7 +36,7 @@ public abstract class BackendTestBase extends BackendTest {
      */
     @BeforeClass
     public static void setup() throws Exception {
-        //backend = prepareBackend();
+        backend = null;
     }
 
     @Test

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/82fd585e/kerby-provider/token-provider/src/main/java/org/apache/kerby/kerberos/provider/token/JwtTokenDecoder.java
----------------------------------------------------------------------
diff --git a/kerby-provider/token-provider/src/main/java/org/apache/kerby/kerberos/provider/token/JwtTokenDecoder.java
b/kerby-provider/token-provider/src/main/java/org/apache/kerby/kerberos/provider/token/JwtTokenDecoder.java
index de5f4f9..f4961e9 100644
--- a/kerby-provider/token-provider/src/main/java/org/apache/kerby/kerberos/provider/token/JwtTokenDecoder.java
+++ b/kerby-provider/token-provider/src/main/java/org/apache/kerby/kerberos/provider/token/JwtTokenDecoder.java
@@ -176,7 +176,11 @@ public class JwtTokenDecoder implements TokenDecoder {
      */
     @Override
     public void setDecryptionKey(byte[] key) {
-        decryptionKey = key;
+        if (key == null) {
+            decryptionKey = new byte[0];
+        } else {
+            decryptionKey = key.clone();
+        }
     }
 
     /**
@@ -222,7 +226,11 @@ public class JwtTokenDecoder implements TokenDecoder {
      */
     @Override
     public void setVerifyKey(byte[] key) {
-        verifyKey = key;
+        if (key == null) {
+            verifyKey = new byte[0];
+        } else {
+            verifyKey = key.clone();
+        }
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/82fd585e/kerby-provider/token-provider/src/main/java/org/apache/kerby/kerberos/provider/token/JwtTokenEncoder.java
----------------------------------------------------------------------
diff --git a/kerby-provider/token-provider/src/main/java/org/apache/kerby/kerberos/provider/token/JwtTokenEncoder.java
b/kerby-provider/token-provider/src/main/java/org/apache/kerby/kerberos/provider/token/JwtTokenEncoder.java
index 7ee7bd4..678442d 100644
--- a/kerby-provider/token-provider/src/main/java/org/apache/kerby/kerberos/provider/token/JwtTokenEncoder.java
+++ b/kerby-provider/token-provider/src/main/java/org/apache/kerby/kerberos/provider/token/JwtTokenEncoder.java
@@ -183,7 +183,11 @@ public class JwtTokenEncoder implements TokenEncoder {
      */
     @Override
     public void setEncryptionKey(byte[] key) {
-        encryptionKey = key;
+        if (key == null) {
+            encryptionKey = new byte[0];
+        } else {
+            encryptionKey = key.clone();
+        }
     }
 
     /**
@@ -199,7 +203,11 @@ public class JwtTokenEncoder implements TokenEncoder {
      */
     @Override
     public void setSignKey(byte[] key) {
-        signKey = key;
+        if (key == null) {
+            signKey = new byte[0];
+        } else {
+            signKey = key.clone();
+        }
     }
     
     public JWEAlgorithm getJweAlgorithm() {


Mime
View raw message