Uploaded image for project: 'MyFaces Core'
  1. MyFaces Core
  2. MYFACES-4504

UnsupportedOperationException from NavigationHandlerImpl.handleNavigation

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.3-next-M7, 4.0.0-RC2
    • 2.3-next-M8, 4.0.0-RC3
    • General
    • None

    Description

      Stack trace of the exception:

       

      java.lang.UnsupportedOperationException
          at java.base/java.util.AbstractMap.put(AbstractMap.java:209)
          at org.apache.myfaces.application.NavigationHandlerImpl.handleNavigation(NavigationHandlerImpl.java:194)
          at org.apache.myfaces.application.NavigationHandlerImpl.handleNavigation(NavigationHandlerImpl.java:115)
          at org.apache.myfaces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:122)
          at jakarta.faces.component.UICommand.broadcast(UICommand.java:65)
          at jakarta.faces.component.UIViewRoot._broadcastAll(UIViewRoot.java:1233)
          at jakarta.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:414)
          at jakarta.faces.component.UIViewRoot._process(UIViewRoot.java:1705)
          at jakarta.faces.component.UIViewRoot.processApplication(UIViewRoot.java:915)
          at org.apache.myfaces.lifecycle.InvokeApplicationExecutor.execute(InvokeApplicationExecutor.java:43)
          at org.apache.myfaces.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.java:172)
          at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:125)
          at jakarta.faces.webapp.FacesServlet.service(FacesServlet.java:223)

      This happens because there is an EmptyMap returned from:

      Map<String, List<String>> navigationCaseParameters = navigationCase.getParameters();

      and then a "put" operation is executed. However, the EmptyMap is coming from the changes in this commit (RedirectImpl.getViewParams()):  https://github.com/apache/myfaces/commit/7262f0a3296bd2c31402dc571d65a1816a4e45a9#diff-5251ef056d9a5508580a730031342370484f088738963e6e676fc3c151006ca0R49

      The "Collections.emptyMap()" is immutable and therefore the UnsupportedOperationException is thrown.

      Attachments

        Activity

          People

            paul.nicolucci Paul Nicolucci
            paul.nicolucci Paul Nicolucci
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: