MyFaces Core
  1. MyFaces Core
  2. MYFACES-2537

FacesConfigurator.sortRelativeOrderingList() algorithm is broken trying to resolve some examples

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0.0-beta
    • Fix Version/s: 2.0.0-beta-2
    • Component/s: JSR-314
    • Labels:
      None

      Description

      Curtiss Howard put this comment on dev list

      FacesConfigurator.sortRelativeOrderingList() is failing on a rather
      simple case:

      A after B
      B before C
      C before A

      The expected faces-config ordering is B-C-A, but instead
      sortRelativeOrderingList() is detecting a circularity.

      The algorithm proposed fails because it is not able to process the nodes in the correct order (the algorithm assign a weight equal to all nodes, so it fails when try to order them in a psedo "postorder" form).

      It is faster and better try another algorithm. The current one works in all tests done at this moment but this case makes it fail without any possible workaround.

        Activity

        Leonardo Uribe created issue -
        Hide
        Leonardo Uribe added a comment -

        Committed alternative solution using topological sorting.

        Show
        Leonardo Uribe added a comment - Committed alternative solution using topological sorting.
        Hide
        Leonardo Uribe added a comment -

        Thinking more about it, I like the old algorithm version, because it handles better "before others" and "after others" rules. Since it try to resolve nodes from lower to upper complexity, the "others" group are handled better. The alternative could find cases like presented before, so I would like myfaces try first with the previous version and if a cyclic reference is found, try the topological sorting or other alternative to be proposed.

        Show
        Leonardo Uribe added a comment - Thinking more about it, I like the old algorithm version, because it handles better "before others" and "after others" rules. Since it try to resolve nodes from lower to upper complexity, the "others" group are handled better. The alternative could find cases like presented before, so I would like myfaces try first with the previous version and if a cyclic reference is found, try the topological sorting or other alternative to be proposed.
        Hide
        Martin Kočí added a comment -

        Current implementation does not solve this situation:
        2) JSF 2.0 library named cz_markoc_faces
        1) JSF 1.2 library (without name - it is the OpenWebBeans JSF integration)

        My library is feeded 2x and OWB never - but I think this is caused with badly written if-condition, please see MYFACES-2537-FacesConfigurator.patch for details.

        Show
        Martin Kočí added a comment - Current implementation does not solve this situation: 2) JSF 2.0 library named cz_markoc_faces 1) JSF 1.2 library (without name - it is the OpenWebBeans JSF integration) My library is feeded 2x and OWB never - but I think this is caused with badly written if-condition, please see MYFACES-2537 -FacesConfigurator.patch for details.
        Martin Kočí made changes -
        Field Original Value New Value
        Attachment MYFACES-2537-FacesConfigurator.patch [ 12435123 ]
        Hide
        Leonardo Uribe added a comment -

        This is another different problem. We should handle it in other issue if possible.

        Show
        Leonardo Uribe added a comment - This is another different problem. We should handle it in other issue if possible.
        Hide
        Leonardo Uribe added a comment -

        Opened MYFACES-2547, so we can close this one

        Show
        Leonardo Uribe added a comment - Opened MYFACES-2547 , so we can close this one
        Leonardo Uribe made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Fix Version/s 2.0.0-beta-2 [ 12314539 ]
        Resolution Fixed [ 1 ]
        Leonardo Uribe made changes -
        Status Resolved [ 5 ] Closed [ 6 ]

          People

          • Assignee:
            Leonardo Uribe
            Reporter:
            Leonardo Uribe
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development