Details
-
Bug
-
Status: Open
-
Minor
-
Resolution: Unresolved
-
1.1
-
None
-
None
-
Important
Description
When building a CSVFormat with header comments, the order in which the with* methods are called determines if the header comments will appear (note that this does not seem to be an issue with the header, just the header comments). For example, the following code will not print a header comment:
Stream<String> header = getCSVHeader(); CSVFormat format = CSVFormat.EXCEL.withHeader(header.toArray(String[]::new)).withHeaderComments("Maximum analysis depth: " + this.getMaximumAnalysisDepth()).withCommentMarker('#'); System.out.println(format.getHeaderComments());
while this code will print them:
Stream<String> header = getCSVHeader(); CSVFormat format = CSVFormat.EXCEL.withHeader(header.toArray(String[]::new)).withCommentMarker('#').withHeaderComments("Maximum analysis depth: " + this.getMaximumAnalysisDepth()); System.out.println(format.getHeaderComments());