Skip to content
This repository was archived by the owner on Jun 3, 2026. It is now read-only.

Commit 1963ea3

Browse files
committed
Add @SuppressWarnings and Javadoc.
1 parent 1a33fd8 commit 1963ea3

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

src/main/java/org/apache/commons/csv/CSVParser.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ public static CSVParser parse(final InputStream inputStream, final Charset chars
236236
}
237237

238238
/**
239-
* Creates a parser for the given {@link Path}.
239+
* Creates and returns a parser for the given {@link Path}, which the caller MUST close.
240240
*
241241
* @param path
242242
* a CSV file. Must not be null.
@@ -251,6 +251,7 @@ public static CSVParser parse(final InputStream inputStream, final Charset chars
251251
* If an I/O error occurs
252252
* @since 1.5
253253
*/
254+
@SuppressWarnings("resource")
254255
public static CSVParser parse(final Path path, final Charset charset, final CSVFormat format) throws IOException {
255256
Objects.requireNonNull(path, "path");
256257
Objects.requireNonNull(format, "format");
@@ -303,7 +304,7 @@ public static CSVParser parse(final String string, final CSVFormat format) throw
303304
// the following objects are shared to reduce garbage
304305

305306
/**
306-
* Creates a parser for the given URL.
307+
* Creates and returns a parser for the given URL, which the caller MUST close.
307308
*
308309
* <p>
309310
* If you do not read all records from the given {@code url}, you should call {@link #close()} on the parser, unless
@@ -322,6 +323,7 @@ public static CSVParser parse(final String string, final CSVFormat format) throw
322323
* @throws IOException
323324
* If an I/O error occurs
324325
*/
326+
@SuppressWarnings("resource")
325327
public static CSVParser parse(final URL url, final Charset charset, final CSVFormat format) throws IOException {
326328
Objects.requireNonNull(url, "url");
327329
Objects.requireNonNull(charset, "charset");

0 commit comments

Comments
 (0)