1- package org .variantsync .vevos .extraction .fast ;
1+ package org .variantsync .vevos .extraction .analysis . fast ;
22
33import org .eclipse .jgit .diff .DiffEntry ;
44import org .eclipse .jgit .revwalk .RevCommit ;
77import org .variantsync .diffdetective .editclass .proposed .ProposedEditClasses ;
88import org .variantsync .diffdetective .metadata .EditClassCount ;
99import org .variantsync .diffdetective .variation .diff .Time ;
10- import org .variantsync .vevos .extraction .GTExtraction ;
10+ import org .variantsync .vevos .extraction .analysis . VariabilityAnalysis ;
1111import org .variantsync .vevos .extraction .common .FileGT ;
1212import org .variantsync .vevos .extraction .common .GroundTruth ;
1313import org .variantsync .vevos .extraction .error .MatchingException ;
2424 * Extracts ground truths for all repositories in a dataset. The ground truth consists of presence
2525 * conditions for each file, a list of all variables, and commit metadata.
2626 */
27- public class FastGTExtraction implements Analysis .Hooks , GTExtraction {
27+ public class FastVariabilityAnalysis implements Analysis .Hooks , VariabilityAnalysis {
2828 private final static String SUCCESS_COMMIT_FILE = "SUCCESS_COMMITS.txt" ;
2929 private final static String ERROR_COMMIT_FILE = "ERROR_COMMITS.txt" ;
3030 private final static String EMPTY_COMMIT_FILE = "EMPTY_COMMITS.txt" ;
@@ -44,7 +44,7 @@ public class FastGTExtraction implements Analysis.Hooks, GTExtraction {
4444 private final Path resultsRoot ;
4545 private final boolean extractCodeMatching ;
4646
47- public FastGTExtraction (boolean printEnabled , Path resultsRoot , boolean ignorePCChanges , boolean extractCodeMatching ) {
47+ public FastVariabilityAnalysis (boolean printEnabled , Path resultsRoot , boolean ignorePCChanges , boolean extractCodeMatching ) {
4848 this .printEnabled = printEnabled ;
4949 this .resultsRoot = resultsRoot ;
5050 this .threadBatches = new ConcurrentHashMap <>();
@@ -82,7 +82,7 @@ public void onFailedParse(Analysis analysis) {
8282 }
8383
8484 private void extractionFailed (RevCommit commit ) {
85- synchronized (FastGTExtraction .class ) {
85+ synchronized (FastVariabilityAnalysis .class ) {
8686 Logger .warn ("Was not able to extract ground truth for commit " + commit .getName ());
8787 Serde .appendText (resultsRoot .resolve (ERROR_COMMIT_FILE ), commit .getName () + "\n " );
8888 failedCommits .add (commit .getName ());
@@ -93,10 +93,10 @@ private void extractionFailed(RevCommit commit) {
9393 public void endCommit (Analysis analysis ) {
9494 RevCommit commit = analysis .getCurrentCommit ();
9595
96- synchronized (FastGTExtraction .class ) {
97- FastGTExtraction .numProcessed ++;
98- if (FastGTExtraction .numProcessed % 1_000 == 0 ) {
99- Logger .info ("End Processing of Commit ({}): {}" , FastGTExtraction .numProcessed ,
96+ synchronized (FastVariabilityAnalysis .class ) {
97+ FastVariabilityAnalysis .numProcessed ++;
98+ if (FastVariabilityAnalysis .numProcessed % 1_000 == 0 ) {
99+ Logger .info ("End Processing of Commit ({}): {}" , FastVariabilityAnalysis .numProcessed ,
100100 commit .name ());
101101 }
102102 }
@@ -121,16 +121,16 @@ public void endCommit(Analysis analysis) {
121121 // Return early and do not save any data, if the ground truths are both empty.
122122 // In this case, no changes have been analyzed, and we are not interested in the commit's
123123 // data.
124- synchronized (FastGTExtraction .class ) {
124+ synchronized (FastVariabilityAnalysis .class ) {
125125 Logger .debug ("No code changes for " + commit .getName ());
126126 Serde .appendText (resultsRoot .resolve (EMPTY_COMMIT_FILE ), commit .getName () + "\n " );
127127 failedCommits .add (commit .getName ());
128128 }
129129 return ;
130130 }
131131
132- GTExtraction .makeComplete (groundTruthBefore );
133- GTExtraction .makeComplete (groundTruthAfter );
132+ VariabilityAnalysis .makeComplete (groundTruthBefore );
133+ VariabilityAnalysis .makeComplete (groundTruthAfter );
134134
135135 if (printEnabled ) {
136136 print (groundTruthBefore , commit .getName ());
@@ -174,7 +174,7 @@ public void endCommit(Analysis analysis) {
174174 s -> Serde .writeToFile (commitSaveDir .resolve (COMMIT_PARENTS_FILE ), s ),
175175 () -> Serde .writeToFile (commitSaveDir .resolve (COMMIT_PARENTS_FILE ), "" ));
176176
177- synchronized (FastGTExtraction .class ) {
177+ synchronized (FastVariabilityAnalysis .class ) {
178178 Serde .appendText (resultsRoot .resolve (SUCCESS_COMMIT_FILE ), commit .getName () + "\n " );
179179 }
180180
@@ -244,11 +244,11 @@ public boolean analyzeVariationDiff(Analysis analysis) {
244244 // Logger.debug("Node: {}", node);
245245 // If the file is not completely new, we consider the before case
246246 if (!(changeType == DiffEntry .ChangeType .ADD )) {
247- GTExtraction .analyzeNode (fileGTBefore , node , Time .BEFORE , ignorePCChanges );
247+ VariabilityAnalysis .analyzeNode (fileGTBefore , node , Time .BEFORE , ignorePCChanges );
248248 }
249249 if (!(changeType == DiffEntry .ChangeType .DELETE )) {
250250 // If the file has not been deleted, we consider the after case
251- GTExtraction .analyzeNode (fileGTAfter , node , Time .AFTER , ignorePCChanges );
251+ VariabilityAnalysis .analyzeNode (fileGTAfter , node , Time .AFTER , ignorePCChanges );
252252 }
253253 } catch (MatchingException e ) {
254254 Logger .error ("unhandled exception while analyzing {} -> {} for commit {}." ,
0 commit comments