File tree Expand file tree Collapse file tree
src/test/java/org/apache/commons/csv/bugs Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3030public class JiraCsv198Test {
3131
3232 private static final CSVFormat CSV_FORMAT = CSVFormat .EXCEL .withDelimiter ('^' ).withFirstRecordAsHeader ();
33-
33+
3434 @ Test
3535 public void test () throws UnsupportedEncodingException , IOException {
3636 InputStream pointsOfReference = getClass ().getResourceAsStream ("/CSV-198/optd_por_public.csv" );
3737 Assert .assertNotNull (pointsOfReference );
38- CSVParser parser = CSV_FORMAT .parse (new InputStreamReader (pointsOfReference , "UTF-8" ));
39- for (CSVRecord record : parser ) {
40- String locationType = record .get ("location_type" );
41- Assert .assertNotNull (locationType );
38+ try (@ SuppressWarnings ("resource" )
39+ CSVParser parser = CSV_FORMAT .parse (new InputStreamReader (pointsOfReference , "UTF-8" ))) {
40+ for (CSVRecord record : parser ) {
41+ String locationType = record .get ("location_type" );
42+ Assert .assertNotNull (locationType );
43+ }
4244 }
4345 }
4446
You can’t perform that action at this time.
0 commit comments