Repository: commons-csv Updated Branches: refs/heads/master 0ec08e400 -> 18ed61621
Fix compiler warnings. Project: http://git-wip-us.apache.org/repos/asf/commons-csv/repo Commit: http://git-wip-us.apache.org/repos/asf/commons-csv/commit/18ed6162 Tree: http://git-wip-us.apache.org/repos/asf/commons-csv/tree/18ed6162 Diff: http://git-wip-us.apache.org/repos/asf/commons-csv/diff/18ed6162 Branch: refs/heads/master Commit: 18ed616214ed3a9d52c9a1d1fb856e7b58d1ca89 Parents: 0ec08e4 Author: Gary Gregory <ggreg...@apache.org> Authored: Thu Dec 1 13:27:06 2016 -0800 Committer: Gary Gregory <ggreg...@apache.org> Committed: Thu Dec 1 13:27:06 2016 -0800 ---------------------------------------------------------------------- .../org/apache/commons/csv/bugs/JiraCsv198Test.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/commons-csv/blob/18ed6162/src/test/java/org/apache/commons/csv/bugs/JiraCsv198Test.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/csv/bugs/JiraCsv198Test.java b/src/test/java/org/apache/commons/csv/bugs/JiraCsv198Test.java index 721035e..13126bd 100644 --- a/src/test/java/org/apache/commons/csv/bugs/JiraCsv198Test.java +++ b/src/test/java/org/apache/commons/csv/bugs/JiraCsv198Test.java @@ -30,15 +30,17 @@ import org.junit.Test; public class JiraCsv198Test { private static final CSVFormat CSV_FORMAT = CSVFormat.EXCEL.withDelimiter('^').withFirstRecordAsHeader(); - + @Test public void test() throws UnsupportedEncodingException, IOException { InputStream pointsOfReference = getClass().getResourceAsStream("/CSV-198/optd_por_public.csv"); Assert.assertNotNull(pointsOfReference); - CSVParser parser = CSV_FORMAT.parse(new InputStreamReader(pointsOfReference, "UTF-8")); - for (CSVRecord record : parser) { - String locationType = record.get("location_type"); - Assert.assertNotNull(locationType); + try (@SuppressWarnings("resource") + CSVParser parser = CSV_FORMAT.parse(new InputStreamReader(pointsOfReference, "UTF-8"))) { + for (CSVRecord record : parser) { + String locationType = record.get("location_type"); + Assert.assertNotNull(locationType); + } } }