TCK failure. Wrong exception on failure.
authormarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Sat, 16 Jan 2010 10:37:31 +0000 (10:37 +0000)
committermarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Sat, 16 Jan 2010 10:37:31 +0000 (10:37 +0000)
git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@899916 13f79535-47bb-0310-9956-ffa450edef68

java/org/apache/el/lang/ELSupport.java

index 14a907a..fe02816 100644 (file)
@@ -185,7 +185,14 @@ public class ELSupport {
         if (obj.getClass().isEnum()) {
             return (Enum<?>) obj;
         }
-        return Enum.valueOf(type, obj.toString());
+        Enum<?> result;
+        try {
+             result = Enum.valueOf(type, obj.toString());
+        } catch (IllegalArgumentException iae) {
+            throw new ELException(MessageFactory.get("error.convert",
+                    obj, obj.getClass(), type));
+        }
+        return result;
     }
 
     /**