commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject [1/2] commons-crypto git commit: Revert "try-with-resources."
Date Thu, 30 Jun 2016 00:21:46 GMT
Repository: commons-crypto
Updated Branches:
  refs/heads/master c6320bbf6 -> 7652bfbd6


Revert "try-with-resources."

This reverts commit b11f6ffaecef327840c3f42b880937a267ac7637.


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

Branch: refs/heads/master
Commit: 67e3639c4a8c9daa472864522265917303a1b228
Parents: c6320bb
Author: Gary Gregory <ggregory@apache.org>
Authored: Wed Jun 29 17:21:05 2016 -0700
Committer: Gary Gregory <ggregory@apache.org>
Committed: Wed Jun 29 17:21:05 2016 -0700

----------------------------------------------------------------------
 .../commons/crypto/cipher/AbstractCipherTest.java   | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-crypto/blob/67e3639c/src/test/java/org/apache/commons/crypto/cipher/AbstractCipherTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/crypto/cipher/AbstractCipherTest.java b/src/test/java/org/apache/commons/crypto/cipher/AbstractCipherTest.java
index 65f1472..3da0511 100644
--- a/src/test/java/org/apache/commons/crypto/cipher/AbstractCipherTest.java
+++ b/src/test/java/org/apache/commons/crypto/cipher/AbstractCipherTest.java
@@ -82,18 +82,18 @@ public abstract class AbstractCipherTest {
 
     @Test
     public void closeTestAfterInit() throws Exception {
-        try (CryptoCipher enc = getCipher(transformations[0])) {
-            enc.init(Cipher.ENCRYPT_MODE, new SecretKeySpec(KEY, "AES"), new IvParameterSpec(IV));
-        }
+        CryptoCipher enc = getCipher(transformations[0]);
+        enc.init(Cipher.ENCRYPT_MODE, new SecretKeySpec(KEY, "AES"), new IvParameterSpec(IV));
+        enc.close();
     }
 
     @Test
     public void reInitTest() throws Exception {
-        try (CryptoCipher enc = getCipher(transformations[0])) {
-            enc.init(Cipher.ENCRYPT_MODE, new SecretKeySpec(KEY, "AES"), new IvParameterSpec(IV));
-            enc.init(Cipher.DECRYPT_MODE, new SecretKeySpec(KEY, "AES"), new IvParameterSpec(IV));
-            enc.init(Cipher.ENCRYPT_MODE, new SecretKeySpec(KEY, "AES"), new IvParameterSpec(IV));
-        }
+        CryptoCipher enc = getCipher(transformations[0]);
+        enc.init(Cipher.ENCRYPT_MODE, new SecretKeySpec(KEY, "AES"), new IvParameterSpec(IV));
+        enc.init(Cipher.DECRYPT_MODE, new SecretKeySpec(KEY, "AES"), new IvParameterSpec(IV));
+        enc.init(Cipher.ENCRYPT_MODE, new SecretKeySpec(KEY, "AES"), new IvParameterSpec(IV));
+        enc.close();
     }
 
     @Test


Mime
View raw message