commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brit...@apache.org
Subject svn commit: r1519269 - in /commons/proper/csv/trunk/src: main/java/org/apache/commons/csv/CSVParser.java test/java/org/apache/commons/csv/CSVParserTest.java
Date Sun, 01 Sep 2013 13:36:08 GMT
Author: britter
Date: Sun Sep  1 13:36:08 2013
New Revision: 1519269

URL: http://svn.apache.org/r1519269
Log:
Remove fallback logic for charset parameter

Modified:
    commons/proper/csv/trunk/src/main/java/org/apache/commons/csv/CSVParser.java
    commons/proper/csv/trunk/src/test/java/org/apache/commons/csv/CSVParserTest.java

Modified: commons/proper/csv/trunk/src/main/java/org/apache/commons/csv/CSVParser.java
URL: http://svn.apache.org/viewvc/commons/proper/csv/trunk/src/main/java/org/apache/commons/csv/CSVParser.java?rev=1519269&r1=1519268&r2=1519269&view=diff
==============================================================================
--- commons/proper/csv/trunk/src/main/java/org/apache/commons/csv/CSVParser.java (original)
+++ commons/proper/csv/trunk/src/main/java/org/apache/commons/csv/CSVParser.java Sun Sep 
1 13:36:08 2013
@@ -143,18 +143,18 @@ public final class CSVParser implements 
      * @param url
      *            a URL. Must not be null.
      * @param charset
-     *            the charset for the resource, if {@code null}, uses {@code UTF-8}. UTF-8
is one of the encodings
-     *            required by the Java specification.
+     *            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
      * @throws IllegalArgumentException
-     *             If the parameters of the format are inconsistent or if either url or format
are null.
+     *             If the parameters of the format are inconsistent or if either url, charset
or format are null.
      * @throws IOException
      *             If an I/O error occurs
      */
     public static CSVParser parse(URL url, 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(),

Modified: commons/proper/csv/trunk/src/test/java/org/apache/commons/csv/CSVParserTest.java
URL: http://svn.apache.org/viewvc/commons/proper/csv/trunk/src/test/java/org/apache/commons/csv/CSVParserTest.java?rev=1519269&r1=1519268&r2=1519269&view=diff
==============================================================================
--- commons/proper/csv/trunk/src/test/java/org/apache/commons/csv/CSVParserTest.java (original)
+++ commons/proper/csv/trunk/src/test/java/org/apache/commons/csv/CSVParserTest.java Sun Sep
 1 13:36:08 2013
@@ -750,6 +750,11 @@ public class CSVParserTest {
     }
 
     @Test(expected = IllegalArgumentException.class)
+    public void testParserUrlNullCharsetFormat() throws Exception {
+        CSVParser.parse(new URL("http://commons.apache.org"), null, CSVFormat.DEFAULT);
+    }
+
+    @Test(expected = IllegalArgumentException.class)
     public void testParseUrlCharsetNullFormat() throws Exception {
         CSVParser.parse(new URL("http://commons.apache.org"), Charset.defaultCharset(), null);
     }



Mime
View raw message