You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by do...@apache.org on 2012/05/04 23:58:45 UTC

svn commit: r1334217 - /ofbiz/trunk/framework/entity/src/org/ofbiz/entity/util/EntityCrypto.java

Author: doogie
Date: Fri May  4 21:58:45 2012
New Revision: 1334217

URL: http://svn.apache.org/viewvc?rev=1334217&view=rev
Log:
FEATURE: call UtilObject.getObjectException, and rethrow any exceptions,
so that the exception doesn't get logged multiple times.

Modified:
    ofbiz/trunk/framework/entity/src/org/ofbiz/entity/util/EntityCrypto.java

Modified: ofbiz/trunk/framework/entity/src/org/ofbiz/entity/util/EntityCrypto.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/entity/src/org/ofbiz/entity/util/EntityCrypto.java?rev=1334217&r1=1334216&r2=1334217&view=diff
==============================================================================
--- ofbiz/trunk/framework/entity/src/org/ofbiz/entity/util/EntityCrypto.java (original)
+++ ofbiz/trunk/framework/entity/src/org/ofbiz/entity/util/EntityCrypto.java Fri May  4 21:58:45 2012
@@ -18,6 +18,7 @@
  */
 package org.ofbiz.entity.util;
 
+import java.io.IOException;
 import java.security.NoSuchAlgorithmException;
 import java.util.HashMap;
 import java.util.Map;
@@ -112,7 +113,13 @@ public class EntityCrypto {
             throw new EntityCryptoException("key(" + keyName + ") not found in database");
         }
         byte[] decryptedBytes = DesCrypt.decrypt(key, encryptedBytes);
-        return UtilObject.getObject(decryptedBytes);
+        try {
+            return UtilObject.getObjectException(decryptedBytes);
+        } catch (ClassNotFoundException e) {
+            throw new GeneralException(e);
+        } catch (IOException e) {
+            throw new GeneralException(e);
+        }
     }
 
     protected SecretKey findKey(String originalKeyName, boolean useOldFunnyKeyHash) throws EntityCryptoException {