@@ -107,7 +107,7 @@ long getCurrentLineNumber() {
107107 return reader .getCurrentLineNumber ();
108108 }
109109
110- String getFirstEol (){
110+ String getFirstEol () {
111111 return firstEol ;
112112 }
113113
@@ -138,7 +138,7 @@ boolean isDelimiter(final int ch) throws IOException {
138138 }
139139 reader .lookAhead (delimiterBuf );
140140 for (int i = 0 ; i < delimiterBuf .length ; i ++) {
141- if (delimiterBuf [i ] != delimiter [i + 1 ]) {
141+ if (delimiterBuf [i ] != delimiter [i + 1 ]) {
142142 return false ;
143143 }
144144 }
@@ -221,18 +221,12 @@ private char mapNullToDisabled(final Character c) {
221221 * @throws IOException on stream access error.
222222 */
223223 Token nextToken (final Token token ) throws IOException {
224-
225224 // Get the last read char (required for empty line detection)
226225 int lastChar = reader .getLastChar ();
227-
228226 // read the next char and set eol
229227 int c = reader .read ();
230- /*
231- * Note: The following call will swallow LF if c == CR. But we don't need to know if the last char was CR or LF
232- * - they are equivalent here.
233- */
228+ // Note: The following call will swallow LF if c == CR. But we don't need to know if the last char was CR or LF - they are equivalent here.
234229 boolean eol = readEndOfLine (c );
235-
236230 // empty line detection: eol AND (last char was EOL or beginning)
237231 if (ignoreEmptyLines ) {
238232 while (eol && isStartOfLine (lastChar )) {
@@ -248,14 +242,12 @@ Token nextToken(final Token token) throws IOException {
248242 }
249243 }
250244 }
251-
252245 // Did we reach EOF during the last iteration already? EOF
253246 if (isEndOfFile (lastChar ) || !isLastTokenDelimiter && isEndOfFile (c )) {
254247 token .type = Token .Type .EOF ;
255248 // don't set token.isReady here because no content
256249 return token ;
257250 }
258-
259251 if (isStartOfLine (lastChar ) && isCommentStart (c )) {
260252 final String line = reader .readLine ();
261253 if (line == null ) {
@@ -268,17 +260,15 @@ Token nextToken(final Token token) throws IOException {
268260 token .type = COMMENT ;
269261 return token ;
270262 }
271-
272263 // Important: make sure a new char gets consumed in each iteration
273264 while (token .type == INVALID ) {
274265 // ignore whitespaces at beginning of a token
275266 if (ignoreSurroundingSpaces ) {
276- while (Character .isWhitespace ((char )c ) && !isDelimiter (c ) && !eol ) {
267+ while (Character .isWhitespace ((char ) c ) && !isDelimiter (c ) && !eol ) {
277268 c = reader .read ();
278269 eol = readEndOfLine (c );
279270 }
280271 }
281-
282272 // ok, start of token reached: encapsulated, or token
283273 if (isDelimiter (c )) {
284274 // empty token return TOKEN("")
0 commit comments