Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-75643

Jira Jenkins plugin VersionComparator doesn't sort logically if version contains dashes

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Postponed
    • Icon: Minor Minor
    • jira-plugin
    • None

      When obtaining a list of Jira release versions the result isn't sorted properly if version contains dashes

      In the VersionComparator everything before the first dash is ignored when comparing the versions.

      Though the VersionComparatorTest contains the following testcases:

              

      assertEquals(1, compare("1.1.1-RC1", "1.1.1-RC2"));
      assertEquals(-1, compare("2.2.2", "1.1.1.2"));

      The following Testcases would fail:

      assertEquals(-1, compare("1.1.2-RC1", "1.1.1-RC2"));
      assertEquals(-1, compare("2.2.2-RC1", "1.1.1-RC1"));
      assertEquals(1, compare("FOO-1.1.1-RC1", "FOO-1.1.1-RC2"));

       

       

       

            Unassigned Unassigned
            baardaap Mark
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: