lucene-java-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From uschind...@apache.org
Subject svn commit: r833095 - in /lucene/java/trunk/src/java/org/apache/lucene/search: NumericRangeQuery.java SortField.java
Date Thu, 05 Nov 2009 17:33:46 GMT
Author: uschindler
Date: Thu Nov  5 17:33:45 2009
New Revision: 833095

URL: http://svn.apache.org/viewvc?rev=833095&view=rev
Log:
Fix de-serialization of interned field names

Modified:
    lucene/java/trunk/src/java/org/apache/lucene/search/NumericRangeQuery.java
    lucene/java/trunk/src/java/org/apache/lucene/search/SortField.java

Modified: lucene/java/trunk/src/java/org/apache/lucene/search/NumericRangeQuery.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/search/NumericRangeQuery.java?rev=833095&r1=833094&r2=833095&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/search/NumericRangeQuery.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/search/NumericRangeQuery.java Thu Nov  5
17:33:45 2009
@@ -363,8 +363,14 @@
       (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;

Modified: lucene/java/trunk/src/java/org/apache/lucene/search/SortField.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/search/SortField.java?rev=833095&r1=833094&r2=833095&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/search/SortField.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/search/SortField.java Thu Nov  5 17:33:45
2009
@@ -354,6 +354,11 @@
     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.



Mime
View raw message