Apache Lucene open-source search software
detabify and removed redundant (char) cast
Erik Hatcher812d3329d769
diff --git a/src/java/org/apache/lucene/analysis/CharTokenizer.java b/src/java/org/apache/lucene/analysis/CharTokenizer.javaindex a6cf5590d03..a271a0b76dc 100644--- a/src/java/org/apache/lucene/analysis/CharTokenizer.java+++ b/src/java/org/apache/lucene/analysis/CharTokenizer.java@@ -62,7 +62,7 @@ public abstract class CharTokenizer extends Tokenizer {super(input);}- private int offset = 0, bufferIndex=0, dataLen=0;+ private int offset = 0, bufferIndex = 0, dataLen = 0;private static final int MAX_WORD_LEN = 255;private static final int IO_BUFFER_SIZE = 1024;private final char[] buffer = new char[MAX_WORD_LEN];@@ -77,7 +77,9 @@ public abstract class CharTokenizer extends Tokenizer {/** Called on each token character to normalize it before it is added to the* token. The default implementation does nothing. Subclasses may use this* to, e.g., lowercase tokens. */- protected char normalize(char c) { return c; }+ protected char normalize(char c) {+ return c;+ }/** Returns the next token in the stream, or null at EOS. */public final Token next() throws java.io.IOException {@@ -90,31 +92,31 @@ public abstract class CharTokenizer extends Tokenizer {if (bufferIndex >= dataLen) {dataLen = input.read(ioBuffer);bufferIndex = 0;- };- if (dataLen == -1) {- if (length > 0)- break;- else- return null;}- else- c = (char) ioBuffer[bufferIndex++];-- if (isTokenChar(c)) { // if it's a token char+ ;+ if (dataLen == -1) {+ if (length > 0)+ break;+ else+ return null;+ } else+ c = ioBuffer[bufferIndex++];++ if (isTokenChar(c)) { // if it's a token char- if (length == 0) // start of token- start = offset-1;+ if (length == 0) // start of token+ start = offset - 1;- buffer[length++] = normalize(c); // buffer it, normalized+ buffer[length++] = normalize(c); // buffer it, normalized- if (length == MAX_WORD_LEN) // buffer overflow!- break;+ if (length == MAX_WORD_LEN) // buffer overflow!+ break;- } else if (length > 0) // at non-Letter w/ chars- break; // return 'em+ } else if (length > 0) // at non-Letter w/ chars+ break; // return 'em}- return new Token(new String(buffer, 0, length), start, start+length);+ return new Token(new String(buffer, 0, length), start, start + length);}}