LUCENE-4037: remove serialization cruft

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1334849 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Robert Muir 2012-05-07 00:44:49 +00:00
parent 8f7c1da3ba
commit ea376c8725
6 changed files with 5 additions and 58 deletions

View File

@ -141,9 +141,10 @@ Changes in backwards compatibility policy
ParallelMultiSearcher into IndexSearcher as an optional ParallelMultiSearcher into IndexSearcher as an optional
ExecutorServiced passed to its ctor. (Mike McCandless) ExecutorServiced passed to its ctor. (Mike McCandless)
* LUCENE-2908: Removed serialization code from lucene classes. It is recommended * LUCENE-2908, LUCENE-4037: Removed serialization code from lucene classes.
that you serialize user search needs at a higher level in your application. It is recommended that you serialize user search needs at a higher level
(Robert Muir) in your application.
(Robert Muir, Benson Margulies)
* LUCENE-2831: Changed Weight#scorer, Weight#explain & Filter#getDocIdSet to * LUCENE-2831: Changed Weight#scorer, Weight#explain & Filter#getDocIdSet to
operate on a AtomicReaderContext instead of directly on IndexReader to enable operate on a AtomicReaderContext instead of directly on IndexReader to enable

View File

@ -125,9 +125,6 @@ public interface FieldCache {
// directly from byte[] // directly from byte[]
return Byte.parseByte(term.utf8ToString()); return Byte.parseByte(term.utf8ToString());
} }
protected Object readResolve() {
return DEFAULT_BYTE_PARSER;
}
@Override @Override
public String toString() { public String toString() {
return FieldCache.class.getName()+".DEFAULT_BYTE_PARSER"; return FieldCache.class.getName()+".DEFAULT_BYTE_PARSER";
@ -143,9 +140,6 @@ public interface FieldCache {
// directly from byte[] // directly from byte[]
return Short.parseShort(term.utf8ToString()); return Short.parseShort(term.utf8ToString());
} }
protected Object readResolve() {
return DEFAULT_SHORT_PARSER;
}
@Override @Override
public String toString() { public String toString() {
return FieldCache.class.getName()+".DEFAULT_SHORT_PARSER"; return FieldCache.class.getName()+".DEFAULT_SHORT_PARSER";
@ -161,9 +155,6 @@ public interface FieldCache {
// directly from byte[] // directly from byte[]
return Integer.parseInt(term.utf8ToString()); return Integer.parseInt(term.utf8ToString());
} }
protected Object readResolve() {
return DEFAULT_INT_PARSER;
}
@Override @Override
public String toString() { public String toString() {
return FieldCache.class.getName()+".DEFAULT_INT_PARSER"; return FieldCache.class.getName()+".DEFAULT_INT_PARSER";
@ -179,9 +170,6 @@ public interface FieldCache {
// directly from byte[] // directly from byte[]
return Float.parseFloat(term.utf8ToString()); return Float.parseFloat(term.utf8ToString());
} }
protected Object readResolve() {
return DEFAULT_FLOAT_PARSER;
}
@Override @Override
public String toString() { public String toString() {
return FieldCache.class.getName()+".DEFAULT_FLOAT_PARSER"; return FieldCache.class.getName()+".DEFAULT_FLOAT_PARSER";
@ -197,9 +185,6 @@ public interface FieldCache {
// directly from byte[] // directly from byte[]
return Long.parseLong(term.utf8ToString()); return Long.parseLong(term.utf8ToString());
} }
protected Object readResolve() {
return DEFAULT_LONG_PARSER;
}
@Override @Override
public String toString() { public String toString() {
return FieldCache.class.getName()+".DEFAULT_LONG_PARSER"; return FieldCache.class.getName()+".DEFAULT_LONG_PARSER";
@ -215,9 +200,6 @@ public interface FieldCache {
// directly from byte[] // directly from byte[]
return Double.parseDouble(term.utf8ToString()); return Double.parseDouble(term.utf8ToString());
} }
protected Object readResolve() {
return DEFAULT_DOUBLE_PARSER;
}
@Override @Override
public String toString() { public String toString() {
return FieldCache.class.getName()+".DEFAULT_DOUBLE_PARSER"; return FieldCache.class.getName()+".DEFAULT_DOUBLE_PARSER";
@ -234,9 +216,6 @@ public interface FieldCache {
throw new FieldCacheImpl.StopFillCacheException(); throw new FieldCacheImpl.StopFillCacheException();
return NumericUtils.prefixCodedToInt(term); return NumericUtils.prefixCodedToInt(term);
} }
protected Object readResolve() {
return NUMERIC_UTILS_INT_PARSER;
}
@Override @Override
public String toString() { public String toString() {
return FieldCache.class.getName()+".NUMERIC_UTILS_INT_PARSER"; return FieldCache.class.getName()+".NUMERIC_UTILS_INT_PARSER";
@ -253,9 +232,6 @@ public interface FieldCache {
throw new FieldCacheImpl.StopFillCacheException(); throw new FieldCacheImpl.StopFillCacheException();
return NumericUtils.sortableIntToFloat(NumericUtils.prefixCodedToInt(term)); return NumericUtils.sortableIntToFloat(NumericUtils.prefixCodedToInt(term));
} }
protected Object readResolve() {
return NUMERIC_UTILS_FLOAT_PARSER;
}
@Override @Override
public String toString() { public String toString() {
return FieldCache.class.getName()+".NUMERIC_UTILS_FLOAT_PARSER"; return FieldCache.class.getName()+".NUMERIC_UTILS_FLOAT_PARSER";
@ -272,9 +248,6 @@ public interface FieldCache {
throw new FieldCacheImpl.StopFillCacheException(); throw new FieldCacheImpl.StopFillCacheException();
return NumericUtils.prefixCodedToLong(term); return NumericUtils.prefixCodedToLong(term);
} }
protected Object readResolve() {
return NUMERIC_UTILS_LONG_PARSER;
}
@Override @Override
public String toString() { public String toString() {
return FieldCache.class.getName()+".NUMERIC_UTILS_LONG_PARSER"; return FieldCache.class.getName()+".NUMERIC_UTILS_LONG_PARSER";
@ -291,9 +264,6 @@ public interface FieldCache {
throw new FieldCacheImpl.StopFillCacheException(); throw new FieldCacheImpl.StopFillCacheException();
return NumericUtils.sortableLongToDouble(NumericUtils.prefixCodedToLong(term)); return NumericUtils.sortableLongToDouble(NumericUtils.prefixCodedToLong(term));
} }
protected Object readResolve() {
return NUMERIC_UTILS_DOUBLE_PARSER;
}
@Override @Override
public String toString() { public String toString() {
return FieldCache.class.getName()+".NUMERIC_UTILS_DOUBLE_PARSER"; return FieldCache.class.getName()+".NUMERIC_UTILS_DOUBLE_PARSER";

View File

@ -67,11 +67,6 @@ public abstract class ScoringRewrite<Q extends Query> extends TermCollectingRewr
if (count > BooleanQuery.getMaxClauseCount()) if (count > BooleanQuery.getMaxClauseCount())
throw new BooleanQuery.TooManyClauses(); 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 /** Like {@link #SCORING_BOOLEAN_QUERY_REWRITE} except
@ -96,11 +91,6 @@ public abstract class ScoringRewrite<Q extends Query> extends TermCollectingRewr
result.setBoost(query.getBoost()); result.setBoost(query.getBoost());
return result; 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 /** This method is called after every new term to check if the number of max clauses

View File

@ -173,11 +173,6 @@ public class SpanMultiTermQueryWrapper<Q extends MultiTermQuery> extends SpanQue
public SpanQuery rewrite(IndexReader reader, MultiTermQuery query) throws IOException { public SpanQuery rewrite(IndexReader reader, MultiTermQuery query) throws IOException {
return delegate.rewrite(reader, query); return delegate.rewrite(reader, query);
} }
// Make sure we are still a singleton even after deserializing
protected Object readResolve() {
return SCORING_SPAN_QUERY_REWRITE;
}
}; };
/** /**

View File

@ -146,11 +146,6 @@ public class TestCrashCausesCorruptIndex extends LuceneTestCase {
* actual machine crash. * actual machine crash.
*/ */
private static class CrashingException extends RuntimeException { private static class CrashingException extends RuntimeException {
/**
*
*/
private static final long serialVersionUID = 1L;
public CrashingException(String msg) { public CrashingException(String msg) {
super(msg); super(msg);
} }

View File

@ -18,16 +18,12 @@ package org.apache.lucene.queries.function;
*/ */
import org.apache.lucene.index.AtomicReaderContext; import org.apache.lucene.index.AtomicReaderContext;
import org.apache.lucene.index.IndexReader;
import org.apache.lucene.search.FieldComparator; import org.apache.lucene.search.FieldComparator;
import org.apache.lucene.search.FieldComparatorSource; import org.apache.lucene.search.FieldComparatorSource;
import org.apache.lucene.search.Scorer;
import org.apache.lucene.search.IndexSearcher; import org.apache.lucene.search.IndexSearcher;
import org.apache.lucene.search.SortField; import org.apache.lucene.search.SortField;
import org.apache.lucene.util.Bits;
import java.io.IOException; import java.io.IOException;
import java.io.Serializable;
import java.util.IdentityHashMap; import java.util.IdentityHashMap;
import java.util.Map; 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 * Gets the values for this reader and the context that was previously