diff --git a/src/main/java/org/apache/commons/csv/CSVParser.java b/src/main/java/org/apache/commons/csv/CSVParser.java index 11842047..b32e6651 100644 --- a/src/main/java/org/apache/commons/csv/CSVParser.java +++ b/src/main/java/org/apache/commons/csv/CSVParser.java @@ -179,7 +179,7 @@ public class CSVParser implements Iterable { } /** - * Parses from the current point in the stream til * the end of the current line. + * Parses from the current point in the stream til the end of the current line. * * @return array of values til end of line ('null' when end of file has been reached) * @throws IOException on parse error or input read-failure @@ -279,13 +279,6 @@ public class CSVParser implements Iterable { // the lexer(s) // ====================================================== - /** - * Convenience method for nextToken(null). - */ - Token nextToken() throws IOException { - return nextToken(new Token()); - } - /** * Returns the next token. *

@@ -580,11 +573,9 @@ public class CSVParser implements Iterable { */ private boolean isEndOfLine(int c) throws IOException { // check if we have \r\n... - if (c == '\r') { - if (in.lookAhead() == '\n') { - // note: does not change c outside of this method !! - c = in.read(); - } + if (c == '\r' && in.lookAhead() == '\n') { + // note: does not change c outside of this method !! + c = in.read(); } return (c == '\n' || c == '\r'); } diff --git a/src/test/java/org/apache/commons/csv/CSVParserTest.java b/src/test/java/org/apache/commons/csv/CSVParserTest.java index 987ddb7e..34db58f6 100644 --- a/src/test/java/org/apache/commons/csv/CSVParserTest.java +++ b/src/test/java/org/apache/commons/csv/CSVParserTest.java @@ -63,10 +63,10 @@ public class CSVParserTest extends TestCase { * type and content. * * @return String representation of token type and content - * @throws IOException like {@link CSVParser#nextToken()} + * @throws IOException like {@link CSVParser#nextToken(Token)} */ public String testNextToken() throws IOException { - Token t = super.nextToken(); + Token t = super.nextToken(new Token()); return t.type.name() + ";" + t.content + ";"; } }