You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by lu...@apache.org on 2008/06/27 04:04:41 UTC

svn commit: r672073 - /myfaces/core/trunk/api/src/main/java/javax/faces/component/UIInput.java

Author: lu4242
Date: Thu Jun 26 19:04:40 2008
New Revision: 672073

URL: http://svn.apache.org/viewvc?rev=672073&view=rev
Log:
MYFACES-1871 UIInput throws IllegalArgumentException for unknown event types in broadcast()

Modified:
    myfaces/core/trunk/api/src/main/java/javax/faces/component/UIInput.java

Modified: myfaces/core/trunk/api/src/main/java/javax/faces/component/UIInput.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/api/src/main/java/javax/faces/component/UIInput.java?rev=672073&r1=672072&r2=672073&view=diff
==============================================================================
--- myfaces/core/trunk/api/src/main/java/javax/faces/component/UIInput.java (original)
+++ myfaces/core/trunk/api/src/main/java/javax/faces/component/UIInput.java Thu Jun 26 19:04:40 2008
@@ -273,33 +273,31 @@
     public void broadcast(FacesEvent event)
             throws AbortProcessingException
     {
-        if (!(event instanceof ValueChangeEvent))
-        {
-            throw new IllegalArgumentException("FacesEvent of class " + event.getClass().getName() + " not supported by UIInput");
-        }
-
         // invoke standard listeners attached to this component first
         super.broadcast(event);
 
-        // invoke the single listener defined directly on the component
-        MethodBinding valueChangeListenerBinding = getValueChangeListener();
-        if (valueChangeListenerBinding != null)
-        {
-            try
-            {
-                valueChangeListenerBinding.invoke(getFacesContext(),
-                                                  new Object[]{event});
-            }
-            catch (EvaluationException e)
+        //Check if the event is applicable for ValueChangeListener
+        if (event instanceof ValueChangeEvent){
+            // invoke the single listener defined directly on the component
+            MethodBinding valueChangeListenerBinding = getValueChangeListener();
+            if (valueChangeListenerBinding != null)
             {
-                Throwable cause = e.getCause();
-                if (cause != null && cause instanceof AbortProcessingException)
+                try
                 {
-                    throw (AbortProcessingException)cause;
+                    valueChangeListenerBinding.invoke(getFacesContext(),
+                                                      new Object[]{event});
                 }
-                else
+                catch (EvaluationException e)
                 {
-                    throw e;
+                    Throwable cause = e.getCause();
+                    if (cause != null && cause instanceof AbortProcessingException)
+                    {
+                        throw (AbortProcessingException)cause;
+                    }
+                    else
+                    {
+                        throw e;
+                    }
                 }
             }
         }