kindraywind / java-diff-utils

Automatically exported from code.google.com/p/java-diff-utils
0 stars 0 forks source link

ArrayIndexOutOfBoundException in DiffRowGenerator when the inline-diffs is used #9

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
This test case reproduces the problem, which is caused by the inline-diff 
calculations. If the "showInlineDiffs" is set to false, then the problem does 
not appear.

public class DiffUtilsDiffRendererTest extends TestCase {

    String first = "anything \n \nother";
    String second ="anything\n\nother";

    public void testDiffRowGenerator() {
        DiffRowGenerator generator = new DiffRowGenerator.Builder()
        .showInlineDiffs(true)
        .ignoreWhiteSpaces(true)
        .ignoreBlankLines(true)
        .columnWidth(Integer.MAX_VALUE) // do not wrap
        .build();
        List<DiffRow> diffRows = generator.generateDiffRows(split(first), split(second));
    }

    private List<String> split(String content) {
        return Arrays.asList(content.split("\n"));
    }

}

Original issue reported on code.google.com by zlus...@gmail.com on 13 Oct 2010 at 9:11

GoogleCodeExporter commented 9 years ago
Hi

Inline diffs is still under development. Thanks for firing this bug. I will 
work on it in near future.

Original comment by dm.naume...@gmail.com on 15 Oct 2010 at 12:22

GoogleCodeExporter commented 9 years ago
Looks good in v1.2. Please, check that you use the latest version before file a 
new bug.

Original comment by dm.naume...@gmail.com on 7 Jun 2011 at 1:57