javaserverfaces
  1. javaserverfaces
  2. JAVASERVERFACES-2545

ExternalContext.getResourceAsStream() does not throw NPE when path is null.

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.1.14, 2.2.0-m06
    • Component/s: context
    • Labels:
      None
    • Environment:

      N/A

      Description

      According to the Mojarra API Documentation for ExternalContext.getResourceAsStream(String path) we should be throwing a NullPointerException when passing in null for path.

      We do not as it stands now.

      The code calls through to ServletContext.getResourceAsStream(String path) and the API documentation states the following for returns.

      Returns:
      the InputStream returned to the servlet, or null if no resource exists at the specified path

        Activity

        Hide
        rogerk added a comment -

        Changes.

        Show
        rogerk added a comment - Changes.
        Hide
        rogerk added a comment -

        Committed to trunk:
        Sending jsf-ri/src/main/java/com/sun/faces/context/ExternalContextImpl.java
        Sending test/agnostic/context/regular/src/main/java/com/sun/faces/test/agnostic/context/regular/ExternalContextBean.java
        Adding test/agnostic/context/regular/src/main/webapp/issue2545.xhtml
        Sending test/agnostic/context/regular/src/test/java/com/sun/faces/test/agnostic/context/regular/ExternalContextIT.java
        Transmitting file data ....
        Committed revision 10872.

        Show
        rogerk added a comment - Committed to trunk: Sending jsf-ri/src/main/java/com/sun/faces/context/ExternalContextImpl.java Sending test/agnostic/context/regular/src/main/java/com/sun/faces/test/agnostic/context/regular/ExternalContextBean.java Adding test/agnostic/context/regular/src/main/webapp/issue2545.xhtml Sending test/agnostic/context/regular/src/test/java/com/sun/faces/test/agnostic/context/regular/ExternalContextIT.java Transmitting file data .... Committed revision 10872.
        Hide
        rogerk added a comment -

        Committed to MOJARRA_2_1X_ROLLING:
        Sending jsf-ri/src/main/java/com/sun/faces/context/ExternalContextImpl.java
        Sending test/agnostic/context/regular/src/main/java/com/sun/faces/test/agnostic/context/regular/ExternalContextBean.java
        Adding test/agnostic/context/regular/src/main/webapp/issue2545.xhtml
        Sending test/agnostic/context/regular/src/test/java/com/sun/faces/test/agnostic/context/regular/ExternalContextIT.java
        Transmitting file data ....
        Committed revision 10873.

        Show
        rogerk added a comment - Committed to MOJARRA_2_1X_ROLLING: Sending jsf-ri/src/main/java/com/sun/faces/context/ExternalContextImpl.java Sending test/agnostic/context/regular/src/main/java/com/sun/faces/test/agnostic/context/regular/ExternalContextBean.java Adding test/agnostic/context/regular/src/main/webapp/issue2545.xhtml Sending test/agnostic/context/regular/src/test/java/com/sun/faces/test/agnostic/context/regular/ExternalContextIT.java Transmitting file data .... Committed revision 10873.
        Hide
        rogerk added a comment -

        Committed.

        Show
        rogerk added a comment - Committed.

          People

          • Assignee:
            rogerk
            Reporter:
            dougd
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: