Skip to content

Commit 4083b7a

Browse files
committed
Use final.
1 parent 6bfd380 commit 4083b7a

1 file changed

Lines changed: 9 additions & 9 deletions

File tree

src/test/java/org/apache/commons/csv/CSVPrinterTest.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ private static String printable(final String s) {
9090
private String longText2;
9191

9292
private final String recordSeparator = CSVFormat.DEFAULT.getRecordSeparator();
93-
93+
9494
private void doOneRandom(final CSVFormat format) throws Exception {
9595
final Random r = new Random();
9696

@@ -164,7 +164,7 @@ private CSVPrinter printWithHeaderComments(final StringWriter sw, final Date now
164164
throws IOException {
165165
// Use withHeaderComments first to test CSV-145
166166
// @formatter:off
167-
CSVFormat format = baseFormat.builder()
167+
final CSVFormat format = baseFormat.builder()
168168
.setHeaderComments("Generated by Apache Commons CSV 1.1", now)
169169
.setCommentMarker('#')
170170
.setHeader("Col1", "Col2")
@@ -1270,8 +1270,8 @@ public void testPrintCSVParser() throws IOException {
12701270
+ "a4,b4\n"// 4)
12711271
;
12721272
final String[][] res = {{"a1", "b1"}, {"a2", "b2"}, {"a3", "b3"}, {"a4", "b4"}};
1273-
CSVFormat format = CSVFormat.DEFAULT;
1274-
StringWriter sw = new StringWriter();
1273+
final CSVFormat format = CSVFormat.DEFAULT;
1274+
final StringWriter sw = new StringWriter();
12751275
try (final CSVPrinter printer = format.print(sw); final CSVParser parser = CSVParser.parse(code, format)) {
12761276
printer.printRecords(parser);
12771277
}
@@ -1290,10 +1290,10 @@ public void testPrintCSVRecord() throws IOException {
12901290
+ "a4,b4\n"// 4)
12911291
;
12921292
final String[][] res = {{"a1", "b1"}, {"a2", "b2"}, {"a3", "b3"}, {"a4", "b4"}};
1293-
CSVFormat format = CSVFormat.DEFAULT;
1294-
StringWriter sw = new StringWriter();
1293+
final CSVFormat format = CSVFormat.DEFAULT;
1294+
final StringWriter sw = new StringWriter();
12951295
try (final CSVPrinter printer = format.print(sw); final CSVParser parser = CSVParser.parse(code, format)) {
1296-
for (CSVRecord record : parser) {
1296+
for (final CSVRecord record : parser) {
12971297
printer.printRecord(record);
12981298
}
12991299
}
@@ -1312,8 +1312,8 @@ public void testPrintCSVRecords() throws IOException {
13121312
+ "a4,b4\n"// 4)
13131313
;
13141314
final String[][] res = {{"a1", "b1"}, {"a2", "b2"}, {"a3", "b3"}, {"a4", "b4"}};
1315-
CSVFormat format = CSVFormat.DEFAULT;
1316-
StringWriter sw = new StringWriter();
1315+
final CSVFormat format = CSVFormat.DEFAULT;
1316+
final StringWriter sw = new StringWriter();
13171317
try (final CSVPrinter printer = format.print(sw); final CSVParser parser = CSVParser.parse(code, format)) {
13181318
printer.printRecords(parser.getRecords());
13191319
}

0 commit comments

Comments
 (0)