File tree Expand file tree Collapse file tree
src/main/java/org/variantsync/diffdetective/experiments/thesis_es Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -25,12 +25,17 @@ public class UnparseAnalysis implements Analysis.Hooks {
2525
2626 private StringBuilder csv ;
2727
28+ // for debugging
29+ private int errorCount = 0 ;
30+
2831 @ Override
2932 public void initializeResults (Analysis analysis ) {
3033 Analysis .Hooks .super .initializeResults (analysis );
3134
3235 csv = new StringBuilder ();
3336 csv .append (UnparseEvaluation .makeHeader (CSV .DEFAULT_CSV_DELIMITER )).append (StringUtils .LINEBREAK );
37+
38+ errorCount = 0 ;
3439 }
3540
3641 @ Override
@@ -67,7 +72,8 @@ public boolean analyzeVariationDiff(Analysis analysis) throws Exception {
6772 }
6873 if (!boolOr (treeBeforeTest )) {
6974 error = error * 3 ;
70- errorSave [1 ] = codeBefore ;
75+ reportErrorToFile (analysis , codeBefore );
76+ // errorSave[1] = codeBefore;
7177 }
7278 if (!boolOr (treeAfterTest )) {
7379 error = error * 5 ;
@@ -98,6 +104,13 @@ public void endBatch(Analysis analysis) throws IOException {
98104 csv .toString ());
99105 }
100106
107+ private void reportErrorToFile (Analysis analysis , String errorMessage ) throws IOException {
108+ IO .write (
109+ FileUtils .addExtension (analysis .getOutputFile ().resolve ("_error" + errorCount ), ".txt" ),
110+ errorMessage );
111+ ++errorCount ;
112+ }
113+
101114 public static String removeWhitespace1 (String string ) {
102115 string = string .replaceAll ("\n (\\ s*\n )+" , "\n " );
103116 string = string .replaceAll ("\n \\ s+" , "\n " );
You can’t perform that action at this time.
0 commit comments