java-diff-utils is a library for comparing texts: computing diffs, applying patches, generating unified diffs,... Result from Ziyuan: Explanation for the bug: We feed the passed test cases from Ziyuan to Daikon. After a while, Daikon creates a lot of invariants (file). We check the invariants inside the function parseUnifiedDiff(). However, no useful invariants has been found.
The input of FailureDoc is a sequence. In this case, we manually create below sequence as its input. However, FailureDoc says that the sequence has not error and does not give any explanation. START SEQUENCE var0 = cons : issues.issue10.TestIssue10.<init>() : var1 = prim : java.lang.String:"original1" : var2 = method : issues.issue10.TestIssue10.getFile(java.lang.String) : var0 var1 var3 = cons : issues.issue10.Patcher.<init>(java.lang.String) : var2 var4 = prim : java.lang.String:"patch1.1" : var5 = method : issues.issue10.TestIssue10.getFile(java.lang.String) : var0 var4 var6 = method : issues.issue10.Patcher.patch(java.lang.String) : var3 var5 END SEQUENCE
https://code.google.com/p/java-diff-utils/
Issue 10: https://code.google.com/p/java-diff-utils/issues/detail?id=10&can=1
Problem:
We have 1 original text file and a patch file for it, when apply patch for the original text, we get an exception with this stack trace:
You can get the input files in the above link of this issue
The predicate is output to the users:
line.isEmpty == false (difflib.DiffUtils:137)
In the function DiffUtils.parseUnifiedDiff(List
This is the fix for the bug: