Skip to content
Permalink
Browse files
Use final.
  • Loading branch information
garydgregory committed Jul 8, 2021
1 parent 6bfd380 commit 4083b7a2a0e7c2fa952b034614224fe6dc786b34
Showing 1 changed file with 9 additions and 9 deletions.
@@ -90,7 +90,7 @@ private static String printable(final String s) {
private String longText2;

private final String recordSeparator = CSVFormat.DEFAULT.getRecordSeparator();

private void doOneRandom(final CSVFormat format) throws Exception {
final Random r = new Random();

@@ -164,7 +164,7 @@ private CSVPrinter printWithHeaderComments(final StringWriter sw, final Date now
throws IOException {
// Use withHeaderComments first to test CSV-145
// @formatter:off
CSVFormat format = baseFormat.builder()
final CSVFormat format = baseFormat.builder()
.setHeaderComments("Generated by Apache Commons CSV 1.1", now)
.setCommentMarker('#')
.setHeader("Col1", "Col2")
@@ -1270,8 +1270,8 @@ public void testPrintCSVParser() throws IOException {
+ "a4,b4\n"// 4)
;
final String[][] res = {{"a1", "b1"}, {"a2", "b2"}, {"a3", "b3"}, {"a4", "b4"}};
CSVFormat format = CSVFormat.DEFAULT;
StringWriter sw = new StringWriter();
final CSVFormat format = CSVFormat.DEFAULT;
final StringWriter sw = new StringWriter();
try (final CSVPrinter printer = format.print(sw); final CSVParser parser = CSVParser.parse(code, format)) {
printer.printRecords(parser);
}
@@ -1290,10 +1290,10 @@ public void testPrintCSVRecord() throws IOException {
+ "a4,b4\n"// 4)
;
final String[][] res = {{"a1", "b1"}, {"a2", "b2"}, {"a3", "b3"}, {"a4", "b4"}};
CSVFormat format = CSVFormat.DEFAULT;
StringWriter sw = new StringWriter();
final CSVFormat format = CSVFormat.DEFAULT;
final StringWriter sw = new StringWriter();
try (final CSVPrinter printer = format.print(sw); final CSVParser parser = CSVParser.parse(code, format)) {
for (CSVRecord record : parser) {
for (final CSVRecord record : parser) {
printer.printRecord(record);
}
}
@@ -1312,8 +1312,8 @@ public void testPrintCSVRecords() throws IOException {
+ "a4,b4\n"// 4)
;
final String[][] res = {{"a1", "b1"}, {"a2", "b2"}, {"a3", "b3"}, {"a4", "b4"}};
CSVFormat format = CSVFormat.DEFAULT;
StringWriter sw = new StringWriter();
final CSVFormat format = CSVFormat.DEFAULT;
final StringWriter sw = new StringWriter();
try (final CSVPrinter printer = format.print(sw); final CSVParser parser = CSVParser.parse(code, format)) {
printer.printRecords(parser.getRecords());
}

0 comments on commit 4083b7a

Please sign in to comment.