Author: ggregory
Date: Fri Jul 24 22:31:46 2009
New Revision: 797673

URL: http://svn.apache.org/viewvc?rev=797673&view=rev
Log:
Now that we are on Java 1.4, we can save the original exception when we rethrow 
another exception.

Modified:
    commons/proper/codec/trunk/src/java/org/apache/commons/codec/binary/Hex.java
    commons/proper/codec/trunk/src/java/org/apache/commons/codec/net/BCodec.java
    commons/proper/codec/trunk/src/java/org/apache/commons/codec/net/QCodec.java
    
commons/proper/codec/trunk/src/java/org/apache/commons/codec/net/QuotedPrintableCodec.java
    
commons/proper/codec/trunk/src/java/org/apache/commons/codec/net/URLCodec.java

Modified: 
commons/proper/codec/trunk/src/java/org/apache/commons/codec/binary/Hex.java
URL: 
http://svn.apache.org/viewvc/commons/proper/codec/trunk/src/java/org/apache/commons/codec/binary/Hex.java?rev=797673&r1=797672&r2=797673&view=diff
==============================================================================
--- 
commons/proper/codec/trunk/src/java/org/apache/commons/codec/binary/Hex.java 
(original)
+++ 
commons/proper/codec/trunk/src/java/org/apache/commons/codec/binary/Hex.java 
Fri Jul 24 22:31:46 2009
@@ -187,7 +187,7 @@
             char[] charArray = object instanceof String ? ((String) 
object).toCharArray() : (char[]) object;
             return decodeHex(charArray);
         } catch (ClassCastException e) {
-            throw new DecoderException(e.getMessage());
+            throw new DecoderException(e.getMessage(), e);
         }
     }
 

Modified: 
commons/proper/codec/trunk/src/java/org/apache/commons/codec/net/BCodec.java
URL: 
http://svn.apache.org/viewvc/commons/proper/codec/trunk/src/java/org/apache/commons/codec/net/BCodec.java?rev=797673&r1=797672&r2=797673&view=diff
==============================================================================
--- 
commons/proper/codec/trunk/src/java/org/apache/commons/codec/net/BCodec.java 
(original)
+++ 
commons/proper/codec/trunk/src/java/org/apache/commons/codec/net/BCodec.java 
Fri Jul 24 22:31:46 2009
@@ -134,12 +134,10 @@
      * representation.
      * 
      * @param value
-     *                  Base64 string to convert into its original form
-     * 
+     *            Base64 string to convert into its original form
      * @return original string
-     * 
      * @throws DecoderException
-     *                  A decoder exception is thrown if a failure condition 
is encountered during the decode process.
+     *             A decoder exception is thrown if a failure condition is 
encountered during the decode process.
      */
     public String decode(String value) throws DecoderException {
         if (value == null) {
@@ -148,7 +146,7 @@
         try {
             return decodeText(value);
         } catch (UnsupportedEncodingException e) {
-            throw new DecoderException(e.getMessage());
+            throw new DecoderException(e.getMessage(), e);
         }
     }
 

Modified: 
commons/proper/codec/trunk/src/java/org/apache/commons/codec/net/QCodec.java
URL: 
http://svn.apache.org/viewvc/commons/proper/codec/trunk/src/java/org/apache/commons/codec/net/QCodec.java?rev=797673&r1=797672&r2=797673&view=diff
==============================================================================
--- 
commons/proper/codec/trunk/src/java/org/apache/commons/codec/net/QCodec.java 
(original)
+++ 
commons/proper/codec/trunk/src/java/org/apache/commons/codec/net/QCodec.java 
Fri Jul 24 22:31:46 2009
@@ -230,7 +230,7 @@
         try {
             return decodeText(pString);
         } catch (UnsupportedEncodingException e) {
-            throw new DecoderException(e.getMessage());
+            throw new DecoderException(e.getMessage(), e);
         }
     }
 

Modified: 
commons/proper/codec/trunk/src/java/org/apache/commons/codec/net/QuotedPrintableCodec.java
URL: 
http://svn.apache.org/viewvc/commons/proper/codec/trunk/src/java/org/apache/commons/codec/net/QuotedPrintableCodec.java?rev=797673&r1=797672&r2=797673&view=diff
==============================================================================
--- 
commons/proper/codec/trunk/src/java/org/apache/commons/codec/net/QuotedPrintableCodec.java
 (original)
+++ 
commons/proper/codec/trunk/src/java/org/apache/commons/codec/net/QuotedPrintableCodec.java
 Fri Jul 24 22:31:46 2009
@@ -302,7 +302,7 @@
         try {
             return decode(pString, getDefaultCharset());
         } catch (UnsupportedEncodingException e) {
-            throw new DecoderException(e.getMessage());
+            throw new DecoderException(e.getMessage(), e);
         }
     }
 

Modified: 
commons/proper/codec/trunk/src/java/org/apache/commons/codec/net/URLCodec.java
URL: 
http://svn.apache.org/viewvc/commons/proper/codec/trunk/src/java/org/apache/commons/codec/net/URLCodec.java?rev=797673&r1=797672&r2=797673&view=diff
==============================================================================
--- 
commons/proper/codec/trunk/src/java/org/apache/commons/codec/net/URLCodec.java 
(original)
+++ 
commons/proper/codec/trunk/src/java/org/apache/commons/codec/net/URLCodec.java 
Fri Jul 24 22:31:46 2009
@@ -296,7 +296,7 @@
         try {
             return decode(pString, getDefaultCharset());
         } catch (UnsupportedEncodingException e) {
-            throw new DecoderException(e.getMessage());
+            throw new DecoderException(e.getMessage(), e);
         }
     }
 


Reply via email to