String () { String nextToken; do { if (super.hasMoreTokens()) { nextToken = super.nextToken(); } else { nextToken = null; } } while (nextToken != null && nextToken.length() == 1 && DEFAULT_DELIMITERS.indexOf(nextToken.charAt(0)) >= 0); if (nextToken == null) { return null; } int i; int quotationMarks = 0; final StringBuilder buffer = new StringBuilder(); do { while ((i = nextToken.indexOf('"')) >= 0) { boolean isEscapedQuote = isEscapedAtPos(nextToken, i); if (!isEscapedQuote) quotationMarks++; buffer.append(nextToken, 0, isEscapedQuote ? i - 1 : i); if (isEscapedQuote) buffer.append('"'); nextToken = nextToken.substring(i + 1); } boolean isEscapedWhitespace = false; if (myHandleEscapedWhitespaces && quotationMarks == 0 && nextToken.endsWith("\\") && super.hasMoreTokens()) { isEscapedWhitespace = true; buffer.append(nextToken, 0, nextToken.length() - 1); buffer.append(super.nextToken()); } else { buffer.append(nextToken); } if ((isEscapedWhitespace || (quotationMarks & 1) == 1) && super.hasMoreTokens()) { nextToken = super.nextToken(); } else { nextToken = null; } } while (nextToken != null); return buffer.toString(); }