commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject commons-crypto git commit: Consistent names
Date Thu, 30 Jun 2016 11:33:01 GMT
Repository: commons-crypto
Updated Branches:
  refs/heads/master ed48fad6c -> 6449de7f4


Consistent names

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

Branch: refs/heads/master
Commit: 6449de7f4b4a16dc0fba4a9f1ca30fc74677564d
Parents: ed48fad
Author: Sebb <sebb@apache.org>
Authored: Thu Jun 30 12:32:57 2016 +0100
Committer: Sebb <sebb@apache.org>
Committed: Thu Jun 30 12:32:57 2016 +0100

----------------------------------------------------------------------
 .../apache/commons/crypto/cipher/CryptoCipherFactory.java    | 6 +++---
 .../commons/crypto/stream/PositionedCryptoInputStream.java   | 2 +-
 src/main/java/org/apache/commons/crypto/utils/Utils.java     | 2 +-
 src/test/java/org/apache/commons/crypto/CryptoBenchmark.java | 2 +-
 .../commons/crypto/cipher/CryptoCipherFactoryTest.java       | 8 ++++----
 5 files changed, 10 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-crypto/blob/6449de7f/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 5461ffc..c05be6d 100644
--- a/src/main/java/org/apache/commons/crypto/cipher/CryptoCipherFactory.java
+++ b/src/main/java/org/apache/commons/crypto/cipher/CryptoCipherFactory.java
@@ -113,7 +113,7 @@ public class CryptoCipherFactory {
      * @throws GeneralSecurityException if cipher initialize failed
      * @throws IllegalArgumentException if no classname(s)
      */
-    public static CryptoCipher getInstance(String transformation,
+    public static CryptoCipher getCryptoCipher(String transformation,
                                            Properties props) throws GeneralSecurityException
{
 
         CryptoCipher cipher = null;
@@ -154,9 +154,9 @@ public class CryptoCipherFactory {
      * @return CryptoCipher the cipher object (defaults to OpensslCipher if available, else
JceCipher)
      * @throws GeneralSecurityException if JCE cipher initialize failed
      */
-    public static CryptoCipher getInstance(String transformation)
+    public static CryptoCipher getCryptoCipher(String transformation)
             throws GeneralSecurityException {
-        return getInstance(transformation, new Properties());
+        return getCryptoCipher(transformation, new Properties());
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/commons-crypto/blob/6449de7f/src/main/java/org/apache/commons/crypto/stream/PositionedCryptoInputStream.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/crypto/stream/PositionedCryptoInputStream.java
b/src/main/java/org/apache/commons/crypto/stream/PositionedCryptoInputStream.java
index 983769c..79d9ad5 100644
--- a/src/main/java/org/apache/commons/crypto/stream/PositionedCryptoInputStream.java
+++ b/src/main/java/org/apache/commons/crypto/stream/PositionedCryptoInputStream.java
@@ -319,7 +319,7 @@ public class PositionedCryptoInputStream extends CTRCryptoInputStream
{
         if (state == null) {
             CryptoCipher cipher;
             try {
-                cipher = CryptoCipherFactory.getInstance("AES/CTR/NoPadding", props);
+                cipher = CryptoCipherFactory.getCryptoCipher("AES/CTR/NoPadding", props);
             } catch (GeneralSecurityException e) {
                 throw new IOException(e);
             }

http://git-wip-us.apache.org/repos/asf/commons-crypto/blob/6449de7f/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 d20d2c0..1b3a264 100644
--- a/src/main/java/org/apache/commons/crypto/utils/Utils.java
+++ b/src/main/java/org/apache/commons/crypto/utils/Utils.java
@@ -118,7 +118,7 @@ public final class Utils {
             String transformation, Properties props)
             throws IOException {
         try {
-            return CryptoCipherFactory.getInstance(transformation, props);
+            return CryptoCipherFactory.getCryptoCipher(transformation, props);
         } catch (GeneralSecurityException e) {
             throw new IOException(e);
         }

http://git-wip-us.apache.org/repos/asf/commons-crypto/blob/6449de7f/src/test/java/org/apache/commons/crypto/CryptoBenchmark.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/crypto/CryptoBenchmark.java b/src/test/java/org/apache/commons/crypto/CryptoBenchmark.java
index 9e10311..ff43c59 100644
--- a/src/test/java/org/apache/commons/crypto/CryptoBenchmark.java
+++ b/src/test/java/org/apache/commons/crypto/CryptoBenchmark.java
@@ -173,7 +173,7 @@ public class CryptoBenchmark {
     private CryptoCipher getCipher(String className) throws Exception {
         Properties properties = new Properties();
         properties.setProperty(ConfigurationKeys.CIPHER_CLASSES_KEY, className);
-        CryptoCipher cipher = CryptoCipherFactory.getInstance("AES/CBC/PKCS5Padding", properties);
+        CryptoCipher cipher = CryptoCipherFactory.getCryptoCipher("AES/CBC/PKCS5Padding",
properties);
         Assert.assertEquals(className, cipher.getClass().getCanonicalName());
         return cipher;
     }

http://git-wip-us.apache.org/repos/asf/commons-crypto/blob/6449de7f/src/test/java/org/apache/commons/crypto/cipher/CryptoCipherFactoryTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/crypto/cipher/CryptoCipherFactoryTest.java b/src/test/java/org/apache/commons/crypto/cipher/CryptoCipherFactoryTest.java
index 26606eb..65029e9 100644
--- a/src/test/java/org/apache/commons/crypto/cipher/CryptoCipherFactoryTest.java
+++ b/src/test/java/org/apache/commons/crypto/cipher/CryptoCipherFactoryTest.java
@@ -29,7 +29,7 @@ public class CryptoCipherFactoryTest {
     @Test
     public void testDefaultCipher() throws GeneralSecurityException {
         CryptoCipher defaultCipher = CryptoCipherFactory
-                .getInstance("AES/CBC/NoPadding");
+                .getCryptoCipher("AES/CBC/NoPadding");
         Assert.assertEquals(OpensslCipher.class.getName(), defaultCipher
                 .getClass().getName());
     }
@@ -39,7 +39,7 @@ public class CryptoCipherFactoryTest {
         Properties properties = new Properties();
         properties.setProperty(
                 ConfigurationKeys.CIPHER_CLASSES_KEY, "");
-        CryptoCipher defaultCipher = CryptoCipherFactory.getInstance(
+        CryptoCipher defaultCipher = CryptoCipherFactory.getCryptoCipher(
                 "AES/CBC/NoPadding", properties);
         Assert.assertEquals(OpensslCipher.class.getName(), defaultCipher
                 .getClass().getName());
@@ -50,12 +50,12 @@ public class CryptoCipherFactoryTest {
         Properties properties = new Properties();
         properties.setProperty(ConfigurationKeys.CIPHER_CLASSES_KEY,
                 "InvalidCipherName");
-        CryptoCipherFactory.getInstance("AES/CBC/NoPadding", properties);
+        CryptoCipherFactory.getCryptoCipher("AES/CBC/NoPadding", properties);
     }
 
     @Test(expected = GeneralSecurityException.class)
     public void testInvalidTransformation() throws GeneralSecurityException {
       Properties properties = new Properties();
-      CryptoCipherFactory.getInstance("AES/Invalid/NoPadding", properties);
+      CryptoCipherFactory.getCryptoCipher("AES/Invalid/NoPadding", properties);
     }
 }


Mime
View raw message