Fix bug in Enum to Enum coercion spotted during code review
authormarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Sat, 16 Jan 2010 10:50:12 +0000 (10:50 +0000)
committermarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Sat, 16 Jan 2010 10:50:12 +0000 (10:50 +0000)
git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@899919 13f79535-47bb-0310-9956-ffa450edef68

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

index fe02816..f627aa3 100644 (file)
@@ -178,11 +178,11 @@ public class ELSupport {
      * @param type
      * @return
      */
-    public final static Enum coerceToEnum(final Object obj, Class type) {
+    public final static Enum<?> coerceToEnum(final Object obj, Class type) {
         if (obj == null || "".equals(obj)) {
             return null;
         }
-        if (obj.getClass().isEnum()) {
+        if (type.isAssignableFrom(obj.getClass())) {
             return (Enum<?>) obj;
         }
         Enum<?> result;