Single letter Project keys fail

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: Medium
    • 3.7.2
    • Affects Version/s: None
    • Component/s: Project - Actions
    • None

      JiraKeyUtils contains the following code:

      JiraKeyUtiles.java
          /**
           * @return True if the supplied issue key starts with a valid project key, and ends with a number
           */
          public static boolean validIssueKey(String key)
          {
              if (key == null)
                  return false;
      
              int hypenLocation = key.lastIndexOf('-');
              if (hypenLocation > 1)
      ...
      
      

      if (hypenLocation > 1) fails for single letter project keys. (translates to - hyphen appears after the 2 letter - 0 is the first char)

      Should be changed to - if (hypenLocation > 0) (hyphen is not the first letter)

      And, Mike, I wont even bring up the spelling mistake.....

              Assignee:
              TimP
              Reporter:
              Nick Menere [Atlassian] (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: