File tree Expand file tree Collapse file tree 2 files changed +50
-2
lines changed
src/main/java/org/variantsync/diffdetective Expand file tree Collapse file tree 2 files changed +50
-2
lines changed Original file line number Diff line number Diff line change 1+ package org .variantsync .diffdetective .analysis .strategies ;
2+
3+ import java .io .IOException ;
4+ import java .io .OutputStream ;
5+ import java .nio .file .Path ;
6+
7+ import org .apache .commons .io .output .CloseShieldOutputStream ;
8+ import org .tinylog .Logger ;
9+ import org .variantsync .diffdetective .datasets .Repository ;
10+ import org .variantsync .diffdetective .diff .CommitDiff ;
11+ import org .variantsync .diffdetective .util .IO ;
12+
13+ /**
14+ * Collects all linegraph representations generated by an analysis and exports them at the end.
15+ * @author Benjamin Moosherr
16+ */
17+ public class AnalyzeAllAndExport extends AnalysisStrategy {
18+ private OutputStream lineGraphDestination ;
19+
20+ @ Override
21+ public void start (Repository repo , Path outputPath ) {
22+ try {
23+ lineGraphDestination = IO .newBufferedOutputStream (outputPath );
24+ } catch (IOException e ) {
25+ Logger .error (e );
26+ }
27+ }
28+
29+ @ Override
30+ public OutputStream onCommit (CommitDiff commit ) {
31+ try {
32+ lineGraphDestination .flush ();
33+ } catch (IOException e ) {
34+ Logger .error (e );
35+ }
36+
37+ return new CloseShieldOutputStream (lineGraphDestination );
38+ }
39+
40+ @ Override
41+ public void end () {
42+ try {
43+ lineGraphDestination .close ();
44+ } catch (IOException e ) {
45+ Logger .error (e );
46+ }
47+ }
48+ }
Original file line number Diff line number Diff line change 66import org .variantsync .diffdetective .analysis .CommitHistoryAnalysisTaskFactory ;
77import org .variantsync .diffdetective .analysis .HistoryAnalysis ;
88import org .variantsync .diffdetective .analysis .strategies .AnalysisStrategy ;
9- import org .variantsync .diffdetective .analysis .strategies .AnalyzeAllThenExport ;
9+ import org .variantsync .diffdetective .analysis .strategies .AnalyzeAllAndExport ;
1010import org .variantsync .diffdetective .datasets .*;
1111import org .variantsync .diffdetective .datasets .predefined .StanciulescuMarlin ;
1212import org .variantsync .diffdetective .diff .difftree .filter .DiffTreeFilter ;
@@ -87,7 +87,7 @@ public static LineGraphExportOptions MiningExportOptions(final Repository reposi
8787 }
8888
8989 public static AnalysisStrategy MiningStrategy () {
90- return new AnalyzeAllThenExport ();
90+ return new AnalyzeAllAndExport ();
9191// new CompositeDiffTreeMiningStrategy(
9292// new MineAndExportIncrementally(1000),
9393// new MiningMonitor(10)
You can’t perform that action at this time.
0 commit comments