Closed surli closed 6 years ago
Hi @surli , Yes, It's done. You can find both patches diffs (formatted and not formatted) inside the output folder: e.g. (not formatted)
I think you misunderstood my request.
I want to be able to get the path of the file(s) that will be changed by the produced patch.
For example the patch would be applied on src/main/java/MySuperClass.java
, I want to get that path.
Hi @surli Sorry for my misunderstand. I get your point. Currently that information is not provided. I will implement it right now. Regards Matias
Hi @surli
I commit the feature: now, you can find the patch to the modified files in the standard output and JSON files.
E.g.,
PATH=
LINE=72
SUSPICIOUNESS=1
....
ORIGINAL_CODE=return solve(min, max) ....
you can find the patch to the modified files in the standard output and JSON files.
Isn't it available through the java API? I wanted to access it while I get the diff and right now I'm doing this:
for (ProgramVariant pv : solutions) {
if (pv.isSolution()) {
String diff = pv.getPatchDiff().getFormattedDiff();
}
}
I added a way, see this test: https://github.com/SpoonLabs/astor/blob/master/src/test/java/fr/inria/astor/test/repair/core/OutputTest.java#L197
Great thanks!
When a ProgramVariant is a solution, I currently get the PatchDiff to get its formatted diff. Is it possible to also record the path of the file to patch somewhere?