Use final.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/csv/trunk@1725344 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
54597a8b8e
commit
453cfcbb59
|
@ -181,7 +181,7 @@ public final class CSVFormat implements Serializable {
|
|||
|
||||
private final CSVFormat format;
|
||||
|
||||
private Predefined(CSVFormat format) {
|
||||
private Predefined(final CSVFormat format) {
|
||||
this.format = format;
|
||||
}
|
||||
|
||||
|
|
|
@ -379,26 +379,26 @@ public class CSVFormatTest {
|
|||
@Test
|
||||
public void testJiraCsv154_withCommentMarker() throws IOException {
|
||||
final String comment = "This is a header comment";
|
||||
CSVFormat format = CSVFormat.EXCEL.withHeader("H1", "H2").withCommentMarker('#').withHeaderComments(comment);
|
||||
StringBuilder out = new StringBuilder();
|
||||
final CSVFormat format = CSVFormat.EXCEL.withHeader("H1", "H2").withCommentMarker('#').withHeaderComments(comment);
|
||||
final StringBuilder out = new StringBuilder();
|
||||
final CSVPrinter printer = format.print(out);
|
||||
printer.print("A");
|
||||
printer.print("B");
|
||||
printer.close();
|
||||
String s = out.toString();
|
||||
final String s = out.toString();
|
||||
Assert.assertTrue(s, s.contains(comment));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testJiraCsv154_withHeaderComments() throws IOException {
|
||||
final String comment = "This is a header comment";
|
||||
CSVFormat format = CSVFormat.EXCEL.withHeader("H1", "H2").withHeaderComments(comment).withCommentMarker('#');
|
||||
StringBuilder out = new StringBuilder();
|
||||
final CSVFormat format = CSVFormat.EXCEL.withHeader("H1", "H2").withHeaderComments(comment).withCommentMarker('#');
|
||||
final StringBuilder out = new StringBuilder();
|
||||
final CSVPrinter printer = format.print(out);
|
||||
printer.print("A");
|
||||
printer.print("B");
|
||||
printer.close();
|
||||
String s = out.toString();
|
||||
final String s = out.toString();
|
||||
Assert.assertTrue(s, s.contains(comment));
|
||||
}
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ public class JiraCsv167Test {
|
|||
@Test
|
||||
@Ignore("Fails")
|
||||
public void parse() throws IOException {
|
||||
File csvData = new File("src/test/resources/csv-167/sample1.csv");
|
||||
final File csvData = new File("src/test/resources/csv-167/sample1.csv");
|
||||
CSVFormat format = CSVFormat.DEFAULT;
|
||||
//
|
||||
format = format.withAllowMissingColumnNames(false);
|
||||
|
@ -46,10 +46,10 @@ public class JiraCsv167Test {
|
|||
format = format.withRecordSeparator('\n');
|
||||
format = format.withSkipHeaderRecord(false);
|
||||
//
|
||||
CSVParser parser = CSVParser.parse(csvData, Charset.defaultCharset(), format);
|
||||
final CSVParser parser = CSVParser.parse(csvData, Charset.defaultCharset(), format);
|
||||
int comments = 0;
|
||||
int records = 0;
|
||||
for (CSVRecord csvRecord : parser) {
|
||||
for (final CSVRecord csvRecord : parser) {
|
||||
if (csvRecord.isComment()) {
|
||||
comments++;
|
||||
} else {
|
||||
|
|
Loading…
Reference in New Issue