Skip to content

Commit a36bbff

Browse files
committed
Remove org.apache.commons.csv.CSVParser.parseString(String).
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/csv/trunk@1511868 13f79535-47bb-0310-9956-ffa450edef68
1 parent 65f6f1d commit a36bbff

2 files changed

Lines changed: 5 additions & 18 deletions

File tree

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

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -160,19 +160,6 @@ public static CSVParser parseResource(String resource, Charset charset, final CS
160160
return parseURL(url, charset, format);
161161
}
162162

163-
/**
164-
* Creates a parser for the given {@link String} using the default format {@link CSVFormat#DEFAULT}.
165-
*
166-
* @param string
167-
* a CSV string
168-
* @return a new parser
169-
* @throws IOException
170-
* If an I/O error occurs
171-
*/
172-
public static CSVParser parseString(String string) throws IOException {
173-
return parseString(string, CSVFormat.DEFAULT);
174-
}
175-
176163
/**
177164
* Creates a parser for the given {@link String}.
178165
*

src/test/java/org/apache/commons/csv/CSVParserTest.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ public void testEndOfFileBehaviorCSV() throws Exception {
175175
{"world", ""}
176176
};
177177
for (final String code : codes) {
178-
final CSVParser parser = CSVParser.parseString(code);
178+
final CSVParser parser = CSVParser.parseString(code, CSVFormat.DEFAULT);
179179
final List<CSVRecord> records = parser.getRecords();
180180
assertEquals(res.length, records.size());
181181
assertTrue(records.size() > 0);
@@ -269,7 +269,7 @@ public void testBackslashEscapingOld() throws IOException {
269269
{"a\\", "b"}, // a backslash must be returnd
270270
{"a\\\\,b"} // backslash in quotes only escapes a delimiter (",")
271271
};
272-
final CSVParser parser = CSVParser.parseString(code);
272+
final CSVParser parser = CSVParser.parseString(code, CSVFormat.DEFAULT);
273273
final List<CSVRecord> records = parser.getRecords();
274274
assertEquals(res.length, records.size());
275275
assertTrue(records.size() > 0);
@@ -408,15 +408,15 @@ public void testClose() throws Exception {
408408
@Test
409409
public void testCarriageReturnEndings() throws IOException {
410410
final String code = "foo\rbaar,\rhello,world\r,kanu";
411-
final CSVParser parser = CSVParser.parseString(code);
411+
final CSVParser parser = CSVParser.parseString(code, CSVFormat.DEFAULT);
412412
final List<CSVRecord> records = parser.getRecords();
413413
assertEquals(4, records.size());
414414
}
415415

416416
@Test
417417
public void testLineFeedEndings() throws IOException {
418418
final String code = "foo\nbaar,\nhello,world\n,kanu";
419-
final CSVParser parser = CSVParser.parseString(code);
419+
final CSVParser parser = CSVParser.parseString(code, CSVFormat.DEFAULT);
420420
final List<CSVRecord> records = parser.getRecords();
421421
assertEquals(4, records.size());
422422
}
@@ -426,7 +426,7 @@ public void testIgnoreEmptyLines() throws IOException {
426426
final String code = "\nfoo,baar\n\r\n,\n\n,world\r\n\n";
427427
//String code = "world\r\n\n";
428428
//String code = "foo;baar\r\n\r\nhello;\r\n\r\nworld;\r\n";
429-
final CSVParser parser = CSVParser.parseString(code);
429+
final CSVParser parser = CSVParser.parseString(code, CSVFormat.DEFAULT);
430430
final List<CSVRecord> records = parser.getRecords();
431431
assertEquals(3, records.size());
432432
}

0 commit comments

Comments
 (0)