Uploaded image for project: 'XWiki Commons'
  1. XWiki Commons
  2. XCOMMONS-234

Merge looses data

    XMLWordPrintable

Details

    • Improvement
    • Resolution: Fixed
    • Major
    • 4.1.4, 4.2-milestone-2
    • None
    • Diff
    • None
    • Unit
    • N/A
    • N/A

    Description

      Here is the use case:

      {{groovy}}
      import org.apache.commons.lang3.ArrayUtils;
      
      def c1 = "A\nB\nC\n"
      def c2 = "A\nX\nB\nC\n"
      def c3 = "A\nB\nC\nD\n"
      def c1a = Arrays.asList(c1.split('\\n'))
      def c2a = Arrays.asList(c2.split('\\n'))
      def c3a = Arrays.asList(c3.split('\\n'))
      
      def mresult = services.diff.merge(c1a, c2a, c3a, null)
      
      println mresult.merged.join('\n')
      
      {{/groovy}}
      

      Result:

      A
      X
      C
      D
      

      When it should be

      A
      X
      B
      C
      D
      

      Attachments

        Activity

          People

            tmortagne Thomas Mortagne
            ludovic Ludovic Dubost
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: