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:
Gary D. Gregory 2014-03-17 18:40:58 +00:00
parent c8630e103a
commit 5d5458d7f6
1 changed files with 3 additions and 3 deletions

View File

@ -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