You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-commits@lucene.apache.org by mi...@apache.org on 2010/05/04 20:36:43 UTC
svn commit: r940993 -
/lucene/java/branches/lucene_3_0/src/java/org/apache/lucene/store/IndexInput.java
Author: mikemccand
Date: Tue May 4 18:36:43 2010
New Revision: 940993
URL: http://svn.apache.org/viewvc?rev=940993&view=rev
Log:
LUCENE-2422: also don't reuse char[] for reading legacy indices
Modified:
lucene/java/branches/lucene_3_0/src/java/org/apache/lucene/store/IndexInput.java
Modified: lucene/java/branches/lucene_3_0/src/java/org/apache/lucene/store/IndexInput.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/lucene_3_0/src/java/org/apache/lucene/store/IndexInput.java?rev=940993&r1=940992&r2=940993&view=diff
==============================================================================
--- lucene/java/branches/lucene_3_0/src/java/org/apache/lucene/store/IndexInput.java (original)
+++ lucene/java/branches/lucene_3_0/src/java/org/apache/lucene/store/IndexInput.java Tue May 4 18:36:43 2010
@@ -27,7 +27,6 @@ import java.util.HashMap;
* @see Directory
*/
public abstract class IndexInput implements Cloneable,Closeable {
- private char[] chars; // used by readModifiedUTF8String()
private boolean preUTF8Strings; // true if we are reading old (modified UTF8) string format
/** Reads and returns a single byte.
@@ -128,8 +127,7 @@ public abstract class IndexInput impleme
private String readModifiedUTF8String() throws IOException {
int length = readVInt();
- if (chars == null || length > chars.length)
- chars = new char[length];
+ final char[] chars = new char[length];
readChars(chars, 0, length);
return new String(chars, 0, length);
}
@@ -222,8 +220,6 @@ public abstract class IndexInput impleme
clone = (IndexInput)super.clone();
} catch (CloneNotSupportedException e) {}
- clone.chars = null;
-
return clone;
}