diff --git a/src/main/java/org/apache/commons/csv/CSVParser.java b/src/main/java/org/apache/commons/csv/CSVParser.java index 5d162525..9f901313 100644 --- a/src/main/java/org/apache/commons/csv/CSVParser.java +++ b/src/main/java/org/apache/commons/csv/CSVParser.java @@ -160,19 +160,6 @@ public final class CSVParser implements Iterable, Closeable { return parseURL(url, charset, format); } - /** - * Creates a parser for the given {@link String} using the default format {@link CSVFormat#DEFAULT}. - * - * @param string - * a CSV string - * @return a new parser - * @throws IOException - * If an I/O error occurs - */ - public static CSVParser parseString(String string) throws IOException { - return parseString(string, CSVFormat.DEFAULT); - } - /** * Creates a parser for the given {@link String}. * diff --git a/src/test/java/org/apache/commons/csv/CSVParserTest.java b/src/test/java/org/apache/commons/csv/CSVParserTest.java index 6eab7354..4222bbc1 100644 --- a/src/test/java/org/apache/commons/csv/CSVParserTest.java +++ b/src/test/java/org/apache/commons/csv/CSVParserTest.java @@ -175,7 +175,7 @@ public class CSVParserTest { {"world", ""} }; for (final String code : codes) { - final CSVParser parser = CSVParser.parseString(code); + final CSVParser parser = CSVParser.parseString(code, CSVFormat.DEFAULT); final List records = parser.getRecords(); assertEquals(res.length, records.size()); assertTrue(records.size() > 0); @@ -269,7 +269,7 @@ public class CSVParserTest { {"a\\", "b"}, // a backslash must be returnd {"a\\\\,b"} // backslash in quotes only escapes a delimiter (",") }; - final CSVParser parser = CSVParser.parseString(code); + final CSVParser parser = CSVParser.parseString(code, CSVFormat.DEFAULT); final List records = parser.getRecords(); assertEquals(res.length, records.size()); assertTrue(records.size() > 0); @@ -408,7 +408,7 @@ public class CSVParserTest { @Test public void testCarriageReturnEndings() throws IOException { final String code = "foo\rbaar,\rhello,world\r,kanu"; - final CSVParser parser = CSVParser.parseString(code); + final CSVParser parser = CSVParser.parseString(code, CSVFormat.DEFAULT); final List records = parser.getRecords(); assertEquals(4, records.size()); } @@ -416,7 +416,7 @@ public class CSVParserTest { @Test public void testLineFeedEndings() throws IOException { final String code = "foo\nbaar,\nhello,world\n,kanu"; - final CSVParser parser = CSVParser.parseString(code); + final CSVParser parser = CSVParser.parseString(code, CSVFormat.DEFAULT); final List records = parser.getRecords(); assertEquals(4, records.size()); } @@ -426,7 +426,7 @@ public class CSVParserTest { final String code = "\nfoo,baar\n\r\n,\n\n,world\r\n\n"; //String code = "world\r\n\n"; //String code = "foo;baar\r\n\r\nhello;\r\n\r\nworld;\r\n"; - final CSVParser parser = CSVParser.parseString(code); + final CSVParser parser = CSVParser.parseString(code, CSVFormat.DEFAULT); final List records = parser.getRecords(); assertEquals(3, records.size()); }