Simplest behavior: null -> exception, like the other params.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/csv/trunk@1578502 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
c8630e103a
commit
5d5458d7f6
|
@ -183,7 +183,7 @@ public final class CSVParser implements Iterable<CSVRecord>, Closeable {
|
|||
* @param url
|
||||
* a URL. Must not be null.
|
||||
* @param charset
|
||||
* the charset for the resource. If {@code null}, use {@code UTF-8}.
|
||||
* the charset for the resource. Must not be null.
|
||||
* @param format
|
||||
* the CSVFormat used for CSV parsing. Must not be null.
|
||||
* @return a new parser
|
||||
|
@ -194,10 +194,10 @@ public final class CSVParser implements Iterable<CSVRecord>, Closeable {
|
|||
*/
|
||||
public static CSVParser parse(final URL url, final Charset charset, final CSVFormat format) throws IOException {
|
||||
Assertions.notNull(url, "url");
|
||||
Assertions.notNull(charset, "charset");
|
||||
Assertions.notNull(format, "format");
|
||||
|
||||
return new CSVParser(new InputStreamReader(url.openStream(),
|
||||
charset == null ? Charset.forName("UTF-8") : charset), format);
|
||||
return new CSVParser(new InputStreamReader(url.openStream(), charset), format);
|
||||
}
|
||||
|
||||
// the following objects are shared to reduce garbage
|
||||
|
|
Loading…
Reference in New Issue