Skip to content

Commit 18ed616

Browse files
committed
Fix compiler warnings.
1 parent 0ec08e4 commit 18ed616

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

src/test/java/org/apache/commons/csv/bugs/JiraCsv198Test.java

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,17 @@
3030
public 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

0 commit comments

Comments
 (0)