commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dia...@apache.org
Subject commons-crypto git commit: CRYPTO-26: Utility classes should not have public constructors (Dapeng Sun via Dian Fu)
Date Tue, 26 Apr 2016 03:46:14 GMT
Repository: commons-crypto
Updated Branches:
  refs/heads/master ad81d236a -> 081284dce


CRYPTO-26: Utility classes should not have public constructors
(Dapeng Sun via Dian Fu)


Project: http://git-wip-us.apache.org/repos/asf/commons-crypto/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-crypto/commit/081284dc
Tree: http://git-wip-us.apache.org/repos/asf/commons-crypto/tree/081284dc
Diff: http://git-wip-us.apache.org/repos/asf/commons-crypto/diff/081284dc

Branch: refs/heads/master
Commit: 081284dce2be74f32502dec4a80e2fe28189dafb
Parents: ad81d23
Author: dianfu <dianfu@apache.org>
Authored: Tue Apr 26 11:36:24 2016 +0800
Committer: dianfu <dianfu@apache.org>
Committed: Tue Apr 26 11:36:24 2016 +0800

----------------------------------------------------------------------
 src/main/java/org/apache/commons/crypto/cipher/CipherFactory.java | 2 ++
 src/main/java/org/apache/commons/crypto/cipher/OpensslNative.java | 2 ++
 .../java/org/apache/commons/crypto/conf/ConfigurationKeys.java    | 2 ++
 .../apache/commons/crypto/random/OpensslSecureRandomNative.java   | 3 +++
 .../org/apache/commons/crypto/random/SecureRandomFactory.java     | 2 ++
 src/main/java/org/apache/commons/crypto/utils/IOUtils.java        | 2 ++
 .../java/org/apache/commons/crypto/utils/NativeCodeLoader.java    | 2 ++
 src/main/java/org/apache/commons/crypto/utils/OSInfo.java         | 2 ++
 .../java/org/apache/commons/crypto/utils/ReflectionUtils.java     | 2 ++
 src/main/java/org/apache/commons/crypto/utils/Utils.java          | 2 ++
 10 files changed, 21 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-crypto/blob/081284dc/src/main/java/org/apache/commons/crypto/cipher/CipherFactory.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/crypto/cipher/CipherFactory.java b/src/main/java/org/apache/commons/crypto/cipher/CipherFactory.java
index 51ade86..fb712d2 100644
--- a/src/main/java/org/apache/commons/crypto/cipher/CipherFactory.java
+++ b/src/main/java/org/apache/commons/crypto/cipher/CipherFactory.java
@@ -35,6 +35,8 @@ public class CipherFactory {
   /** LOG instance for {@CipherFactory} */
   public final static Logger LOG = LoggerFactory.getLogger(CipherFactory.class);
 
+  private CipherFactory() {}
+
   /**
    * Gets a cipher instance for specified algorithm/mode/padding.
    *

http://git-wip-us.apache.org/repos/asf/commons-crypto/blob/081284dc/src/main/java/org/apache/commons/crypto/cipher/OpensslNative.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/crypto/cipher/OpensslNative.java b/src/main/java/org/apache/commons/crypto/cipher/OpensslNative.java
index 57a8cc7..c3f7593 100644
--- a/src/main/java/org/apache/commons/crypto/cipher/OpensslNative.java
+++ b/src/main/java/org/apache/commons/crypto/cipher/OpensslNative.java
@@ -25,6 +25,8 @@ import java.nio.ByteBuffer;
  */
 public class OpensslNative {
 
+  private OpensslNative() {}
+
   /**
    * Declares a native method to initialize JNI field and method IDs.
    */

http://git-wip-us.apache.org/repos/asf/commons-crypto/blob/081284dc/src/main/java/org/apache/commons/crypto/conf/ConfigurationKeys.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/crypto/conf/ConfigurationKeys.java b/src/main/java/org/apache/commons/crypto/conf/ConfigurationKeys.java
index 24136a3..494c28d 100644
--- a/src/main/java/org/apache/commons/crypto/conf/ConfigurationKeys.java
+++ b/src/main/java/org/apache/commons/crypto/conf/ConfigurationKeys.java
@@ -130,4 +130,6 @@ public class ConfigurationKeys {
    */
   public static final String COMMONS_CRYPTO_LIB_TEMPDIR_KEY =
       CONF_PREFIX + "lib.tempdir";
+
+  private ConfigurationKeys() {}
 }

http://git-wip-us.apache.org/repos/asf/commons-crypto/blob/081284dc/src/main/java/org/apache/commons/crypto/random/OpensslSecureRandomNative.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/crypto/random/OpensslSecureRandomNative.java
b/src/main/java/org/apache/commons/crypto/random/OpensslSecureRandomNative.java
index d80cf89..c36083f 100644
--- a/src/main/java/org/apache/commons/crypto/random/OpensslSecureRandomNative.java
+++ b/src/main/java/org/apache/commons/crypto/random/OpensslSecureRandomNative.java
@@ -23,6 +23,9 @@ package org.apache.commons.crypto.random;
  * OpensslSecureRandomNative.h(genereted by javah).
  */
 public class OpensslSecureRandomNative {
+
+  private OpensslSecureRandomNative() {}
+
   /**
    * Declares a native method to initialize SR.
    */

http://git-wip-us.apache.org/repos/asf/commons-crypto/blob/081284dc/src/main/java/org/apache/commons/crypto/random/SecureRandomFactory.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/crypto/random/SecureRandomFactory.java b/src/main/java/org/apache/commons/crypto/random/SecureRandomFactory.java
index ed416ea..47d4fa8 100644
--- a/src/main/java/org/apache/commons/crypto/random/SecureRandomFactory.java
+++ b/src/main/java/org/apache/commons/crypto/random/SecureRandomFactory.java
@@ -35,6 +35,8 @@ public class SecureRandomFactory {
   public final static Logger LOG = LoggerFactory
       .getLogger(SecureRandomFactory.class);
 
+  private SecureRandomFactory() {}
+
   /**
    * Gets a SecureRandom instance for specified props.
    *

http://git-wip-us.apache.org/repos/asf/commons-crypto/blob/081284dc/src/main/java/org/apache/commons/crypto/utils/IOUtils.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/crypto/utils/IOUtils.java b/src/main/java/org/apache/commons/crypto/utils/IOUtils.java
index 58a20a5..a3ecda4 100644
--- a/src/main/java/org/apache/commons/crypto/utils/IOUtils.java
+++ b/src/main/java/org/apache/commons/crypto/utils/IOUtils.java
@@ -28,6 +28,8 @@ import org.apache.commons.logging.Log;
  */
 public class IOUtils {
 
+  private IOUtils() {}
+
   /**
    * Does the readFully based on the Input read.
    *

http://git-wip-us.apache.org/repos/asf/commons-crypto/blob/081284dc/src/main/java/org/apache/commons/crypto/utils/NativeCodeLoader.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/crypto/utils/NativeCodeLoader.java b/src/main/java/org/apache/commons/crypto/utils/NativeCodeLoader.java
index 17c5528..92f4dba 100644
--- a/src/main/java/org/apache/commons/crypto/utils/NativeCodeLoader.java
+++ b/src/main/java/org/apache/commons/crypto/utils/NativeCodeLoader.java
@@ -43,6 +43,8 @@ public class NativeCodeLoader {
 
   private static boolean nativeCodeLoaded = false;
 
+  private NativeCodeLoader() {}
+
   static {
     // Try to load native library and set fallback flag appropriately
     if(LOG.isDebugEnabled()) {

http://git-wip-us.apache.org/repos/asf/commons-crypto/blob/081284dc/src/main/java/org/apache/commons/crypto/utils/OSInfo.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/crypto/utils/OSInfo.java b/src/main/java/org/apache/commons/crypto/utils/OSInfo.java
index 67f7d56..4cf7420 100644
--- a/src/main/java/org/apache/commons/crypto/utils/OSInfo.java
+++ b/src/main/java/org/apache/commons/crypto/utils/OSInfo.java
@@ -51,6 +51,8 @@ public class OSInfo {
    * The constant string represents for PPC64 architecture, the value is:{@value #PPC64}.*/
   public static final String PPC64 = "ppc64";
 
+  private OSInfo() {}
+
   static {
     // x86 mappings
     archMapping.put(X86, X86);

http://git-wip-us.apache.org/repos/asf/commons-crypto/blob/081284dc/src/main/java/org/apache/commons/crypto/utils/ReflectionUtils.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/crypto/utils/ReflectionUtils.java b/src/main/java/org/apache/commons/crypto/utils/ReflectionUtils.java
index 9ffd7e8..cff9406 100644
--- a/src/main/java/org/apache/commons/crypto/utils/ReflectionUtils.java
+++ b/src/main/java/org/apache/commons/crypto/utils/ReflectionUtils.java
@@ -47,6 +47,8 @@ public class ReflectionUtils {
   private static final Class<?> NEGATIVE_CACHE_SENTINEL =
     NegativeCacheSentinel.class;
 
+  private ReflectionUtils() {}
+
   /**
    * A unique class which is used as a sentinel value in the caching
    * for getClassByName. {@link Cipher#getClassByNameOrNull(String)}.

http://git-wip-us.apache.org/repos/asf/commons-crypto/blob/081284dc/src/main/java/org/apache/commons/crypto/utils/Utils.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/crypto/utils/Utils.java b/src/main/java/org/apache/commons/crypto/utils/Utils.java
index 5b78be8..ec2a1e4 100644
--- a/src/main/java/org/apache/commons/crypto/utils/Utils.java
+++ b/src/main/java/org/apache/commons/crypto/utils/Utils.java
@@ -57,6 +57,8 @@ public class Utils {
    */
   private static final int AES_BLOCK_SIZE = AES_CTR_NOPADDING.getAlgorithmBlockSize();
 
+  private Utils() {}
+
   static {
     loadSystemProperties();
   }


Mime
View raw message