javaserverfaces
  1. javaserverfaces
  2. JAVASERVERFACES-148

MethodExpressionValidator Exception Management

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.2
    • Fix Version/s: 1.0
    • Component/s: None
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: All

    • Issuezilla Id:
      148

      Description

      When the target method is invoked, the code unecessarily wraps the EL exception
      when it could just throw the inner ValidatorException. Of course we still need
      to handle the case where the ELException is not wrapping the ValidatorException
      and that case can be handled by the current code:

      Index: MethodExpressionValidator.java
      ===================================================================
      RCS file:
      /cvs/javaserverfaces-sources/jsf-api/src/javax/faces/validator/MethodExpressionValidator.java,v
      retrieving revision 1.1
      diff -u -r1.1 MethodExpressionValidator.java
      — MethodExpressionValidator.java 5 May 2005 20:51:12 -0000 1.1
      +++ MethodExpressionValidator.java 13 Jul 2005 04:19:40 -0000
      @@ -65,6 +65,10 @@
      ELContext elContext = context.getELContext();
      methodExpression.invoke(elContext, new Object[]

      {context, component, value}

      );
      } catch (ELException ee) {
      + Throwable e = ee.getCause();
      + if (e instanceof ValidatorException)

      { + throw (ValidatorException) e; + }

      FacesMessage message = new FacesMessage(ee.getMessage());
      throw new ValidatorException(message, ee.getCause());
      }

        Activity

        Hide
        jhook added a comment -

        Created an attachment (id=77)
        patch for exception handling

        Show
        jhook added a comment - Created an attachment (id=77) patch for exception handling
        Hide
        Ed Burns added a comment -

        Currently running tests.

        Show
        Ed Burns added a comment - Currently running tests.
        Hide
        Ed Burns added a comment -

        Fix checked in.

        Show
        Ed Burns added a comment - Fix checked in.
        Hide
        Manfred Riem added a comment -

        Closing out issue

        Show
        Manfred Riem added a comment - Closing out issue

          People

          • Assignee:
            Ed Burns
            Reporter:
            jhook
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: