Repository: commons-crypto Updated Branches: refs/heads/master e278580f5 -> 1a33867ff
CRYPTO-74 Full class names make code more difficult to update CIPHER_CLASSES_DEFAULT is only used by CryptoCipherFactory so move it there and make it private Project: http://git-wip-us.apache.org/repos/asf/commons-crypto/repo Commit: http://git-wip-us.apache.org/repos/asf/commons-crypto/commit/1a33867f Tree: http://git-wip-us.apache.org/repos/asf/commons-crypto/tree/1a33867f Diff: http://git-wip-us.apache.org/repos/asf/commons-crypto/diff/1a33867f Branch: refs/heads/master Commit: 1a33867ff4579fafd0edb6485fbbb545c440836d Parents: e278580 Author: Sebb <s...@apache.org> Authored: Sat Jun 25 14:20:09 2016 +0100 Committer: Sebb <s...@apache.org> Committed: Sat Jun 25 14:20:09 2016 +0100 ---------------------------------------------------------------------- .../commons/crypto/cipher/CryptoCipherFactory.java | 12 +++++++++--- .../apache/commons/crypto/conf/ConfigurationKeys.java | 8 -------- 2 files changed, 9 insertions(+), 11 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/commons-crypto/blob/1a33867f/src/main/java/org/apache/commons/crypto/cipher/CryptoCipherFactory.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/commons/crypto/cipher/CryptoCipherFactory.java b/src/main/java/org/apache/commons/crypto/cipher/CryptoCipherFactory.java index cb17169..df78f30 100644 --- a/src/main/java/org/apache/commons/crypto/cipher/CryptoCipherFactory.java +++ b/src/main/java/org/apache/commons/crypto/cipher/CryptoCipherFactory.java @@ -31,6 +31,12 @@ import org.apache.commons.crypto.utils.Utils; public class CryptoCipherFactory { /** + * The default value for crypto cipher. + */ + private static final String CIPHER_CLASSES_DEFAULT = + OpensslCipher.class.getName(); + + /** * The private Constructor of {@link CryptoCipherFactory}. */ private CryptoCipherFactory() { @@ -105,11 +111,11 @@ public class CryptoCipherFactory { private static String getCipherClassString(Properties props) { final String configName = ConfigurationKeys.CIPHER_CLASSES_KEY; String cipherClassString = props.getProperty(configName) != null ? props - .getProperty(configName, ConfigurationKeys.CIPHER_CLASSES_DEFAULT) + .getProperty(configName, CIPHER_CLASSES_DEFAULT) : System.getProperty(configName, - ConfigurationKeys.CIPHER_CLASSES_DEFAULT); + CIPHER_CLASSES_DEFAULT); if (cipherClassString.isEmpty()) { - cipherClassString = ConfigurationKeys.CIPHER_CLASSES_DEFAULT; + cipherClassString = CIPHER_CLASSES_DEFAULT; } return cipherClassString; } http://git-wip-us.apache.org/repos/asf/commons-crypto/blob/1a33867f/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 580eff5..7a91e8c 100644 --- a/src/main/java/org/apache/commons/crypto/conf/ConfigurationKeys.java +++ b/src/main/java/org/apache/commons/crypto/conf/ConfigurationKeys.java @@ -17,8 +17,6 @@ */ package org.apache.commons.crypto.conf; -import org.apache.commons.crypto.cipher.OpensslCipher; - /** * The ConfigurationKeys contains Configuration keys and default values. */ @@ -50,12 +48,6 @@ public class ConfigurationKeys { + "cipher.classes"; /** - * The default value for crypto cipher. - */ - public static final String CIPHER_CLASSES_DEFAULT = OpensslCipher.class - .getName(); - - /** * The configuration key of the provider class for JCE cipher. */ public static final String CIPHER_JCE_PROVIDER_KEY = CONF_PREFIX