Uploaded image for project: 'Felix'
  1. Felix
  2. FELIX-4616

BundleRepository ResourceComparator violates comparison contract

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: bundlerepository-1.6.6
    • Fix Version/s: bundlerepository-2.0.4
    • Component/s: None
    • Labels:
      None

      Description

      The ResourceComparator use to sort resources by presentation name may cause the Arrays.sort to throw IllegalArgumentException if bundles without a bundle name are present.

      This occurs because -1 is always returned if two compared resources do not have a bundle name.
      This violates the sgn(x,y)=-sgn(y,x) for all x,y.

      This forced us into a workaround of setting a system property to force Arrays.sort to use the legacy sort that does not throw exceptions.

        Attachments

          Activity

            People

            • Assignee:
              cziegeler Carsten Ziegeler
              Reporter:
              jascott James Scott
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: