You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by ma...@apache.org on 2007/09/27 17:10:41 UTC

svn commit: r580058 - /myfaces/core/branches/1_2_1/api/src/main/java/javax/faces/validator/MethodExpressionValidator.java

Author: matzew
Date: Thu Sep 27 08:10:39 2007
New Revision: 580058

URL: http://svn.apache.org/viewvc?rev=580058&view=rev
Log:
MYFACES-1734
In a custom validator method, the Message in the thrown ValidatorException is not used

thx to Thomas Fischer for the patch

Modified:
    myfaces/core/branches/1_2_1/api/src/main/java/javax/faces/validator/MethodExpressionValidator.java

Modified: myfaces/core/branches/1_2_1/api/src/main/java/javax/faces/validator/MethodExpressionValidator.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/1_2_1/api/src/main/java/javax/faces/validator/MethodExpressionValidator.java?rev=580058&r1=580057&r2=580058&view=diff
==============================================================================
--- myfaces/core/branches/1_2_1/api/src/main/java/javax/faces/validator/MethodExpressionValidator.java (original)
+++ myfaces/core/branches/1_2_1/api/src/main/java/javax/faces/validator/MethodExpressionValidator.java Thu Sep 27 08:10:39 2007
@@ -52,8 +52,15 @@
         
         try {
             methodExpression.invoke(context.getELContext(), params);
-        } catch (ELException e) {
-            throw new ValidatorException(new FacesMessage(), e);
+        } 
+        catch (ELException e) {
+            Throwable cause = e.getCause();
+            if (cause instanceof ValidatorException) {
+                throw (ValidatorException) cause;
+            }
+            else {
+                throw e;
+            }
         }
     }