@@ -304,7 +304,7 @@ public void testEOLQuoted() throws IOException {
304304
305305 @ Test
306306 public void testEscapeBackslash1 () throws IOException {
307- StringWriter sw = new StringWriter ();
307+ final StringWriter sw = new StringWriter ();
308308 try (final CSVPrinter printer = new CSVPrinter (sw , CSVFormat .DEFAULT .withQuote (QUOTE_CH ))) {
309309 printer .print ("\\ " );
310310 }
@@ -313,7 +313,7 @@ public void testEscapeBackslash1() throws IOException {
313313
314314 @ Test
315315 public void testEscapeBackslash2 () throws IOException {
316- StringWriter sw = new StringWriter ();
316+ final StringWriter sw = new StringWriter ();
317317 try (final CSVPrinter printer = new CSVPrinter (sw , CSVFormat .DEFAULT .withQuote (QUOTE_CH ))) {
318318 printer .print ("\\ \r " );
319319 }
@@ -322,7 +322,7 @@ public void testEscapeBackslash2() throws IOException {
322322
323323 @ Test
324324 public void testEscapeBackslash3 () throws IOException {
325- StringWriter sw = new StringWriter ();
325+ final StringWriter sw = new StringWriter ();
326326 try (final CSVPrinter printer = new CSVPrinter (sw , CSVFormat .DEFAULT .withQuote (QUOTE_CH ))) {
327327 printer .print ("X\\ \r " );
328328 }
@@ -331,7 +331,7 @@ public void testEscapeBackslash3() throws IOException {
331331
332332 @ Test
333333 public void testEscapeBackslash4 () throws IOException {
334- StringWriter sw = new StringWriter ();
334+ final StringWriter sw = new StringWriter ();
335335 try (final CSVPrinter printer = new CSVPrinter (sw , CSVFormat .DEFAULT .withQuote (QUOTE_CH ))) {
336336 printer .print ("\\ \\ " );
337337 }
@@ -340,7 +340,7 @@ public void testEscapeBackslash4() throws IOException {
340340
341341 @ Test
342342 public void testEscapeBackslash5 () throws IOException {
343- StringWriter sw = new StringWriter ();
343+ final StringWriter sw = new StringWriter ();
344344 try (final CSVPrinter printer = new CSVPrinter (sw , CSVFormat .DEFAULT .withQuote (QUOTE_CH ))) {
345345 printer .print ("\\ \\ " );
346346 }
@@ -349,7 +349,7 @@ public void testEscapeBackslash5() throws IOException {
349349
350350 @ Test
351351 public void testEscapeNull1 () throws IOException {
352- StringWriter sw = new StringWriter ();
352+ final StringWriter sw = new StringWriter ();
353353 try (final CSVPrinter printer = new CSVPrinter (sw , CSVFormat .DEFAULT .withEscape (null ))) {
354354 printer .print ("\\ " );
355355 }
@@ -358,7 +358,7 @@ public void testEscapeNull1() throws IOException {
358358
359359 @ Test
360360 public void testEscapeNull2 () throws IOException {
361- StringWriter sw = new StringWriter ();
361+ final StringWriter sw = new StringWriter ();
362362 try (final CSVPrinter printer = new CSVPrinter (sw , CSVFormat .DEFAULT .withEscape (null ))) {
363363 printer .print ("\\ \r " );
364364 }
@@ -367,7 +367,7 @@ public void testEscapeNull2() throws IOException {
367367
368368 @ Test
369369 public void testEscapeNull3 () throws IOException {
370- StringWriter sw = new StringWriter ();
370+ final StringWriter sw = new StringWriter ();
371371 try (final CSVPrinter printer = new CSVPrinter (sw , CSVFormat .DEFAULT .withEscape (null ))) {
372372 printer .print ("X\\ \r " );
373373 }
@@ -376,7 +376,7 @@ public void testEscapeNull3() throws IOException {
376376
377377 @ Test
378378 public void testEscapeNull4 () throws IOException {
379- StringWriter sw = new StringWriter ();
379+ final StringWriter sw = new StringWriter ();
380380 try (final CSVPrinter printer = new CSVPrinter (sw , CSVFormat .DEFAULT .withEscape (null ))) {
381381 printer .print ("\\ \\ " );
382382 }
@@ -385,7 +385,7 @@ public void testEscapeNull4() throws IOException {
385385
386386 @ Test
387387 public void testEscapeNull5 () throws IOException {
388- StringWriter sw = new StringWriter ();
388+ final StringWriter sw = new StringWriter ();
389389 try (final CSVPrinter printer = new CSVPrinter (sw , CSVFormat .DEFAULT .withEscape (null ))) {
390390 printer .print ("\\ \\ " );
391391 }
@@ -1115,7 +1115,7 @@ public void testPrintOnePositiveInteger() throws IOException {
11151115
11161116 @ Test
11171117 public void testPrintToFileWithCharsetUtf16Be () throws IOException {
1118- File file = File .createTempFile (getClass ().getName (), ".csv" );
1118+ final File file = File .createTempFile (getClass ().getName (), ".csv" );
11191119 try (final CSVPrinter printer = CSVFormat .DEFAULT .print (file , StandardCharsets .UTF_16BE )) {
11201120 printer .printRecord ("a" , "b\\ c" );
11211121 }
@@ -1124,7 +1124,7 @@ public void testPrintToFileWithCharsetUtf16Be() throws IOException {
11241124
11251125 @ Test
11261126 public void testPrintToFileWithDefaultCharset () throws IOException {
1127- File file = File .createTempFile (getClass ().getName (), ".csv" );
1127+ final File file = File .createTempFile (getClass ().getName (), ".csv" );
11281128 try (final CSVPrinter printer = CSVFormat .DEFAULT .print (file , Charset .defaultCharset ())) {
11291129 printer .printRecord ("a" , "b\\ c" );
11301130 }
@@ -1133,7 +1133,7 @@ public void testPrintToFileWithDefaultCharset() throws IOException {
11331133
11341134 @ Test
11351135 public void testPrintToPathWithDefaultCharset () throws IOException {
1136- File file = File .createTempFile (getClass ().getName (), ".csv" );
1136+ final File file = File .createTempFile (getClass ().getName (), ".csv" );
11371137 try (final CSVPrinter printer = CSVFormat .DEFAULT .print (file .toPath (), Charset .defaultCharset ())) {
11381138 printer .printRecord ("a" , "b\\ c" );
11391139 }
@@ -1282,8 +1282,8 @@ private String[] toFirstRecordValues(final String expected, final CSVFormat form
12821282 @ Test
12831283 public void testPrintRecordsWithResultSetOneRow () throws IOException , SQLException {
12841284 try (CSVPrinter csvPrinter = CSVFormat .MYSQL .printer ()) {
1285- Value [] valueArray = new Value [0 ];
1286- ValueArray valueArrayTwo = ValueArray .get (valueArray );
1285+ final Value [] valueArray = new Value [0 ];
1286+ final ValueArray valueArrayTwo = ValueArray .get (valueArray );
12871287 try (ResultSet resultSet = valueArrayTwo .getResultSet ()) {
12881288 csvPrinter .printRecords (resultSet );
12891289 assertEquals (0 , resultSet .getRow ());
@@ -1293,10 +1293,10 @@ public void testPrintRecordsWithResultSetOneRow() throws IOException, SQLExcepti
12931293
12941294 @ Test
12951295 public void testPrintRecordsWithObjectArray () throws IOException {
1296- CharArrayWriter charArrayWriter = new CharArrayWriter (0 );
1296+ final CharArrayWriter charArrayWriter = new CharArrayWriter (0 );
12971297 try (CSVPrinter csvPrinter = CSVFormat .INFORMIX_UNLOAD .print (charArrayWriter )) {
1298- HashSet <BatchUpdateException > hashSet = new HashSet <>();
1299- Object [] objectArray = new Object [6 ];
1298+ final HashSet <BatchUpdateException > hashSet = new HashSet <>();
1299+ final Object [] objectArray = new Object [6 ];
13001300 objectArray [3 ] = hashSet ;
13011301 csvPrinter .printRecords (objectArray );
13021302 }
@@ -1308,8 +1308,8 @@ public void testPrintRecordsWithObjectArray() throws IOException {
13081308 @ Test
13091309 public void testPrintRecordsWithEmptyVector () throws IOException {
13101310 try (CSVPrinter csvPrinter = CSVFormat .POSTGRESQL_TEXT .printer ()) {
1311- Vector <CSVFormatTest .EmptyEnum > vector = new Vector <>();
1312- int expectedCapacity = 23 ;
1311+ final Vector <CSVFormatTest .EmptyEnum > vector = new Vector <>();
1312+ final int expectedCapacity = 23 ;
13131313 vector .setSize (expectedCapacity );
13141314 csvPrinter .printRecords (vector );
13151315 assertEquals (expectedCapacity , vector .capacity ());
@@ -1318,27 +1318,27 @@ public void testPrintRecordsWithEmptyVector() throws IOException {
13181318
13191319 @ Test
13201320 public void testCloseWithFlushOn () throws IOException {
1321- Writer writer = mock (Writer .class );
1322- CSVFormat csvFormat = CSVFormat .DEFAULT ;
1323- CSVPrinter csvPrinter = new CSVPrinter (writer , csvFormat );
1321+ final Writer writer = mock (Writer .class );
1322+ final CSVFormat csvFormat = CSVFormat .DEFAULT ;
1323+ final CSVPrinter csvPrinter = new CSVPrinter (writer , csvFormat );
13241324 csvPrinter .close (true );
13251325 verify (writer , times (1 )).flush ();
13261326 }
13271327
13281328 @ Test
13291329 public void testCloseWithFlushOff () throws IOException {
1330- Writer writer = mock (Writer .class );
1331- CSVFormat csvFormat = CSVFormat .DEFAULT ;
1332- CSVPrinter csvPrinter = new CSVPrinter (writer , csvFormat );
1330+ final Writer writer = mock (Writer .class );
1331+ final CSVFormat csvFormat = CSVFormat .DEFAULT ;
1332+ final CSVPrinter csvPrinter = new CSVPrinter (writer , csvFormat );
13331333 csvPrinter .close (false );
13341334 verify (writer , never ()).flush ();
13351335 verify (writer , times (1 )).close ();
13361336 }
13371337
13381338 @ Test
13391339 public void testCloseBackwardCompatibility () throws IOException {
1340- Writer writer = mock (Writer .class );
1341- CSVFormat csvFormat = CSVFormat .DEFAULT ;
1340+ final Writer writer = mock (Writer .class );
1341+ final CSVFormat csvFormat = CSVFormat .DEFAULT ;
13421342 try (CSVPrinter csvPrinter = new CSVPrinter (writer , csvFormat )) {
13431343 }
13441344 verify (writer , never ()).flush ();
@@ -1348,8 +1348,8 @@ public void testCloseBackwardCompatibility() throws IOException {
13481348 @ Test
13491349 public void testCloseWithCsvFormatAutoFlushOn () throws IOException {
13501350 // System.out.println("start method");
1351- Writer writer = mock (Writer .class );
1352- CSVFormat csvFormat = CSVFormat .DEFAULT .withAutoFlush (true );
1351+ final Writer writer = mock (Writer .class );
1352+ final CSVFormat csvFormat = CSVFormat .DEFAULT .withAutoFlush (true );
13531353 try (CSVPrinter csvPrinter = new CSVPrinter (writer , csvFormat )) {
13541354 }
13551355 verify (writer , times (1 )).flush ();
@@ -1358,8 +1358,8 @@ public void testCloseWithCsvFormatAutoFlushOn() throws IOException {
13581358
13591359 @ Test
13601360 public void testCloseWithCsvFormatAutoFlushOff () throws IOException {
1361- Writer writer = mock (Writer .class );
1362- CSVFormat csvFormat = CSVFormat .DEFAULT .withAutoFlush (false );
1361+ final Writer writer = mock (Writer .class );
1362+ final CSVFormat csvFormat = CSVFormat .DEFAULT .withAutoFlush (false );
13631363 try (CSVPrinter csvPrinter = new CSVPrinter (writer , csvFormat )) {
13641364 }
13651365 verify (writer , never ()).flush ();
0 commit comments