@@ -91,19 +91,19 @@ private void parseFully(final CSVParser parser) {
9191
9292 @ Test
9393 public void testParseWithDelimiterWithQuote () throws IOException {
94- String source = "'a,b,c',xyz" ;
95- CSVFormat csvFormat = CSVFormat .DEFAULT .withQuote ('\'' );
94+ final String source = "'a,b,c',xyz" ;
95+ final CSVFormat csvFormat = CSVFormat .DEFAULT .withQuote ('\'' );
9696 try (CSVParser csvParser = csvFormat .parse (new StringReader (source ))) {
97- CSVRecord csvRecord = csvParser .nextRecord ();
97+ final CSVRecord csvRecord = csvParser .nextRecord ();
9898 assertEquals ("a,b,c" , csvRecord .get (0 ));
9999 assertEquals ("xyz" , csvRecord .get (1 ));
100100 }
101101 }
102102
103103 @ Test
104104 public void testParseWithDelimiterStringWithQuote () throws IOException {
105- String source = "'a[|]b[|]c'[|]xyz\r \n abc[abc][|]xyz" ;
106- CSVFormat csvFormat = CSVFormat .DEFAULT .builder ().setDelimiter ("[|]" ).setQuote ('\'' ).build ();
105+ final String source = "'a[|]b[|]c'[|]xyz\r \n abc[abc][|]xyz" ;
106+ final CSVFormat csvFormat = CSVFormat .DEFAULT .builder ().setDelimiter ("[|]" ).setQuote ('\'' ).build ();
107107 try (CSVParser csvParser = csvFormat .parse (new StringReader (source ))) {
108108 CSVRecord csvRecord = csvParser .nextRecord ();
109109 assertEquals ("a[|]b[|]c" , csvRecord .get (0 ));
@@ -116,19 +116,19 @@ public void testParseWithDelimiterStringWithQuote() throws IOException {
116116
117117 @ Test
118118 public void testParseWithDelimiterWithEscape () throws IOException {
119- String source = "a!,b!,c,xyz" ;
120- CSVFormat csvFormat = CSVFormat .DEFAULT .withEscape ('!' );
119+ final String source = "a!,b!,c,xyz" ;
120+ final CSVFormat csvFormat = CSVFormat .DEFAULT .withEscape ('!' );
121121 try (CSVParser csvParser = csvFormat .parse (new StringReader (source ))) {
122- CSVRecord csvRecord = csvParser .nextRecord ();
122+ final CSVRecord csvRecord = csvParser .nextRecord ();
123123 assertEquals ("a,b,c" , csvRecord .get (0 ));
124124 assertEquals ("xyz" , csvRecord .get (1 ));
125125 }
126126 }
127127
128128 @ Test
129129 public void testParseWithDelimiterStringWithEscape () throws IOException {
130- String source = "a![!|!]b![|]c[|]xyz\r \n abc[abc][|]xyz" ;
131- CSVFormat csvFormat = CSVFormat .DEFAULT .builder ().setDelimiter ("[|]" ).setEscape ('!' ).build ();
130+ final String source = "a![!|!]b![|]c[|]xyz\r \n abc[abc][|]xyz" ;
131+ final CSVFormat csvFormat = CSVFormat .DEFAULT .builder ().setDelimiter ("[|]" ).setEscape ('!' ).build ();
132132 try (CSVParser csvParser = csvFormat .parse (new StringReader (source ))) {
133133 CSVRecord csvRecord = csvParser .nextRecord ();
134134 assertEquals ("a[|]b![|]c" , csvRecord .get (0 ));
@@ -141,32 +141,32 @@ public void testParseWithDelimiterStringWithEscape() throws IOException {
141141
142142 @ Test
143143 public void testParseWithQuoteWithEscape () throws IOException {
144- String source = "'a?,b?,c?d',xyz" ;
145- CSVFormat csvFormat = CSVFormat .DEFAULT .withQuote ('\'' ).withEscape ('?' );
144+ final String source = "'a?,b?,c?d',xyz" ;
145+ final CSVFormat csvFormat = CSVFormat .DEFAULT .withQuote ('\'' ).withEscape ('?' );
146146 try (CSVParser csvParser = csvFormat .parse (new StringReader (source ))) {
147- CSVRecord csvRecord = csvParser .nextRecord ();
147+ final CSVRecord csvRecord = csvParser .nextRecord ();
148148 assertEquals ("a,b,c?d" , csvRecord .get (0 ));
149149 assertEquals ("xyz" , csvRecord .get (1 ));
150150 }
151151 }
152152
153153 @ Test
154154 public void testParseWithQuoteThrowsException () {
155- CSVFormat csvFormat = CSVFormat .DEFAULT .withQuote ('\'' );
155+ final CSVFormat csvFormat = CSVFormat .DEFAULT .withQuote ('\'' );
156156 assertThrows (IOException .class , () -> csvFormat .parse (new StringReader ("'a,b,c','" )).nextRecord ());
157157 assertThrows (IOException .class , () -> csvFormat .parse (new StringReader ("'a,b,c'abc,xyz" )).nextRecord ());
158158 assertThrows (IOException .class , () -> csvFormat .parse (new StringReader ("'abc'a,b,c',xyz" )).nextRecord ());
159159 }
160160
161161 @ Test
162162 public void testNotValueCSV () throws IOException {
163- String source = "#" ;
164- CSVFormat csvFormat = CSVFormat .DEFAULT .withCommentMarker ('#' );
165- CSVParser csvParser = csvFormat .parse (new StringReader (source ));
166- CSVRecord csvRecord = csvParser .nextRecord ();
163+ final String source = "#" ;
164+ final CSVFormat csvFormat = CSVFormat .DEFAULT .withCommentMarker ('#' );
165+ final CSVParser csvParser = csvFormat .parse (new StringReader (source ));
166+ final CSVRecord csvRecord = csvParser .nextRecord ();
167167 assertNull (csvRecord );
168168 }
169-
169+
170170 @ Test
171171 public void testBackslashEscaping () throws IOException {
172172
0 commit comments