diff --git a/src/main/java/org/apache/commons/csv/Token.java b/src/main/java/org/apache/commons/csv/Token.java index 696d760c..472867b5 100644 --- a/src/main/java/org/apache/commons/csv/Token.java +++ b/src/main/java/org/apache/commons/csv/Token.java @@ -55,11 +55,10 @@ class Token { /** Token ready flag: indicates a valid token with content (ready for the parser). */ boolean isReady; - Token reset() { + void reset() { content.setLength(0); type = INVALID; isReady = false; - return this; } // Provide toString method for IDE debugging diff --git a/src/test/java/org/apache/commons/csv/CSVLexer1.java b/src/test/java/org/apache/commons/csv/CSVLexer1.java index 31c7b014..df4594fc 100644 --- a/src/test/java/org/apache/commons/csv/CSVLexer1.java +++ b/src/test/java/org/apache/commons/csv/CSVLexer1.java @@ -97,7 +97,8 @@ class CSVLexer1 extends Lexer { if (c == format.getCommentStart()) { // ignore everything till end of line and continue (incr linecount) in.readLine(); - tkn = nextToken(tkn.reset()); + tkn.reset(); + tkn = nextToken(tkn); } else if (c == format.getDelimiter()) { // empty token return TOKEN("") tkn.type = TOKEN;