Fix de-serialization of interned field names

git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@833095 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Uwe Schindler 2009-11-05 17:33:45 +00:00
parent 072f9e3218
commit 8375c97131
2 changed files with 12 additions and 1 deletions

View File

@ -363,8 +363,14 @@ public final class NumericRangeQuery<T extends Number> extends MultiTermQuery {
(Boolean.valueOf(maxInclusive).hashCode()^0x733fa5fe);
}
// field must be interned after reading from stream
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
in.defaultReadObject();
field = StringHelper.intern(field);
}
// members (package private, to be also fast accessible by NumericRangeTermEnum)
final String field;
String field;
final int precisionStep, valSize;
final T min, max;
final boolean minInclusive,maxInclusive;

View File

@ -354,6 +354,11 @@ implements Serializable {
return hash;
}
// field must be interned after reading from stream
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
in.defaultReadObject();
field = StringHelper.intern(field);
}
/** Returns the {@link FieldComparator} to use for
* sorting.