Author: rahul
Date: Wed Jul 15 04:07:17 2009
New Revision: 794136

URL: http://svn.apache.org/viewvc?rev=794136&view=rev
Log:
Make coercion exception messages consistent.

Modified:
    
commons/proper/jexl/branches/2.0/src/java/org/apache/commons/jexl/JexlArithmetic.java

Modified: 
commons/proper/jexl/branches/2.0/src/java/org/apache/commons/jexl/JexlArithmetic.java
URL: 
http://svn.apache.org/viewvc/commons/proper/jexl/branches/2.0/src/java/org/apache/commons/jexl/JexlArithmetic.java?rev=794136&r1=794135&r2=794136&view=diff
==============================================================================
--- 
commons/proper/jexl/branches/2.0/src/java/org/apache/commons/jexl/JexlArithmetic.java
 (original)
+++ 
commons/proper/jexl/branches/2.0/src/java/org/apache/commons/jexl/JexlArithmetic.java
 Wed Jul 15 04:07:17 2009
@@ -463,7 +463,7 @@
             return ((Number) val).intValue();
         }
 
-        throw new IllegalArgumentException("Integer coercion exception, don't 
know how to convert " + val);
+        throw new IllegalArgumentException("Integer coercion exception. Can't 
coerce type: " + val.getClass().getName());
     }
 
     
@@ -489,7 +489,7 @@
             return ((Number) val).longValue();
         }
 
-        throw new NumberFormatException("Long coercion exception for '" + val 
+ "'");
+        throw new NumberFormatException("Long coercion exception. Can't coerce 
type: " + val.getClass().getName());
     }
 
     /**
@@ -516,7 +516,7 @@
             return BigInteger.valueOf(i);
         }
         
-        throw new IllegalArgumentException("BigInteger coercion. Can't coerce 
type " + val.getClass().getName());
+        throw new IllegalArgumentException("BigInteger coercion exception. 
Can't coerce type: " + val.getClass().getName());
     }
     
     /**
@@ -543,7 +543,7 @@
             return new BigDecimal(i);
         }
         
-        throw new IllegalArgumentException("BigDecimal coercion. Can't coerce 
type " + val.getClass().getName());
+        throw new IllegalArgumentException("BigDecimal coercion exception. 
Can't coerce type: " + val.getClass().getName());
     }
     
     /**
@@ -576,7 +576,7 @@
             throw new IllegalArgumentException("Boolean->Double coercion 
exception");
         }
 
-        throw new IllegalArgumentException("Double coercion exception, don't 
know how to convert " + val);
+        throw new IllegalArgumentException("Double coercion exception. Can't 
coerce type: " + val.getClass().getName());
     }
     /**
      * Is Object a floating point number.


Reply via email to