commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Raffi Khatchadourian (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (CSV-154) CSVFormat.withHeaderComments() doesn't print comments header comments depending on when it is called
Date Wed, 29 Jul 2015 15:24:04 GMT

     [ https://issues.apache.org/jira/browse/CSV-154?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Raffi Khatchadourian updated CSV-154:
-------------------------------------
    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:

{code}
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());
{code}

while this code *will* print them:

{code}
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());
{code}

  was:
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());


> CSVFormat.withHeaderComments() doesn't print comments header comments depending on when
it is called
> ----------------------------------------------------------------------------------------------------
>
>                 Key: CSV-154
>                 URL: https://issues.apache.org/jira/browse/CSV-154
>             Project: Commons CSV
>          Issue Type: Bug
>          Components: Printer
>    Affects Versions: 1.1
>            Reporter: Raffi Khatchadourian
>            Priority: Minor
>
> 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:
> {code}
> 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());
> {code}
> while this code *will* print them:
> {code}
> 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());
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message