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

Server.isHudsonBuild173orGreater() bug

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Icon: Major Major
    • trayapp
    • None
    • Platform: All, OS: All

      Code always tacks on a space onto the result, therefore if there is no X-Hudson
      field, then the returned version will be the String "null "

      String version = conn.getHeaderField("X-Hudson") + " ";
      Matcher matcher = null;
      if (version != null)
      matcher = pattern.matcher(version);

      The corrected code could be something like this:

      String version = conn.getHeaderField("X-Hudson");
      Matcher matcher = null;
      if (version != null)
      matcher = pattern.matcher(version + " ");

            davyboyhayes davyboyhayes
            jchristi jchristi
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: