@@ -143,7 +143,7 @@ public String[][] getRecords() throws IOException {
143143 String [] getRecord () throws IOException {
144144 String [] result = EMPTY_STRING_ARRAY ;
145145 record .clear ();
146- while ( true ) {
146+ do {
147147 reusableToken .reset ();
148148 lexer .nextToken (reusableToken );
149149 switch (reusableToken .type ) {
@@ -165,10 +165,8 @@ String[] getRecord() throws IOException {
165165 throw new IOException ("(line " + getLineNumber () + ") invalid parse sequence" );
166166 // unreachable: break;
167167 }
168- if (reusableToken .type != TOKEN ) {
169- break ;
170- }
171- }
168+ } while (reusableToken .type == TOKEN );
169+
172170 if (!record .isEmpty ()) {
173171 result = record .toArray (new String [record .size ()]);
174172 }
@@ -403,7 +401,7 @@ Token nextToken(Token tkn) throws IOException {
403401 * @throws IOException on stream access error
404402 */
405403 private Token simpleTokenLexer (Token tkn , int c ) throws IOException {
406- for (; ; ) {
404+ while ( true ) {
407405 if (isEndOfLine (c )) {
408406 // end of record
409407 tkn .type = EORECORD ;
@@ -454,7 +452,7 @@ private Token encapsulatedTokenLexer(Token tkn, int c) throws IOException {
454452 int startLineNumber = getLineNumber ();
455453 // ignore the given delimiter
456454 // assert c == delimiter;
457- for (; ; ) {
455+ while ( true ) {
458456 c = in .read ();
459457
460458 if (c == format .getEscape ()) {
@@ -466,7 +464,7 @@ private Token encapsulatedTokenLexer(Token tkn, int c) throws IOException {
466464 tkn .content .append ((char ) c );
467465 } else {
468466 // token finish mark (encapsulator) reached: ignore whitespace till delimiter
469- for (; ; ) {
467+ while ( true ) {
470468 c = in .read ();
471469 if (c == format .getDelimiter ()) {
472470 tkn .type = TOKEN ;
0 commit comments