Wicket
  1. Wicket
  2. WICKET-5359

org.apache.wicket.util.string.StringValue#equals broken

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 6.10.0
    • Fix Version/s: 6.12.0, 7.0.0
    • Component/s: wicket
    • Labels:
      None

      Description

      The #equals implementation for org.apache.wicket.util.string.StringValue is broken. The following throws an exception instead of just printing 'false':

      StringValue val = StringValue.valueOf("bla", Locale.FRANCE);
      StringValue val2 = StringValue.valueOf("bla", Locale.CANADA);
      System.out.println(val.equals(val2));

      This part of #equals
      Objects.isEqual(locale, stringValue.locale)

      should probably be replaced with something like
      (locale == stringValue.locale || (locale != null && locale.equals(stringValue.locale))

      -> Objects.isEqual is not suitable to determine equality of Locale

        Activity

        Jonas created issue -
        Sven Meier made changes -
        Field Original Value New Value
        Status Open [ 1 ] Resolved [ 5 ]
        Assignee Sven Meier [ svenmeier ]
        Resolution Fixed [ 1 ]
        Martin Grigorov made changes -
        Fix Version/s 7.0.0 [ 12322958 ]
        Fix Version/s 6.12.0 [ 12324889 ]

          People

          • Assignee:
            Sven Meier
            Reporter:
            Jonas
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development