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

White spaces are incorrectly removed when passing data via .temp2 files

XMLWordPrintable

      In latest version (75422af ) of class MultiSCMChangeLogParser, line #73-76:

      while(length > 0 && Character.isWhitespace(data[startIndex])) {
          startIndex += 1;
          length -= 1;
      }
      

      This removes all white spaces (including newline, etc.) regardless if the data is the start of the whole section.
      This randomly cause problem, depends on SAX: When it pass everything in one data[], then it's fine. But sometimes, a section can be devided into several small pieces, and the white spaces in the middle can be incorrectly removed.
      For example, the following data from git log:

      commit b914376ca8a58c146636a84de9fa6d5acb8e020f
      tree 43712b02868755704390e4f51ab480a966980874
      parent e94e7abe6bd1df3c02e862107c3ae676f450ed2d

      …..
      

      Will be parsed to GitChangeLogParser as:

      commit b914376ca8a58c146636a84de9fa6d5acb8e020ftree 43712b02868755704390e4f51ab480a966980874parent e94e7abe6bd1df3c02e862107c3ae676f450ed2d
…..
      

      And it can not be parsed correctly.

      I attached a snapshot from Jenkins, when it happens, the "changes" looks like the snapshot.

      BTW, the snapshot is from v0.3 in our production system, but as far as I see, the latest version also have the same problem.

            kbell Kevin Bell
            dong_zhang Dong Zhang
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: