|
26 | 26 | import org.variantsync.diffdetective.util.Diagnostics; |
27 | 27 | import org.variantsync.diffdetective.util.InvocationCounter; |
28 | 28 | import org.variantsync.diffdetective.variation.DiffLinesLabel; |
29 | | -import org.variantsync.diffdetective.variation.diff.DiffTree; |
| 29 | +import org.variantsync.diffdetective.variation.diff.VariationDiff; |
30 | 30 | import org.variantsync.functjonal.iteration.ClusteredIterator; |
31 | 31 | import org.variantsync.functjonal.iteration.MappedIterator; |
32 | 32 |
|
33 | 33 | /** |
34 | 34 | * Encapsulates the state and control flow during an analysis of the commit history of multiple |
35 | | - * repositories using {@link DiffTree}s. Each repository is processed sequentially but the commits |
| 35 | + * repositories using {@link VariationDiff}s. Each repository is processed sequentially but the commits |
36 | 36 | * of each repository can be processed in parallel. |
37 | 37 | * |
38 | 38 | * <p>For thread safety, each thread receives its own instance of {@code Analysis}. The getters |
@@ -65,7 +65,7 @@ public class Analysis { |
65 | 65 | protected RevCommit currentCommit; |
66 | 66 | protected CommitDiff currentCommitDiff; |
67 | 67 | protected PatchDiff currentPatch; |
68 | | - protected DiffTree<DiffLinesLabel> currentDiffTree; |
| 68 | + protected VariationDiff<DiffLinesLabel> currentVariationDiff; |
69 | 69 |
|
70 | 70 | protected final Path outputDir; |
71 | 71 | protected Path outputFile; |
@@ -105,10 +105,10 @@ public PatchDiff getCurrentPatch() { |
105 | 105 |
|
106 | 106 | /** |
107 | 107 | * The currently processed patch. |
108 | | - * Valid only during {@link Hooks#analyzeDiffTree}. |
| 108 | + * Valid only during {@link Hooks#analyzeVariationDiff}. |
109 | 109 | */ |
110 | | - public DiffTree<DiffLinesLabel> getCurrentDiffTree() { |
111 | | - return currentDiffTree; |
| 110 | + public VariationDiff<DiffLinesLabel> getCurrentVariationDiff() { |
| 111 | + return currentVariationDiff; |
112 | 112 | } |
113 | 113 |
|
114 | 114 | /** |
@@ -154,7 +154,7 @@ public <T extends Metadata<T>> void append(ResultKey<T> resultKey, T value) { |
154 | 154 | } |
155 | 155 |
|
156 | 156 | /** |
157 | | - * Hooks for analyzing commits using {@link DiffTree}s. |
| 157 | + * Hooks for analyzing commits using {@link VariationDiff}s. |
158 | 158 | * |
159 | 159 | * <p>In general the hooks of different {@code Hook} instances are called in sequence according |
160 | 160 | * to the order specified in {@link Analysis#Analysis} (except end hooks). Hooks are separated |
@@ -218,7 +218,7 @@ default void onFailedCommit(Analysis analysis) throws Exception {} |
218 | 218 | * The main hook for analyzing non-empty diff trees. |
219 | 219 | * Called at most once during the patch phase. |
220 | 220 | */ |
221 | | - default boolean analyzeDiffTree(Analysis analysis) throws Exception { return true; } |
| 221 | + default boolean analyzeVariationDiff(Analysis analysis) throws Exception { return true; } |
222 | 222 | default void endPatch(Analysis analysis) throws Exception {} |
223 | 223 | default void endCommit(Analysis analysis) throws Exception {} |
224 | 224 | default void endBatch(Analysis analysis) throws Exception {} |
@@ -280,7 +280,7 @@ public static AnalysisResult forEachCommit(Supplier<Analysis> analysis) { |
280 | 280 | * history is processed in batches of {@code commitsToProcessPerThread} on {@code nThreads} in |
281 | 281 | * parallel. {@link Hooks} passed to {@link Analysis#Analysis} are the main customization point |
282 | 282 | * for executing different analyses. By default only the total number of commits and the total |
283 | | - * runtime with multithreading of the {@link DiffTree} parsing is recorded. |
| 283 | + * runtime with multithreading of the {@link VariationDiff} parsing is recorded. |
284 | 284 | * |
285 | 285 | * @param analysisFactory creates independent (at least thread safe) instances the analysis |
286 | 286 | * state |
@@ -426,7 +426,7 @@ protected void processCommit() throws Exception { |
426 | 426 | // parse the commit |
427 | 427 | final CommitDiffResult commitDiffResult = differ.createCommitDiff(currentCommit); |
428 | 428 |
|
429 | | - // report any errors that occurred and exit in case no DiffTree could be parsed. |
| 429 | + // report any errors that occurred and exit in case no VariationDiff could be parsed. |
430 | 430 | getResult().reportDiffErrors(commitDiffResult.errors()); |
431 | 431 | if (commitDiffResult.diff().isEmpty()) { |
432 | 432 | Logger.debug("found commit that failed entirely because:\n{}", commitDiffResult.errors()); |
@@ -463,10 +463,10 @@ protected void processCommit() throws Exception { |
463 | 463 | protected void processPatch() throws Exception { |
464 | 464 | if (currentPatch.isValid()) { |
465 | 465 | // generate TreeDiff |
466 | | - currentDiffTree = currentPatch.getDiffTree(); |
467 | | - currentDiffTree.assertConsistency(); |
| 466 | + currentVariationDiff = currentPatch.getVariationDiff(); |
| 467 | + currentVariationDiff.assertConsistency(); |
468 | 468 |
|
469 | | - runFilterHook(hooks.listIterator(), Hooks::analyzeDiffTree); |
| 469 | + runFilterHook(hooks.listIterator(), Hooks::analyzeVariationDiff); |
470 | 470 | } |
471 | 471 | } |
472 | 472 |
|
|
0 commit comments