private String finishCharacters() { // common case -- no characters or only whitespace if (this.characters == null || this.characters.length() == 0) { return null; } if (allWhiteSpace(this.characters)) { this.characters.setLength(0); return null; } // process the characters try { String trimmedChars = this.characters.toString().trim(); if (trimmedChars.length() == 0) { // this shouldn't happen due to the test for allWhiteSpace above System.err.println("Unexpected non-whitespace characters: " //$NON-NLS-1$ + trimmedChars); return null; } processCharacters(trimmedChars); return trimmedChars; } finally { this.characters.setLength(0); } }
private String finishCharacters() { // common case -- no characters or only whitespace if (this.characters == null || this.characters.length() == 0) { return null; } if (allWhiteSpace(this.characters)) { this.characters.setLength(0); return null; } // process the characters try { String trimmedChars = this.characters.toString().trim(); if (trimmedChars.length() == 0) { // this shouldn't happen due to the test for allWhiteSpace above System.err.println("Unexpected non-whitespace characters: " //$NON-NLS-1$ + trimmedChars); return null; } processCharacters(trimmedChars); return trimmedChars; } finally { this.characters.setLength(0); } }