@@ -73,22 +73,7 @@ public Integer call() {
73
73
});
74
74
75
75
Writer writer = new OutputStreamWriter (System .out );
76
- BibliographyConsistencyCheckResultWriter checkResultWriter ;
77
- if ("txt" .equalsIgnoreCase (outputFormat )) {
78
- checkResultWriter = new BibliographyConsistencyCheckResultTxtWriter (
79
- result ,
80
- writer ,
81
- sharedOptions .porcelain ,
82
- argumentProcessor .entryTypesManager ,
83
- databaseContext .getMode ());
84
- } else {
85
- checkResultWriter = new BibliographyConsistencyCheckResultCsvWriter (
86
- result ,
87
- writer ,
88
- sharedOptions .porcelain ,
89
- argumentProcessor .entryTypesManager ,
90
- databaseContext .getMode ());
91
- }
76
+ BibliographyConsistencyCheckResultWriter checkResultWriter = getBibliographyConsistencyCheckResultWriter (result , writer , databaseContext );
92
77
93
78
// System.out should not be closed, therefore no try-with-resources
94
79
try {
@@ -108,4 +93,29 @@ public Integer call() {
108
93
}
109
94
return 0 ;
110
95
}
96
+
97
+ private BibliographyConsistencyCheckResultWriter getBibliographyConsistencyCheckResultWriter (
98
+ BibliographyConsistencyCheck .Result result ,
99
+ Writer writer ,
100
+ BibDatabaseContext databaseContext ) {
101
+ BibliographyConsistencyCheckResultWriter checkResultWriter ;
102
+
103
+ if ("txt" .equalsIgnoreCase (outputFormat )) {
104
+ checkResultWriter = new BibliographyConsistencyCheckResultTxtWriter (
105
+ result ,
106
+ writer ,
107
+ sharedOptions .porcelain ,
108
+ argumentProcessor .entryTypesManager ,
109
+ databaseContext .getMode ());
110
+ } else {
111
+ checkResultWriter = new BibliographyConsistencyCheckResultCsvWriter (
112
+ result ,
113
+ writer ,
114
+ sharedOptions .porcelain ,
115
+ argumentProcessor .entryTypesManager ,
116
+ databaseContext .getMode ());
117
+ }
118
+
119
+ return checkResultWriter ;
120
+ }
111
121
}
0 commit comments