javaserverfaces
  1. javaserverfaces
  2. JAVASERVERFACES-2393

MenuRenderer should compare String values for determining if a option is initially selected

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Invalid
    • Affects Version/s: 2.1.7
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      Due to compatibility with issues with CDI it is possible for the value @ line 725 - https://github.com/bleathem/mojarra/blob/master/jsf-ri/src/main/java/com/sun/faces/renderkit/html_basic/MenuRenderer.java#L725 to be a proxy and thus can fail comparisons.

      I would suggest comparing on the converted String values rather than objects here to protect against proxies.

        Activity

        Hide
        rogerk added a comment -

        Can you provide a test case that would cause the comparison issue?

        Show
        rogerk added a comment - Can you provide a test case that would cause the comparison issue?
        Hide
        codylerum added a comment -

        I'll give it a shot. Can you point me at an example test case and and instructions for running the suite?

        Show
        codylerum added a comment - I'll give it a shot. Can you point me at an example test case and and instructions for running the suite?
        Hide
        rogerk added a comment -

        Actually, a small simplified Maven example that causes or illustrates the issue would be a good start.

        Show
        rogerk added a comment - Actually, a small simplified Maven example that causes or illustrates the issue would be a good start.
        Hide
        Manfred Riem added a comment -

        According to http://docs.oracle.com/javase/6/docs/api/java/lang/reflect/Proxy.html if you have a proxy it is required to make sure the following methods: hashCode, equals, or toString will be delegated down to what it is proxying.

        Show
        Manfred Riem added a comment - According to http://docs.oracle.com/javase/6/docs/api/java/lang/reflect/Proxy.html if you have a proxy it is required to make sure the following methods: hashCode, equals, or toString will be delegated down to what it is proxying.

          People

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

            Dates

            • Created:
              Updated:
              Resolved: