Skip to content

Commit 9dd3dda

Browse files
committed
Removed the package private method CSVParser.nextToken()
git-svn-id: https://svn.apache.org/repos/asf/commons/sandbox/csv/trunk@1297431 13f79535-47bb-0310-9956-ffa450edef68
1 parent 6cf4a36 commit 9dd3dda

2 files changed

Lines changed: 6 additions & 15 deletions

File tree

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

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ public String[][] getRecords() throws IOException {
179179
}
180180

181181
/**
182-
* Parses from the current point in the stream til * the end of the current line.
182+
* Parses from the current point in the stream til the end of the current line.
183183
*
184184
* @return array of values til end of line ('null' when end of file has been reached)
185185
* @throws IOException on parse error or input read-failure
@@ -279,13 +279,6 @@ public int getLineNumber() {
279279
// the lexer(s)
280280
// ======================================================
281281

282-
/**
283-
* Convenience method for <code>nextToken(null)</code>.
284-
*/
285-
Token nextToken() throws IOException {
286-
return nextToken(new Token());
287-
}
288-
289282
/**
290283
* Returns the next token.
291284
* <p/>
@@ -580,11 +573,9 @@ private boolean isWhitespace(int c) {
580573
*/
581574
private boolean isEndOfLine(int c) throws IOException {
582575
// check if we have \r\n...
583-
if (c == '\r') {
584-
if (in.lookAhead() == '\n') {
585-
// note: does not change c outside of this method !!
586-
c = in.read();
587-
}
576+
if (c == '\r' && in.lookAhead() == '\n') {
577+
// note: does not change c outside of this method !!
578+
c = in.read();
588579
}
589580
return (c == '\n' || c == '\r');
590581
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,10 @@ class TestCSVParser extends CSVParser {
6363
* type and content.
6464
*
6565
* @return String representation of token type and content
66-
* @throws IOException like {@link CSVParser#nextToken()}
66+
* @throws IOException like {@link CSVParser#nextToken(Token)}
6767
*/
6868
public String testNextToken() throws IOException {
69-
Token t = super.nextToken();
69+
Token t = super.nextToken(new Token());
7070
return t.type.name() + ";" + t.content + ";";
7171
}
7272
}

0 commit comments

Comments
 (0)