Skip to content

Commit

Permalink
Use final.
Browse files Browse the repository at this point in the history
  • Loading branch information
garydgregory committed Jul 8, 2021
1 parent 6bfd380 commit 4083b7a
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/test/java/org/apache/commons/csv/CSVPrinterTest.java
Expand Up @@ -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();

Expand Down Expand Up @@ -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")
Expand Down Expand Up @@ -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);
}
Expand All @@ -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);
}
}
Expand All @@ -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());
}
Expand Down

0 comments on commit 4083b7a

Please sign in to comment.