Skip to content

Commit 59e1f79

Browse files
committed
1 parent 9b37b1e commit 59e1f79

2 files changed

Lines changed: 4 additions & 0 deletions

File tree

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
import java.io.Serializable;
3737
import java.io.StringWriter;
3838
import java.nio.charset.Charset;
39+
import java.nio.file.Files;
3940
import java.nio.file.Path;
4041
import java.sql.ResultSet;
4142
import java.sql.ResultSetMetaData;
@@ -884,6 +885,7 @@ public CSVPrinter print(final Appendable out) throws IOException {
884885
* thrown if the optional header cannot be printed.
885886
* @since 1.5
886887
*/
888+
@SuppressWarnings("resource")
887889
public CSVPrinter print(final File out, Charset charset) throws IOException {
888890
// The writer will be closed when close() is called.
889891
return new CSVPrinter(new OutputStreamWriter(new FileOutputStream(out), charset), this);

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ public final class CSVParser implements Iterable<CSVRecord>, Closeable {
155155
* @throws IOException
156156
* If an I/O error occurs
157157
*/
158+
@SuppressWarnings("resource")
158159
public static CSVParser parse(final File file, final Charset charset, final CSVFormat format) throws IOException {
159160
Assertions.notNull(file, "file");
160161
Assertions.notNull(format, "format");
@@ -360,6 +361,7 @@ public CSVParser(final Reader reader, final CSVFormat format) throws IOException
360361
* If there is a problem reading the header or skipping the first record
361362
* @since 1.1
362363
*/
364+
@SuppressWarnings("resource")
363365
public CSVParser(final Reader reader, final CSVFormat format, final long characterOffset, final long recordNumber)
364366
throws IOException {
365367
Assertions.notNull(reader, "reader");

0 commit comments

Comments
 (0)