javaserverfaces
  1. javaserverfaces
  2. JAVASERVERFACES-2549

ExternalContext.isUserinRole(String) should throw NPE

    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 ExternalContext.isUserInRole(String role) should throw a NullPointerException.

      As of now it does not.

      Looking at the Servlet API's for HttpServletResponse.isUserInRole(String role), (which is what we call through to) states the following.

      Returns:
      a boolean indicating whether the user making this request belongs to a given role; false if the user has not been authenticated

      So they are handling "null" and just returning false.

        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/issue2549.xhtml
        Sending test/agnostic/context/regular/src/test/java/com/sun/faces/test/agnostic/context/regular/ExternalContextIT.java
        Transmitting file data ....
        Committed revision 10845.

        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/issue2549.xhtml Sending test/agnostic/context/regular/src/test/java/com/sun/faces/test/agnostic/context/regular/ExternalContextIT.java Transmitting file data .... Committed revision 10845.
        Hide
        rogerk added a comment -

        Committed to MOJARRA_2_1X_ROLLING branch:
        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/issue2549.xhtml
        Sending test/agnostic/context/regular/src/test/java/com/sun/faces/test/agnostic/context/regular/ExternalContextIT.java
        Transmitting file data ....
        Committed revision 10846.

        Show
        rogerk added a comment - Committed to MOJARRA_2_1X_ROLLING branch: 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/issue2549.xhtml Sending test/agnostic/context/regular/src/test/java/com/sun/faces/test/agnostic/context/regular/ExternalContextIT.java Transmitting file data .... Committed revision 10846.
        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: