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: CRYPTO-112 OpenSslCipher.loadingFailureReason should be a Throwable
Date Sat, 09 Jul 2016 16:50:44 GMT
Repository: commons-crypto
Updated Branches:
  refs/heads/master f4d5737e3 -> b17af9d95


CRYPTO-112 OpenSslCipher.loadingFailureReason should be a Throwable

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

Branch: refs/heads/master
Commit: b17af9d959fbf653c5597369dbb83ca8545b56f3
Parents: f4d5737
Author: Sebb <sebb@apache.org>
Authored: Sat Jul 9 17:50:40 2016 +0100
Committer: Sebb <sebb@apache.org>
Committed: Sat Jul 9 17:50:40 2016 +0100

----------------------------------------------------------------------
 .../java/org/apache/commons/crypto/cipher/OpenSsl.java  | 12 ++++++------
 .../org/apache/commons/crypto/cipher/OpenSslCipher.java |  2 +-
 2 files changed, 7 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-crypto/blob/b17af9d9/src/main/java/org/apache/commons/crypto/cipher/OpenSsl.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/crypto/cipher/OpenSsl.java b/src/main/java/org/apache/commons/crypto/cipher/OpenSsl.java
index 0898158..1820b47 100644
--- a/src/main/java/org/apache/commons/crypto/cipher/OpenSsl.java
+++ b/src/main/java/org/apache/commons/crypto/cipher/OpenSsl.java
@@ -86,20 +86,20 @@ final class OpenSsl {
     private final int algorithm;
     private final int padding;
 
-    private static final String loadingFailureReason;
+    private static final Throwable loadingFailureReason;
 
     static {
-        String loadingFailure = null;
+        Throwable loadingFailure = null;
         try {
             if (Crypto.isNativeCodeLoaded()) {
                 OpenSslNative.initIDs();
             } else {
-                loadingFailure = Crypto.getLoadingError().getMessage();
+                loadingFailure = Crypto.getLoadingError();
             }
         } catch (Exception t) {
-            loadingFailure = t.getMessage();
+            loadingFailure = t;
         } catch (UnsatisfiedLinkError t) {
-            loadingFailure = t.getMessage();            
+            loadingFailure = t;            
         } finally {
             loadingFailureReason = loadingFailure;
         }
@@ -110,7 +110,7 @@ final class OpenSsl {
      *
      * @return the failure reason; null if it was loaded and initialised successfully
      */
-    public static String getLoadingFailureReason() {
+    public static Throwable getLoadingFailureReason() {
         return loadingFailureReason;
     }
 

http://git-wip-us.apache.org/repos/asf/commons-crypto/blob/b17af9d9/src/main/java/org/apache/commons/crypto/cipher/OpenSslCipher.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/crypto/cipher/OpenSslCipher.java b/src/main/java/org/apache/commons/crypto/cipher/OpenSslCipher.java
index c8fe0b5..dff7dad 100644
--- a/src/main/java/org/apache/commons/crypto/cipher/OpenSslCipher.java
+++ b/src/main/java/org/apache/commons/crypto/cipher/OpenSslCipher.java
@@ -54,7 +54,7 @@ class OpenSslCipher implements CryptoCipher {
             throws GeneralSecurityException {
         this.transformation = transformation;
 
-        String loadingFailureReason = OpenSsl.getLoadingFailureReason();
+        Throwable loadingFailureReason = OpenSsl.getLoadingFailureReason();
         if (loadingFailureReason != null) {
             throw new RuntimeException(loadingFailureReason);
         }


Mime
View raw message