Use final.
This commit is contained in:
parent
6bfd380cb1
commit
4083b7a2a0
|
@ -90,7 +90,7 @@ public class CSVPrinterTest {
|
|||
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 @@ public class CSVPrinterTest {
|
|||
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 class CSVPrinterTest {
|
|||
+ "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 class CSVPrinterTest {
|
|||
+ "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 class CSVPrinterTest {
|
|||
+ "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());
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue