jpackage: Make default equals() in jdk.jpackage.test.CannedFormattedString class work as expected

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Unresolved
    • Priority: P4
    • 27
    • Affects Version/s: 25, 26, 27
    • Component/s: tools
    • None
    • In Review
    • generic
    • generic

      jdk.jpackage.test.CannedFormattedString record class [1] has the "args" parameter of type Object[]. This makes the default equals() method work unexpectedly:

      ```
      var date = new Date();

      CannedFormattedString strA = JPackageStringBundle.MAIN.cannedFormattedString("foo", "param.copyright.default", date);

      CannedFormattedString strB = JPackageStringBundle.MAIN.cannedFormattedString("foo", "param.copyright.default", date);

      assertEquals(strA, strB); // assertion fails
      ```

      Replace the type of the "args" parameter from Object[] to List<Object>.

      [1] https://github.com/openjdk/jdk/blob/0aa52d633a72a240a22c55fb14d9e9744d2cd675/test/jdk/tools/jpackage/helpers/jdk/jpackage/test/CannedFormattedString.java#L34

            Assignee:
            Alexey Semenyuk
            Reporter:
            Alexey Semenyuk
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: