javaserverfaces
  1. javaserverfaces
  2. JAVASERVERFACES-2137

TagValueExpression swallows stacktrace while wrapping caught exceptions

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.1.1
    • Fix Version/s: 2.2.0-m01
    • Component/s: facelets
    • Labels:
      None

      Description

      On several occasions TagValueExpression wraps caught exception losing the stacktrace of the caught exception.

      public Class getType(ELContext context) {
      try

      { return this.orig.getType(context); }

      catch (PropertyNotFoundException pnfe)

      { throw new PropertyNotFoundException(this.attr + ": " + pnfe.getMessage(), pnfe.getCause()); }

      catch (ELException e)

      { throw new ELException(this.attr + ": " + e.getMessage(), e.getCause()); }

      }

      By only passing the cause of the caught exception the stacktrace of the caught exception is lost.

      All wrapped exceptions should preserve the original stacktrace by passing the caught exception as cause for the new exception.

      Attached changebundle.txt contains the proposed change.

      1. changebundle.txt
        3 kB
        Hanspeter Duennenberger

        Activity

        Hide
        Ed Burns added a comment -

        r=edburns for going through the checkin procedure. Make sure the tests run successfully! There may be a test that needs to be updated to account for this change in behavior. I'm not sure.

        Ed

        Show
        Ed Burns added a comment - r=edburns for going through the checkin procedure. Make sure the tests run successfully! There may be a test that needs to be updated to account for this change in behavior. I'm not sure. Ed
        Hide
        Hanspeter Duennenberger added a comment -

        Hi Ed,

        using the VM from the masterclass after Confess I was able to run smoketest.with.container.refresh successfully after changing TagValueExpression as recorded in changebundle.txt.

        So I think the change will not break tests - unfortunately I was not able to run the tests on trunk because other tests failed even without changing TagValueExpression.
        If you have the tests running, could you please also test TagValueExpression changes?

        Thx
        Hanspeter

        Show
        Hanspeter Duennenberger added a comment - Hi Ed, using the VM from the masterclass after Confess I was able to run smoketest.with.container.refresh successfully after changing TagValueExpression as recorded in changebundle.txt. So I think the change will not break tests - unfortunately I was not able to run the tests on trunk because other tests failed even without changing TagValueExpression. If you have the tests running, could you please also test TagValueExpression changes? Thx Hanspeter
        Hide
        Ed Burns added a comment -

        r = edburns. Please commit and resolve. Make sure to post output from commit command as a comment on the issue when resolving.

        Show
        Ed Burns added a comment - r = edburns. Please commit and resolve. Make sure to post output from commit command as a comment on the issue when resolving.
        Hide
        Hanspeter Duennenberger added a comment -

        Wrap handled exception instead of only their cause to preserve the full stacktrace informations. http://java.net/jira/browse/JAVASERVERFACES-2137

        Sending C:/Data/projects/35jsfdev/Mojarra/jsf-ri/src/main/java/com/sun/faces/facelets/el/TagValueExpression.java
        Transmitting file data ...
        Committed revision 9219.

        Show
        Hanspeter Duennenberger added a comment - Wrap handled exception instead of only their cause to preserve the full stacktrace informations. http://java.net/jira/browse/JAVASERVERFACES-2137 Sending C:/Data/projects/35jsfdev/Mojarra/jsf-ri/src/main/java/com/sun/faces/facelets/el/TagValueExpression.java Transmitting file data ... Committed revision 9219.
        Hide
        Hanspeter Duennenberger added a comment -

        added description to changebundle.txt

        Show
        Hanspeter Duennenberger added a comment - added description to changebundle.txt

          People

          • Assignee:
            Hanspeter Duennenberger
            Reporter:
            Hanspeter Duennenberger
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: