lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rm...@apache.org
Subject svn commit: r1334849 - in /lucene/dev/trunk/lucene: ./ core/src/java/org/apache/lucene/search/ core/src/java/org/apache/lucene/search/spans/ core/src/test/org/apache/lucene/index/ queries/src/java/org/apache/lucene/queries/function/
Date Mon, 07 May 2012 00:44:49 GMT
Author: rmuir
Date: Mon May  7 00:44:49 2012
New Revision: 1334849

URL: http://svn.apache.org/viewvc?rev=1334849&view=rev
Log:
LUCENE-4037: remove serialization cruft

Modified:
    lucene/dev/trunk/lucene/CHANGES.txt
    lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/search/FieldCache.java
    lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/search/ScoringRewrite.java
    lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/search/spans/SpanMultiTermQueryWrapper.java
    lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/index/TestCrashCausesCorruptIndex.java
    lucene/dev/trunk/lucene/queries/src/java/org/apache/lucene/queries/function/ValueSource.java

Modified: lucene/dev/trunk/lucene/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/CHANGES.txt?rev=1334849&r1=1334848&r2=1334849&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/CHANGES.txt (original)
+++ lucene/dev/trunk/lucene/CHANGES.txt Mon May  7 00:44:49 2012
@@ -141,9 +141,10 @@ Changes in backwards compatibility polic
   ParallelMultiSearcher into IndexSearcher as an optional
   ExecutorServiced passed to its ctor.  (Mike McCandless)
 
-* LUCENE-2908: Removed serialization code from lucene classes. It is recommended
-  that you serialize user search needs at a higher level in your application.
-  (Robert Muir)
+* LUCENE-2908, LUCENE-4037: Removed serialization code from lucene classes. 
+  It is recommended that you serialize user search needs at a higher level 
+  in your application.
+  (Robert Muir, Benson Margulies)
 
 * LUCENE-2831: Changed Weight#scorer, Weight#explain & Filter#getDocIdSet to
   operate on a AtomicReaderContext instead of directly on IndexReader to enable

Modified: lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/search/FieldCache.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/search/FieldCache.java?rev=1334849&r1=1334848&r2=1334849&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/search/FieldCache.java (original)
+++ lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/search/FieldCache.java Mon May
 7 00:44:49 2012
@@ -125,9 +125,6 @@ public interface FieldCache {
       // directly from byte[]
       return Byte.parseByte(term.utf8ToString());
     }
-    protected Object readResolve() {
-      return DEFAULT_BYTE_PARSER;
-    }
     @Override
     public String toString() { 
       return FieldCache.class.getName()+".DEFAULT_BYTE_PARSER"; 
@@ -143,9 +140,6 @@ public interface FieldCache {
       // directly from byte[]
       return Short.parseShort(term.utf8ToString());
     }
-    protected Object readResolve() {
-      return DEFAULT_SHORT_PARSER;
-    }
     @Override
     public String toString() { 
       return FieldCache.class.getName()+".DEFAULT_SHORT_PARSER"; 
@@ -161,9 +155,6 @@ public interface FieldCache {
       // directly from byte[]
       return Integer.parseInt(term.utf8ToString());
     }
-    protected Object readResolve() {
-      return DEFAULT_INT_PARSER;
-    }
     @Override
     public String toString() { 
       return FieldCache.class.getName()+".DEFAULT_INT_PARSER"; 
@@ -179,9 +170,6 @@ public interface FieldCache {
       // directly from byte[]
       return Float.parseFloat(term.utf8ToString());
     }
-    protected Object readResolve() {
-      return DEFAULT_FLOAT_PARSER;
-    }
     @Override
     public String toString() { 
       return FieldCache.class.getName()+".DEFAULT_FLOAT_PARSER"; 
@@ -197,9 +185,6 @@ public interface FieldCache {
       // directly from byte[]
       return Long.parseLong(term.utf8ToString());
     }
-    protected Object readResolve() {
-      return DEFAULT_LONG_PARSER;
-    }
     @Override
     public String toString() { 
       return FieldCache.class.getName()+".DEFAULT_LONG_PARSER"; 
@@ -215,9 +200,6 @@ public interface FieldCache {
       // directly from byte[]
       return Double.parseDouble(term.utf8ToString());
     }
-    protected Object readResolve() {
-      return DEFAULT_DOUBLE_PARSER;
-    }
     @Override
     public String toString() { 
       return FieldCache.class.getName()+".DEFAULT_DOUBLE_PARSER"; 
@@ -234,9 +216,6 @@ public interface FieldCache {
         throw new FieldCacheImpl.StopFillCacheException();
       return NumericUtils.prefixCodedToInt(term);
     }
-    protected Object readResolve() {
-      return NUMERIC_UTILS_INT_PARSER;
-    }
     @Override
     public String toString() { 
       return FieldCache.class.getName()+".NUMERIC_UTILS_INT_PARSER"; 
@@ -253,9 +232,6 @@ public interface FieldCache {
         throw new FieldCacheImpl.StopFillCacheException();
       return NumericUtils.sortableIntToFloat(NumericUtils.prefixCodedToInt(term));
     }
-    protected Object readResolve() {
-      return NUMERIC_UTILS_FLOAT_PARSER;
-    }
     @Override
     public String toString() { 
       return FieldCache.class.getName()+".NUMERIC_UTILS_FLOAT_PARSER"; 
@@ -272,9 +248,6 @@ public interface FieldCache {
         throw new FieldCacheImpl.StopFillCacheException();
       return NumericUtils.prefixCodedToLong(term);
     }
-    protected Object readResolve() {
-      return NUMERIC_UTILS_LONG_PARSER;
-    }
     @Override
     public String toString() { 
       return FieldCache.class.getName()+".NUMERIC_UTILS_LONG_PARSER"; 
@@ -291,9 +264,6 @@ public interface FieldCache {
         throw new FieldCacheImpl.StopFillCacheException();
       return NumericUtils.sortableLongToDouble(NumericUtils.prefixCodedToLong(term));
     }
-    protected Object readResolve() {
-      return NUMERIC_UTILS_DOUBLE_PARSER;
-    }
     @Override
     public String toString() { 
       return FieldCache.class.getName()+".NUMERIC_UTILS_DOUBLE_PARSER"; 

Modified: lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/search/ScoringRewrite.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/search/ScoringRewrite.java?rev=1334849&r1=1334848&r2=1334849&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/search/ScoringRewrite.java (original)
+++ lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/search/ScoringRewrite.java Mon
May  7 00:44:49 2012
@@ -67,11 +67,6 @@ public abstract class ScoringRewrite<Q e
       if (count > BooleanQuery.getMaxClauseCount())
         throw new BooleanQuery.TooManyClauses();
     }
-    
-    // Make sure we are still a singleton even after deserializing
-    protected Object readResolve() {
-      return SCORING_BOOLEAN_QUERY_REWRITE;
-    }    
   };
   
   /** Like {@link #SCORING_BOOLEAN_QUERY_REWRITE} except
@@ -96,11 +91,6 @@ public abstract class ScoringRewrite<Q e
       result.setBoost(query.getBoost());
       return result;
     }
-
-    // Make sure we are still a singleton even after deserializing
-    protected Object readResolve() {
-      return CONSTANT_SCORE_BOOLEAN_QUERY_REWRITE;
-    }
   };
 
   /** This method is called after every new term to check if the number of max clauses

Modified: lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/search/spans/SpanMultiTermQueryWrapper.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/search/spans/SpanMultiTermQueryWrapper.java?rev=1334849&r1=1334848&r2=1334849&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/search/spans/SpanMultiTermQueryWrapper.java
(original)
+++ lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/search/spans/SpanMultiTermQueryWrapper.java
Mon May  7 00:44:49 2012
@@ -173,11 +173,6 @@ public class SpanMultiTermQueryWrapper<Q
     public SpanQuery rewrite(IndexReader reader, MultiTermQuery query) throws IOException
{
       return delegate.rewrite(reader, query);
     }
-
-    // Make sure we are still a singleton even after deserializing
-    protected Object readResolve() {
-      return SCORING_SPAN_QUERY_REWRITE;
-    }
   };
   
   /**

Modified: lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/index/TestCrashCausesCorruptIndex.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/index/TestCrashCausesCorruptIndex.java?rev=1334849&r1=1334848&r2=1334849&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/index/TestCrashCausesCorruptIndex.java
(original)
+++ lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/index/TestCrashCausesCorruptIndex.java
Mon May  7 00:44:49 2012
@@ -146,11 +146,6 @@ public class TestCrashCausesCorruptIndex
    * actual machine crash.
    */
   private static class CrashingException extends RuntimeException {
-    /**
-     * 
-     */
-    private static final long serialVersionUID = 1L;
-
     public CrashingException(String msg) {
       super(msg);
     }

Modified: lucene/dev/trunk/lucene/queries/src/java/org/apache/lucene/queries/function/ValueSource.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/queries/src/java/org/apache/lucene/queries/function/ValueSource.java?rev=1334849&r1=1334848&r2=1334849&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/queries/src/java/org/apache/lucene/queries/function/ValueSource.java
(original)
+++ lucene/dev/trunk/lucene/queries/src/java/org/apache/lucene/queries/function/ValueSource.java
Mon May  7 00:44:49 2012
@@ -18,16 +18,12 @@ package org.apache.lucene.queries.functi
  */
 
 import org.apache.lucene.index.AtomicReaderContext;
-import org.apache.lucene.index.IndexReader;
 import org.apache.lucene.search.FieldComparator;
 import org.apache.lucene.search.FieldComparatorSource;
-import org.apache.lucene.search.Scorer;
 import org.apache.lucene.search.IndexSearcher;
 import org.apache.lucene.search.SortField;
-import org.apache.lucene.util.Bits;
 
 import java.io.IOException;
-import java.io.Serializable;
 import java.util.IdentityHashMap;
 import java.util.Map;
 
@@ -38,7 +34,7 @@ import java.util.Map;
  *
  *
  */
-public abstract class ValueSource implements Serializable {
+public abstract class ValueSource {
 
   /**
    * Gets the values for this reader and the context that was previously



Mime
View raw message