Skip to content

Commit 5d5458d

Browse files
committed
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
1 parent c8630e1 commit 5d5458d

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ public static CSVParser parse(final String string, final CSVFormat format) throw
183183
* @param url
184184
* a URL. Must not be null.
185185
* @param charset
186-
* the charset for the resource. If {@code null}, use {@code UTF-8}.
186+
* the charset for the resource. Must not be null.
187187
* @param format
188188
* the CSVFormat used for CSV parsing. Must not be null.
189189
* @return a new parser
@@ -194,10 +194,10 @@ public static CSVParser parse(final String string, final CSVFormat format) throw
194194
*/
195195
public static CSVParser parse(final URL url, final Charset charset, final CSVFormat format) throws IOException {
196196
Assertions.notNull(url, "url");
197+
Assertions.notNull(charset, "charset");
197198
Assertions.notNull(format, "format");
198199

199-
return new CSVParser(new InputStreamReader(url.openStream(),
200-
charset == null ? Charset.forName("UTF-8") : charset), format);
200+
return new CSVParser(new InputStreamReader(url.openStream(), charset), format);
201201
}
202202

203203
// the following objects are shared to reduce garbage

0 commit comments

Comments
 (0)