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:
      149

      Description

      When FacesContextImpl.setResponseWriter(null) is called, it writes a warning
      stack trace in the logs:

      NullPointerException: IllegalArgumentException....

      This shouldn't happen since the API specification says that when the
      ViewHandler.renderView is done, the original ResponseWriter should be re-set on
      the FacesContext.

      But, what if the original ResponseWriter was null? This seems perfectly valid
      and not worth throwing stack traces to the logs on every rendering pass.

        Activity

        Hide
        jayashri added a comment -

        As per javadocs, ResponseWriter cannot be null. It seems to me that the current
        implementation is correct.

        /**

        • <p>Set the {@link ResponseWriter}

          to which components should

        • direct their character-based output.
          *
        • @param responseWriter The new ResponseWriter for this response
          *
        • @exception IllegalStateException if this method is called after
        • this instance has been released
        • @exception NullPointerException if <code>responseWriter</code>
        • is <code>null</code>
          */
          public abstract void setResponseWriter(ResponseWriter responseWriter)
        Show
        jayashri added a comment - As per javadocs, ResponseWriter cannot be null. It seems to me that the current implementation is correct. /** <p>Set the {@link ResponseWriter} to which components should direct their character-based output. * @param responseWriter The new ResponseWriter for this response * @exception IllegalStateException if this method is called after this instance has been released @exception NullPointerException if <code>responseWriter</code> is <code>null</code> */ public abstract void setResponseWriter(ResponseWriter responseWriter)
        Hide
        jhook added a comment -

        In the specification, it says that ViewHandler.renderView should:

        + Set the new ResponseWriter into the FacesContext, saving the old one aside.

        ....

        + Replace the old ResponseWriter back into the FacesContext.

        If you can never set the ResponseWriter to null on the FacesContext, should the
        specification above be changed to:

        + If the old ResponseWriter was not null, replaces it back into the FacesContext

        Show
        jhook added a comment - In the specification, it says that ViewHandler.renderView should: + Set the new ResponseWriter into the FacesContext, saving the old one aside. .... + Replace the old ResponseWriter back into the FacesContext. – If you can never set the ResponseWriter to null on the FacesContext, should the specification above be changed to: + If the old ResponseWriter was not null, replaces it back into the FacesContext
        Hide
        rogerk added a comment -

        Clarification added to spec. In the future, it may save us a bit of time if you
        mention the section number of the specification.

        Show
        rogerk added a comment - Clarification added to spec. In the future, it may save us a bit of time if you mention the section number of the specification.
        Hide
        Manfred Riem added a comment -

        Closing issue out

        Show
        Manfred Riem added a comment - Closing issue out

          People

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

            Dates

            • Created:
              Updated:
              Resolved: