LUCENE-2908: clean up serialization in the codebase

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1068526 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Robert Muir 2011-02-08 19:05:28 +00:00
parent c9c5694765
commit 70a9910b38
129 changed files with 71 additions and 493 deletions

View File

@ -118,6 +118,10 @@ Changes in backwards compatibility policy
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-2831: Changed Weight#scorer, Weight#explain & Filter#getDocIdSet to
operate on a AtomicReaderContext instead of directly on IndexReader to enable
searches to be aware of IndexSearcher's context. (Simon Willnauer)

View File

@ -1,7 +1,5 @@
package org.apache.lucene.store.instantiated;
import java.io.Serializable;
/**
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@ -22,7 +20,7 @@ import java.io.Serializable;
/**
* For non package access see {@link org.apache.lucene.index.IndexReader#getFieldNames(org.apache.lucene.index.IndexReader.FieldOption)}
*/
class FieldSetting implements Serializable {
class FieldSetting {
String fieldName;
boolean storeTermVector = false;

View File

@ -3,7 +3,6 @@ package org.apache.lucene.store.instantiated;
import java.util.HashMap;
import java.util.Map;
import java.util.Collection;
import java.io.Serializable;
/**
* Licensed to the Apache Software Foundation (ASF) under one or more
@ -25,7 +24,7 @@ import java.io.Serializable;
/**
* Essentially a Map<FieldName, {@link org.apache.lucene.store.instantiated.FieldSetting}>
*/
class FieldSettings implements Serializable {
class FieldSettings {
FieldSettings() {

View File

@ -18,7 +18,6 @@ package org.apache.lucene.store.instantiated;
import org.apache.lucene.document.Document;
import java.io.Serializable;
import java.util.List;
import java.util.Map;
@ -27,10 +26,7 @@ import java.util.Map;
*
* @see org.apache.lucene.document.Document
*/
public class InstantiatedDocument
implements Serializable {
private static final long serialVersionUID = 1l;
public class InstantiatedDocument {
private Document document;

View File

@ -18,7 +18,6 @@ package org.apache.lucene.store.instantiated;
import java.io.Closeable;
import java.io.IOException;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
@ -60,9 +59,7 @@ import org.apache.lucene.util.BytesRef;
* Consider using InstantiatedIndex as if it was immutable.
*/
public class InstantiatedIndex
implements Serializable,Closeable {
private static final long serialVersionUID = 1l;
implements Closeable {
private long version = System.currentTimeMillis();

View File

@ -16,7 +16,6 @@ package org.apache.lucene.store.instantiated;
* limitations under the License.
*/
import java.io.Serializable;
import java.util.Comparator;
import org.apache.lucene.index.Term;
@ -26,10 +25,7 @@ import org.apache.lucene.index.Term;
*
* @see org.apache.lucene.index.Term
*/
public class InstantiatedTerm
implements Serializable {
private static final long serialVersionUID = 1l;
public class InstantiatedTerm {
public static final Comparator<InstantiatedTerm> comparator = new Comparator<InstantiatedTerm>() {
public int compare(InstantiatedTerm instantiatedTerm, InstantiatedTerm instantiatedTerm1) {

View File

@ -2,7 +2,6 @@ package org.apache.lucene.store.instantiated;
import org.apache.lucene.index.TermVectorOffsetInfo;
import java.io.Serializable;
import java.util.Comparator;
/**
@ -38,10 +37,7 @@ import java.util.Comparator;
* </pre>
*
*/
public class InstantiatedTermDocumentInformation
implements Serializable {
private static final long serialVersionUID = 1l;
public class InstantiatedTermDocumentInformation {
public static final Comparator<InstantiatedTermDocumentInformation> termComparator = new Comparator<InstantiatedTermDocumentInformation>() {
public int compare(InstantiatedTermDocumentInformation instantiatedTermDocumentInformation, InstantiatedTermDocumentInformation instantiatedTermDocumentInformation1) {

View File

@ -3,7 +3,6 @@ package org.apache.lucene.store.instantiated;
import org.apache.lucene.index.TermFreqVector;
import org.apache.lucene.util.BytesRef;
import java.io.Serializable;
import java.util.Arrays;
import java.util.List;
@ -29,9 +28,7 @@ import java.util.List;
* @see org.apache.lucene.index.TermFreqVector
*/
public class InstantiatedTermFreqVector
implements TermFreqVector, Serializable {
private static final long serialVersionUID = 1l;
implements TermFreqVector {
private final List<InstantiatedTermDocumentInformation> termDocumentInformations;
private final String field;

View File

@ -19,8 +19,6 @@ package org.apache.lucene.store.instantiated;
import org.apache.lucene.index.TermPositionVector;
import org.apache.lucene.index.TermVectorOffsetInfo;
import java.io.Serializable;
/**
* Extended vector space view of a document in an {@link InstantiatedIndexReader}.
*
@ -28,9 +26,7 @@ import java.io.Serializable;
*/
public class InstantiatedTermPositionVector
extends InstantiatedTermFreqVector
implements TermPositionVector, Serializable {
private static final long serialVersionUID = 1l;
implements TermPositionVector {
public InstantiatedTermPositionVector(InstantiatedDocument document, String field) {
super(document, field);

View File

@ -1,56 +0,0 @@
package org.apache.lucene.store.instantiated;
/**
* Copyright 2006 The Apache Software Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import org.apache.lucene.store.Directory;
import org.apache.lucene.util.LuceneTestCase;
import org.apache.lucene.index.IndexWriter;
import org.apache.lucene.index.IndexReader;
import org.apache.lucene.analysis.MockAnalyzer;
import org.apache.lucene.document.Document;
import org.apache.lucene.document.Field;
import java.io.ByteArrayOutputStream;
import java.io.ObjectOutputStream;
public class TestSerialization extends LuceneTestCase {
public void test() throws Exception {
Directory dir = newDirectory();
IndexWriter iw = new IndexWriter(dir, newIndexWriterConfig(TEST_VERSION_CURRENT, new MockAnalyzer()));
Document doc = new Document();
doc.add(new Field("foo", "bar rab abr bra rba", Field.Store.NO, Field.Index.ANALYZED, Field.TermVector.WITH_POSITIONS_OFFSETS));
doc.add(new Field("moo", "bar rab abr bra rba", Field.Store.YES, Field.Index.ANALYZED, Field.TermVector.WITH_POSITIONS_OFFSETS));
iw.addDocument(doc);
iw.close();
IndexReader ir = IndexReader.open(dir, false);
InstantiatedIndex ii = new InstantiatedIndex(ir);
ir.close();
ByteArrayOutputStream baos = new ByteArrayOutputStream(5000);
ObjectOutputStream oos = new ObjectOutputStream(baos);
oos.writeObject(ii);
oos.close();
baos.close();
dir.close();
}
}

View File

@ -18,7 +18,6 @@ package org.apache.lucene.index.memory;
*/
import java.io.IOException;
import java.io.Serializable;
import java.io.StringReader;
import java.util.Arrays;
import java.util.Collection;
@ -186,7 +185,7 @@ import org.apache.lucene.util.Constants; // for javadocs
* hprof tracing </a>).
*
*/
public class MemoryIndex implements Serializable {
public class MemoryIndex {
/** info for each field: Map<String fieldName, Info field> */
private final HashMap<String,Info> fields = new HashMap<String,Info>();
@ -199,8 +198,6 @@ public class MemoryIndex implements Serializable {
/** Could be made configurable; See {@link Document#setBoost(float)} */
private static final float docBoost = 1.0f;
private static final long serialVersionUID = 2782195016849084649L;
private static final boolean DEBUG = false;
@ -589,7 +586,7 @@ public class MemoryIndex implements Serializable {
* Index data structure for a field; Contains the tokenized term texts and
* their positions.
*/
private static final class Info implements Serializable {
private static final class Info {
/**
* Term strings and their positions for this field: Map <String
@ -614,8 +611,6 @@ public class MemoryIndex implements Serializable {
private final long sumTotalTermFreq;
private static final long serialVersionUID = 2882195016849084649L;
public Info(HashMap<BytesRef,ArrayIntList> terms, int numTokens, int numOverlapTokens, float boost) {
this.terms = terms;
this.numTokens = numTokens;
@ -668,12 +663,10 @@ public class MemoryIndex implements Serializable {
* Efficient resizable auto-expanding list holding <code>int</code> elements;
* implemented with arrays.
*/
private static final class ArrayIntList implements Serializable {
private static final class ArrayIntList {
private int[] elements;
private int size = 0;
private static final long serialVersionUID = 2282195016849084649L;
public ArrayIntList() {
this(10);

View File

@ -26,7 +26,7 @@ import org.apache.lucene.search.BooleanClause.Occur;
* of queries.)
*/
public class FilterClause implements java.io.Serializable
public class FilterClause
{
Occur occur = null;
Filter filter = null;

View File

@ -1,7 +1,5 @@
package org.apache.lucene.search.regex;
import java.io.Serializable;
import org.apache.lucene.util.BytesRef;
/**
@ -25,7 +23,7 @@ import org.apache.lucene.util.BytesRef;
* Defines basic operations needed by {@link RegexQuery} for a regular
* expression implementation.
*/
public interface RegexCapabilities extends Serializable {
public interface RegexCapabilities {
/**
* Called by the constructor of {@link RegexTermsEnum} allowing
* implementations to cache a compiled version of the regular

View File

@ -27,8 +27,6 @@ import org.apache.lucene.messages.NLSException;
* @see org.apache.lucene.messages.Message
*/
public class QueryNodeError extends Error implements NLSException {
private static final long serialVersionUID = 1804855832182710327L;
private Message message;
/**

View File

@ -42,8 +42,6 @@ import org.apache.lucene.queryParser.core.nodes.QueryNode;
*/
public class QueryNodeException extends Exception implements NLSException {
private static final long serialVersionUID = -5962648855261624214L;
protected Message message = new MessageImpl(QueryParserMessages.EMPTY_MESSAGE);
public QueryNodeException(Message message) {

View File

@ -33,8 +33,6 @@ import org.apache.lucene.queryParser.core.parser.SyntaxParser;
*/
public class QueryNodeParseException extends QueryNodeException {
private static final long serialVersionUID = 8197535103538766773L;
private CharSequence query;
private int beginColumn = -1;

View File

@ -27,8 +27,6 @@ import org.apache.lucene.queryParser.core.parser.EscapeQuerySyntax;
*/
public class AndQueryNode extends BooleanQueryNode {
private static final long serialVersionUID = 118496077529151825L;
/**
* @param clauses
* - the query nodes to be and'ed

View File

@ -26,8 +26,6 @@ import org.apache.lucene.queryParser.core.parser.EscapeQuerySyntax;
* nodes.
*/
public class AnyQueryNode extends AndQueryNode {
private static final long serialVersionUID = 1000791433562954187L;
private CharSequence field = null;
private int minimumMatchingmElements = 0;

View File

@ -28,8 +28,6 @@ import org.apache.lucene.queryParser.core.parser.EscapeQuerySyntax;
*/
public class BooleanQueryNode extends QueryNodeImpl {
private static final long serialVersionUID = -2206623652088638072L;
/**
* @param clauses
* - the query nodes to be and'ed

View File

@ -34,8 +34,6 @@ import org.apache.lucene.queryParser.core.parser.EscapeQuerySyntax;
*/
public class BoostQueryNode extends QueryNodeImpl {
private static final long serialVersionUID = -3929082630855807593L;
private float value = 0;
/**

View File

@ -27,8 +27,6 @@ import org.apache.lucene.queryParser.core.processors.RemoveDeletedQueryNodesProc
*/
public class DeletedQueryNode extends QueryNodeImpl {
private static final long serialVersionUID = -9151675506000425293L;
public DeletedQueryNode() {
// empty constructor
}

View File

@ -28,8 +28,6 @@ import org.apache.lucene.queryParser.core.parser.EscapeQuerySyntax.Type;
public class FieldQueryNode extends QueryNodeImpl implements TextableQueryNode,
FieldableNode {
private static final long serialVersionUID = 3634521145130758265L;
/**
* The term's field
*/

View File

@ -25,8 +25,6 @@ import org.apache.lucene.queryParser.core.parser.EscapeQuerySyntax;
*/
public class FuzzyQueryNode extends FieldQueryNode {
private static final long serialVersionUID = -1794537213032589441L;
private float similarity;
private int prefixLength;

View File

@ -34,8 +34,6 @@ import org.apache.lucene.queryParser.core.parser.EscapeQuerySyntax;
*/
public class GroupQueryNode extends QueryNodeImpl {
private static final long serialVersionUID = -9204673493869114999L;
/**
* This QueryNode is used to identify parenthesis on the original query string
*/

View File

@ -25,8 +25,6 @@ import org.apache.lucene.queryParser.core.parser.EscapeQuerySyntax;
*/
public class MatchAllDocsQueryNode extends QueryNodeImpl {
private static final long serialVersionUID = -7050381275423477809L;
public MatchAllDocsQueryNode() {
// empty constructor
}

View File

@ -24,8 +24,6 @@ package org.apache.lucene.queryParser.core.nodes;
*/
public class MatchNoDocsQueryNode extends DeletedQueryNode {
private static final long serialVersionUID = 8081805751679581497L;
public MatchNoDocsQueryNode() {
// empty constructor
}

View File

@ -36,8 +36,6 @@ import org.apache.lucene.queryParser.core.parser.EscapeQuerySyntax;
*/
public class ModifierQueryNode extends QueryNodeImpl {
private static final long serialVersionUID = -391209837953928169L;
public enum Modifier {
MOD_NONE, MOD_NOT, MOD_REQ;

View File

@ -25,8 +25,6 @@ import org.apache.lucene.queryParser.core.parser.EscapeQuerySyntax;
*/
public class NoTokenFoundQueryNode extends DeletedQueryNode {
private static final long serialVersionUID = 7332975497586993833L;
public NoTokenFoundQueryNode() {
super();
}

View File

@ -26,8 +26,6 @@ import org.apache.lucene.queryParser.core.parser.EscapeQuerySyntax;
*/
public class OpaqueQueryNode extends QueryNodeImpl {
private static final long serialVersionUID = 0L;
private CharSequence schema = null;
private CharSequence value = null;

View File

@ -29,8 +29,6 @@ import org.apache.lucene.queryParser.core.parser.EscapeQuerySyntax;
*/
public class OrQueryNode extends BooleanQueryNode {
private static final long serialVersionUID = -3692323307688017852L;
/**
* @param clauses
* - the query nodes to be or'ed

View File

@ -25,8 +25,6 @@ import org.apache.lucene.queryParser.core.parser.EscapeQuerySyntax;
*/
public class ParametricQueryNode extends FieldQueryNode {
private static final long serialVersionUID = -5770038129741218116L;
private CompareOperator operator;
public enum CompareOperator {

View File

@ -29,8 +29,6 @@ import org.apache.lucene.queryParser.core.parser.EscapeQuerySyntax;
public class ParametricRangeQueryNode extends QueryNodeImpl implements
FieldableNode {
private static final long serialVersionUID = 7120958816535573935L;
public ParametricRangeQueryNode(ParametricQueryNode lowerBound,
ParametricQueryNode upperBound) {

View File

@ -41,8 +41,6 @@ import org.apache.lucene.queryParser.core.parser.EscapeQuerySyntax.Type;
*/
public class PathQueryNode extends QueryNodeImpl {
private static final long serialVersionUID = -8325921322405804789L;
public static class QueryText implements Cloneable {
CharSequence value = null;
/**

View File

@ -26,8 +26,6 @@ import org.apache.lucene.queryParser.core.parser.EscapeQuerySyntax;
public class PhraseSlopQueryNode extends QueryNodeImpl implements FieldableNode {
private static final long serialVersionUID = 0L;
private int value = 0;
/**

View File

@ -33,8 +33,6 @@ import org.apache.lucene.queryParser.core.parser.EscapeQuerySyntax;
*/
public class ProximityQueryNode extends BooleanQueryNode {
private static final long serialVersionUID = 9018220596680832916L;
public enum Type {
PARAGRAPH {
@Override

View File

@ -17,7 +17,6 @@ package org.apache.lucene.queryParser.core.nodes;
* limitations under the License.
*/
import java.io.Serializable;
import java.util.List;
import java.util.Map;
@ -27,7 +26,7 @@ import org.apache.lucene.queryParser.core.parser.EscapeQuerySyntax;
* A {@link QueryNode} is a interface implemented by all nodes on a QueryNode
* tree.
*/
public interface QueryNode extends Serializable {
public interface QueryNode {
/** convert to a query string understood by the query parser */
// TODO: this interface might be changed in the future

View File

@ -33,8 +33,6 @@ import org.apache.lucene.queryParser.core.util.StringUtils;
*/
public abstract class QueryNodeImpl implements QueryNode, Cloneable {
private static final long serialVersionUID = 5569870883474845989L;
/* index default field */
// TODO remove PLAINTEXT_FIELD_NAME replacing it with configuration APIs
public static final String PLAINTEXT_FIELD_NAME = "_plain";

View File

@ -25,8 +25,6 @@ import org.apache.lucene.queryParser.core.parser.EscapeQuerySyntax;
*/
public class QuotedFieldQueryNode extends FieldQueryNode {
private static final long serialVersionUID = -6675157780051428987L;
/**
* @param field
* - field name

View File

@ -34,8 +34,6 @@ import org.apache.lucene.queryParser.core.parser.EscapeQuerySyntax;
*/
public class SlopQueryNode extends QueryNodeImpl implements FieldableNode {
private static final long serialVersionUID = 0L;
private int value = 0;
/**

View File

@ -28,8 +28,6 @@ import org.apache.lucene.queryParser.core.parser.EscapeQuerySyntax;
public class TokenizedPhraseQueryNode extends QueryNodeImpl implements
FieldableNode {
private static final long serialVersionUID = -7185108320787917541L;
public TokenizedPhraseQueryNode() {
setLeaf(false);
allocate();

View File

@ -26,7 +26,7 @@ Contains query nodes that are commonly used by query parser implementations
<h2>Query Nodes</h2>
<p>
The package <tt>org.apache.lucene.queryParser.nodes</tt> contains all the basic query nodes. The interface
that represents a query node is {@link org.apache.lucene.queryParser.core.nodes.QueryNode}. Every query node must be serializable.
that represents a query node is {@link org.apache.lucene.queryParser.core.nodes.QueryNode}.
</p>
<p>
{@link org.apache.lucene.queryParser.core.nodes.QueryNode}s are used by the text parser to create a syntax tree.

View File

@ -244,8 +244,6 @@ public abstract class QueryNodeProcessorImpl implements QueryNodeProcessor {
private static class ChildrenList extends ArrayList<QueryNode> {
private static final long serialVersionUID = -2613518456949297135L;
boolean beingUsed;
}

View File

@ -31,8 +31,6 @@ import org.apache.lucene.util.AttributeImpl;
public class AllowLeadingWildcardAttributeImpl extends AttributeImpl
implements AllowLeadingWildcardAttribute {
private static final long serialVersionUID = -2804763012723049527L;
private boolean allowLeadingWildcard = false; // default in 2.9
public void setAllowLeadingWildcard(boolean allowLeadingWildcard) {

View File

@ -33,8 +33,6 @@ import org.apache.lucene.util.AttributeImpl;
public class AnalyzerAttributeImpl extends AttributeImpl
implements AnalyzerAttribute {
private static final long serialVersionUID = -6804760312723049526L;
private Analyzer analyzer;
public AnalyzerAttributeImpl() {

View File

@ -33,8 +33,6 @@ import org.apache.lucene.util.AttributeImpl;
public class BoostAttributeImpl extends AttributeImpl
implements BoostAttribute {
private static final long serialVersionUID = -2104763012523049527L;
private float boost = 1.0f;
public BoostAttributeImpl() {

View File

@ -33,8 +33,6 @@ import org.apache.lucene.util.AttributeImpl;
public class DateResolutionAttributeImpl extends AttributeImpl
implements DateResolutionAttribute {
private static final long serialVersionUID = -6804360312723049526L;
private DateTools.Resolution dateResolution = null;
public DateResolutionAttributeImpl() {

View File

@ -32,8 +32,6 @@ import org.apache.lucene.util.AttributeImpl;
public class DefaultOperatorAttributeImpl extends AttributeImpl
implements DefaultOperatorAttribute {
private static final long serialVersionUID = -6804760312723049526L;
private Operator operator = Operator.OR;
public DefaultOperatorAttributeImpl() {

View File

@ -32,8 +32,6 @@ import org.apache.lucene.util.AttributeImpl;
public class DefaultPhraseSlopAttributeImpl extends AttributeImpl
implements DefaultPhraseSlopAttribute {
private static final long serialVersionUID = -2104763012527049527L;
private int defaultPhraseSlop = 0;
public DefaultPhraseSlopAttributeImpl() {

View File

@ -36,8 +36,6 @@ import org.apache.lucene.util.AttributeImpl;
public class FieldBoostMapAttributeImpl extends AttributeImpl
implements FieldBoostMapAttribute {
private static final long serialVersionUID = -2104763012523049527L;
private Map<String, Float> boosts = new LinkedHashMap<String, Float>();

View File

@ -34,8 +34,6 @@ import org.apache.lucene.queryParser.core.config.QueryConfigHandler;
*/
public class FieldBoostMapFCListener implements FieldConfigListener {
private static final long serialVersionUID = -5929802948798314067L;
private QueryConfigHandler config = null;
public FieldBoostMapFCListener(QueryConfigHandler config) {

View File

@ -36,8 +36,6 @@ import org.apache.lucene.queryParser.core.config.QueryConfigHandler;
*/
public class FieldDateResolutionFCListener implements FieldConfigListener {
private static final long serialVersionUID = -5929802948798314067L;
private QueryConfigHandler config = null;
public FieldDateResolutionFCListener(QueryConfigHandler config) {

View File

@ -33,8 +33,6 @@ import org.apache.lucene.util.AttributeImpl;
public class FieldDateResolutionMapAttributeImpl extends AttributeImpl
implements FieldDateResolutionMapAttribute {
private static final long serialVersionUID = -2104763012523049527L;
private Map<CharSequence, DateTools.Resolution> dateRes = new HashMap<CharSequence, DateTools.Resolution>();

View File

@ -33,8 +33,6 @@ import org.apache.lucene.util.AttributeImpl;
public class FuzzyAttributeImpl extends AttributeImpl
implements FuzzyAttribute {
private static final long serialVersionUID = -2104763012527049527L;
private int prefixLength = FuzzyQuery.defaultPrefixLength;
private float minSimilarity = FuzzyQuery.defaultMinSimilarity;

View File

@ -33,8 +33,6 @@ import org.apache.lucene.util.AttributeImpl;
public class LocaleAttributeImpl extends AttributeImpl
implements LocaleAttribute {
private static final long serialVersionUID = -6804760312720049526L;
private Locale locale = Locale.getDefault();
public LocaleAttributeImpl() {

View File

@ -33,8 +33,6 @@ import org.apache.lucene.util.AttributeImpl;
public class LowercaseExpandedTermsAttributeImpl extends AttributeImpl
implements LowercaseExpandedTermsAttribute {
private static final long serialVersionUID = -2804760312723049527L;
private boolean lowercaseExpandedTerms = true;
public LowercaseExpandedTermsAttributeImpl() {

View File

@ -33,8 +33,6 @@ import org.apache.lucene.util.AttributeImpl;
public class MultiFieldAttributeImpl extends AttributeImpl
implements MultiFieldAttribute {
private static final long serialVersionUID = -6809760312720049526L;
private CharSequence[] fields;
public MultiFieldAttributeImpl() {

View File

@ -33,8 +33,6 @@ import org.apache.lucene.util.AttributeImpl;
*/
public class MultiTermRewriteMethodAttributeImpl extends AttributeImpl
implements MultiTermRewriteMethodAttribute {
private static final long serialVersionUID = -2104763012723049527L;
private MultiTermQuery.RewriteMethod multiTermRewriteMethod = MultiTermQuery.CONSTANT_SCORE_AUTO_REWRITE_DEFAULT;

View File

@ -31,8 +31,6 @@ import org.apache.lucene.util.AttributeImpl;
public class PositionIncrementsAttributeImpl extends AttributeImpl
implements PositionIncrementsAttribute {
private static final long serialVersionUID = -2804763012793049527L;
private boolean positionIncrementsEnabled = false;
public PositionIncrementsAttributeImpl() {

View File

@ -35,8 +35,6 @@ import org.apache.lucene.util.AttributeImpl;
public class RangeCollatorAttributeImpl extends AttributeImpl
implements RangeCollatorAttribute {
private static final long serialVersionUID = -6804360312723049526L;
private Collator rangeCollator;
public RangeCollatorAttributeImpl() {

View File

@ -30,8 +30,6 @@ import org.apache.lucene.queryParser.standard.processors.GroupQueryNodeProcessor
*/
public class BooleanModifierNode extends ModifierQueryNode {
private static final long serialVersionUID = -557816496416587068L;
public BooleanModifierNode(QueryNode node, Modifier mod) {
super(node, mod);
}

View File

@ -33,8 +33,6 @@ import org.apache.lucene.search.PhraseQuery;
public class MultiPhraseQueryNode extends QueryNodeImpl implements
FieldableNode {
private static final long serialVersionUID = -2138501723963320158L;
public MultiPhraseQueryNode() {
setLeaf(false);
allocate();

View File

@ -27,8 +27,6 @@ import org.apache.lucene.queryParser.core.nodes.FieldQueryNode;
*/
public class PrefixWildcardQueryNode extends WildcardQueryNode {
private static final long serialVersionUID = 6851557641826407515L;
/**
* @param field
* - field name

View File

@ -34,8 +34,6 @@ import org.apache.lucene.queryParser.standard.processors.ParametricRangeQueryNod
*/
public class RangeQueryNode extends ParametricRangeQueryNode {
private static final long serialVersionUID = 7400866652044314657L;
private Collator collator;
/**

View File

@ -29,7 +29,6 @@ import org.apache.lucene.util.BytesRef;
*/
public class RegexpQueryNode extends QueryNodeImpl implements TextableQueryNode,
FieldableNode {
private static final long serialVersionUID = 0L;
private CharSequence text;
private CharSequence field;
/**

View File

@ -34,8 +34,6 @@ import org.apache.lucene.search.SimilarityProvider;
*/
public class StandardBooleanQueryNode extends BooleanQueryNode {
private static final long serialVersionUID = 1938287817191138787L;
private boolean disableCoord;
/**

View File

@ -25,7 +25,6 @@ import org.apache.lucene.queryParser.core.parser.EscapeQuerySyntax;
* phrases. Examples: a*b*c Fl?w? m?ke*g
*/
public class WildcardQueryNode extends FieldQueryNode {
private static final long serialVersionUID = 0L;
/**
* @param field

View File

@ -31,8 +31,6 @@ import org.apache.lucene.util.AttributeImpl;
public class UniqueFieldAttributeImpl extends AttributeImpl implements
UniqueFieldAttribute {
private static final long serialVersionUID = 8553318595851064232L;
private CharSequence uniqueField;
public UniqueFieldAttributeImpl() {

View File

@ -36,11 +36,6 @@ import org.apache.lucene.spatial.tier.DistanceFilter;
*/
public class GeoHashDistanceFilter extends DistanceFilter {
/**
*
*/
private static final long serialVersionUID = 1L;
private double lat;
private double lng;

View File

@ -31,8 +31,6 @@ import org.apache.lucene.search.FieldComparatorSource;
*/
public class DistanceFieldComparatorSource extends FieldComparatorSource {
private static final long serialVersionUID = 1L;
private DistanceFilter distanceFilter;
private DistanceScoreDocLookupComparator dsdlc;

View File

@ -19,8 +19,6 @@ package org.apache.lucene.spatial.tier;
import java.util.Map;
import java.util.WeakHashMap;
import java.util.HashMap;
import java.io.IOException;
import java.io.ObjectInputStream;
import org.apache.lucene.search.Filter;
import org.apache.lucene.spatial.tier.DistanceHandler.Precision;
@ -63,12 +61,6 @@ public abstract class DistanceFilter extends Filter {
distanceLookupCache = new WeakHashMap<String,Double>();
}
/** needed for deserialization, because the cache is transient */
private void readObject(ObjectInputStream stream) throws IOException, ClassNotFoundException {
stream.defaultReadObject();
distanceLookupCache = new WeakHashMap<String,Double>();
}
public Map<Integer,Double> getDistances(){
return distances;
}

View File

@ -30,8 +30,6 @@ import org.apache.lucene.spatial.geohash.GeoHashDistanceFilter;
* release.</font>
*/
public class DistanceQueryBuilder {
private static final long serialVersionUID = 1L;
private final double lat;
private final double lng;

View File

@ -24,11 +24,6 @@ package org.apache.lucene.spatial.tier;
*/
public class InvalidGeoException extends Exception {
/**
*
*/
private static final long serialVersionUID = 1L;
public InvalidGeoException(String message){
super(message);
}

View File

@ -33,11 +33,6 @@ import org.apache.lucene.spatial.DistanceUtils;
* release.</font>
*/
public class LatLongDistanceFilter extends DistanceFilter {
/**
*
*/
private static final long serialVersionUID = 1L;
double lat;
double lng;

View File

@ -17,7 +17,6 @@
package org.apache.lucene.spatial.tier;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
@ -26,7 +25,7 @@ import java.util.List;
* flux and might change in incompatible ways in the next
* release.</font>
*/
public class Shape implements Serializable{
public class Shape {
private List<Double> area = new ArrayList<Double>();
private String tierId;

View File

@ -1,45 +0,0 @@
/**
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.lucene.spatial.tier;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.NotSerializableException;
import java.io.ObjectOutputStream;
import org.apache.lucene.util.LuceneTestCase;
/**
*
* Test for {@link CartesianShapeFilter}
*
*/
public class TestCartesianShapeFilter extends LuceneTestCase {
public void testSerializable() throws IOException {
CartesianShapeFilter filter = new CartesianShapeFilter(new Shape("1"),
"test");
try {
ByteArrayOutputStream bos = new ByteArrayOutputStream();
ObjectOutputStream oos = new ObjectOutputStream(bos);
oos.writeObject(filter);
} catch (NotSerializableException e) {
fail("Filter should be serializable but raised a NotSerializableException ["+e.getMessage()+"]");
}
}
}

View File

@ -154,7 +154,6 @@ public class NumericRangeFilterBuilder implements FilterBuilder {
}
static class NoMatchFilter extends Filter {
private static final long serialVersionUID = 1L;
@Override
public DocIdSet getDocIdSet(AtomicReaderContext context) throws IOException {

View File

@ -17,7 +17,6 @@ package org.apache.lucene.analysis.tokenattributes;
* limitations under the License.
*/
import java.io.Serializable;
import java.nio.CharBuffer;
import org.apache.lucene.util.ArrayUtil;
@ -30,7 +29,7 @@ import org.apache.lucene.util.UnicodeUtil;
/**
* The term text of a Token.
*/
public class CharTermAttributeImpl extends AttributeImpl implements CharTermAttribute, TermToBytesRefAttribute, Cloneable, Serializable {
public class CharTermAttributeImpl extends AttributeImpl implements CharTermAttribute, TermToBytesRefAttribute, Cloneable {
private static int MIN_BUFFER_SIZE = 10;
private char[] termBuffer = new char[ArrayUtil.oversize(MIN_BUFFER_SIZE, RamUsageEstimator.NUM_BYTES_CHAR)];

View File

@ -17,8 +17,6 @@ package org.apache.lucene.analysis.tokenattributes;
* limitations under the License.
*/
import java.io.Serializable;
import org.apache.lucene.util.AttributeImpl;
/**
@ -26,7 +24,7 @@ import org.apache.lucene.util.AttributeImpl;
* eg from one TokenFilter to another one.
* @lucene.experimental While we think this is here to stay, we may want to change it to be a long.
*/
public class FlagsAttributeImpl extends AttributeImpl implements FlagsAttribute, Cloneable, Serializable {
public class FlagsAttributeImpl extends AttributeImpl implements FlagsAttribute, Cloneable {
private int flags = 0;
/**

View File

@ -17,14 +17,12 @@ package org.apache.lucene.analysis.tokenattributes;
* limitations under the License.
*/
import java.io.Serializable;
import org.apache.lucene.util.AttributeImpl;
/**
* The start and end character offset of a Token.
*/
public class OffsetAttributeImpl extends AttributeImpl implements OffsetAttribute, Cloneable, Serializable {
public class OffsetAttributeImpl extends AttributeImpl implements OffsetAttribute, Cloneable {
private int startOffset;
private int endOffset;

View File

@ -17,15 +17,13 @@ package org.apache.lucene.analysis.tokenattributes;
* limitations under the License.
*/
import java.io.Serializable;
import org.apache.lucene.index.Payload;
import org.apache.lucene.util.AttributeImpl;
/**
* The payload of a Token. See also {@link Payload}.
*/
public class PayloadAttributeImpl extends AttributeImpl implements PayloadAttribute, Cloneable, Serializable {
public class PayloadAttributeImpl extends AttributeImpl implements PayloadAttribute, Cloneable {
private Payload payload;
/**

View File

@ -17,8 +17,6 @@ package org.apache.lucene.analysis.tokenattributes;
* limitations under the License.
*/
import java.io.Serializable;
import org.apache.lucene.analysis.TokenStream;
import org.apache.lucene.util.AttributeImpl;
@ -46,7 +44,7 @@ import org.apache.lucene.util.AttributeImpl;
*
* </ul>
*/
public class PositionIncrementAttributeImpl extends AttributeImpl implements PositionIncrementAttribute, Cloneable, Serializable {
public class PositionIncrementAttributeImpl extends AttributeImpl implements PositionIncrementAttribute, Cloneable {
private int positionIncrement = 1;
/** Set the position increment. The default value is one.

View File

@ -17,14 +17,12 @@ package org.apache.lucene.analysis.tokenattributes;
* limitations under the License.
*/
import java.io.Serializable;
import org.apache.lucene.util.AttributeImpl;
/**
* A Token's lexical type. The Default value is "word".
*/
public class TypeAttributeImpl extends AttributeImpl implements TypeAttribute, Cloneable, Serializable {
public class TypeAttributeImpl extends AttributeImpl implements TypeAttribute, Cloneable {
private String type;
public TypeAttributeImpl() {

View File

@ -35,7 +35,7 @@ import org.apache.lucene.index.IndexReader; // for javadoc
* ScoreDoc#doc} or {@link IndexReader#document(int)}.
*/
public final class Document implements java.io.Serializable {
public final class Document {
List<Fieldable> fields = new ArrayList<Fieldable>();
private float boost = 1.0f;

View File

@ -18,7 +18,6 @@ package org.apache.lucene.document;
*/
import java.io.Reader;
import java.io.Serializable;
import org.apache.lucene.analysis.TokenStream;
import org.apache.lucene.index.IndexWriter;
@ -32,7 +31,7 @@ import org.apache.lucene.util.StringHelper;
index, so that they may be returned with hits on the document.
*/
public final class Field extends AbstractField implements Fieldable, Serializable {
public final class Field extends AbstractField implements Fieldable {
/** Specifies whether and how a field should be stored. */
public static enum Store {

View File

@ -1,6 +1,5 @@
package org.apache.lucene.document;
import java.io.Serializable;
/**
* Copyright 2004 The Apache Software Foundation
*
@ -22,7 +21,7 @@ import java.io.Serializable;
* what Fields get loaded on a {@link Document} by {@link org.apache.lucene.index.IndexReader#document(int,org.apache.lucene.document.FieldSelector)}
*
**/
public interface FieldSelector extends Serializable {
public interface FieldSelector {
/**
*

View File

@ -22,7 +22,6 @@ import org.apache.lucene.search.PhraseQuery; // for javadocs
import org.apache.lucene.search.spans.SpanQuery; // for javadocs
import java.io.Reader;
import java.io.Serializable;
/**
* Synonymous with {@link Field}.
@ -34,7 +33,7 @@ import java.io.Serializable;
* </p>
*
**/
public interface Fieldable extends Serializable {
public interface Fieldable {
/** Sets the boost factor hits on this field. This value will be
* multiplied into the score of all hits on this this field of this
* document.

View File

@ -17,8 +17,6 @@ package org.apache.lucene.index;
* limitations under the License.
*/
import java.io.Serializable;
import org.apache.lucene.analysis.TokenStream;
import org.apache.lucene.util.ArrayUtil;
@ -34,7 +32,7 @@ import org.apache.lucene.util.ArrayUtil;
* to retrieve the payloads from the index.<br>
*
*/
public class Payload implements Serializable, Cloneable {
public class Payload implements Cloneable {
/** the byte array containing the payload data */
protected byte[] data;

View File

@ -30,7 +30,7 @@ import org.apache.lucene.util.StringHelper;
Note that terms may represent more than words from text fields, but also
things like dates, email addresses, urls, etc. */
public final class Term implements Comparable<Term>, java.io.Serializable {
public final class Term implements Comparable<Term> {
String field;
BytesRef bytes;
@ -199,11 +199,4 @@ public final class Term implements Comparable<Term>, java.io.Serializable {
@Override
public final String toString() { return field + ":" + bytes.utf8ToString(); }
private void readObject(java.io.ObjectInputStream in)
throws java.io.IOException, ClassNotFoundException
{
in.defaultReadObject();
field = StringHelper.intern(field);
}
}

View File

@ -1,7 +1,5 @@
package org.apache.lucene.index;
import java.io.Serializable;
/**
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@ -24,7 +22,7 @@ import java.io.Serializable;
* offset information. This offset information is the character offset as set during the Analysis phase (and thus may not be the actual offset in the
* original content).
*/
public class TermVectorOffsetInfo implements Serializable {
public class TermVectorOffsetInfo {
/**
* Convenience declaration when creating a {@link org.apache.lucene.index.TermPositionVector} that stores only position information.
*/

View File

@ -17,14 +17,13 @@ package org.apache.lucene.messages;
* limitations under the License.
*/
import java.io.Serializable;
import java.util.Locale;
/**
* Message Interface for a lazy loading.
* For Native Language Support (NLS), system of software internationalization.
*/
public interface Message extends Serializable {
public interface Message {
public String getKey();

View File

@ -25,8 +25,6 @@ import java.util.Locale;
*/
public class MessageImpl implements Message {
private static final long serialVersionUID = -3077643314630884523L;
private String key;
private Object[] arguments = new Object[0];

View File

@ -18,7 +18,6 @@ package org.apache.lucene.search;
*/
import java.io.IOException;
import java.io.Serializable;
import org.apache.lucene.index.Term;
import org.apache.lucene.index.Terms;
@ -61,7 +60,7 @@ public class AutomatonQuery extends MultiTermQuery {
* in the ctor the query computes one of these, the actual
* implementation depends upon the automaton's structure.
*/
private abstract class TermsEnumFactory implements Serializable {
private abstract class TermsEnumFactory {
protected abstract TermsEnum getTermsEnum(Terms terms, AttributeSource atts) throws IOException;
}

View File

@ -18,7 +18,7 @@ package org.apache.lucene.search;
*/
/** A clause in a BooleanQuery. */
public class BooleanClause implements java.io.Serializable {
public class BooleanClause {
/** Specifies how clauses are to occur in matching documents. */
public static enum Occur {

View File

@ -17,7 +17,6 @@ package org.apache.lucene.search;
* limitations under the License.
*/
import java.io.Serializable;
import java.io.IOException;
import java.util.Map;
import java.util.WeakHashMap;
@ -68,7 +67,7 @@ public class CachingWrapperFilter extends Filter {
protected final FilterCache<DocIdSet> cache;
static abstract class FilterCache<T> implements Serializable {
static abstract class FilterCache<T> {
/**
* A transient Filter cache (package private because of test)

View File

@ -17,11 +17,10 @@ package org.apache.lucene.search;
* limitations under the License.
*/
import java.io.Serializable;
import java.util.ArrayList;
/** Expert: Describes the score computation for document and query. */
public class Explanation implements java.io.Serializable {
public class Explanation {
private float value; // the value of this node
private String description; // what it represents
private ArrayList<Explanation> details; // sub-explanations
@ -135,7 +134,7 @@ public class Explanation implements java.io.Serializable {
* before storing any large or un-serializable fields.
*
*/
public static abstract class IDFExplanation implements Serializable {
public static abstract class IDFExplanation {
/**
* @return the idf factor
*/

View File

@ -29,7 +29,6 @@ import org.apache.lucene.analysis.NumericTokenStream; // for javadocs
import org.apache.lucene.util.packed.PackedInts;
import java.io.IOException;
import java.io.Serializable;
import java.io.PrintStream;
import java.text.DecimalFormat;
@ -61,7 +60,7 @@ public interface FieldCache {
* is used to specify a custom parser to {@link
* SortField#SortField(String, FieldCache.Parser)}.
*/
public interface Parser extends Serializable {
public interface Parser {
}
/** Interface to parse bytes from document fields.

View File

@ -18,7 +18,6 @@ package org.apache.lucene.search;
*/
import java.io.IOException;
import java.io.Serializable;
/**
* Provides a {@link FieldComparator} for custom field sorting.
@ -26,7 +25,7 @@ import java.io.Serializable;
* @lucene.experimental
*
*/
public abstract class FieldComparatorSource implements Serializable {
public abstract class FieldComparatorSource {
/**
* Creates a comparator for the field in the given index.

View File

@ -27,7 +27,7 @@ import org.apache.lucene.util.DocIdBitSet;
* Abstract base class for restricting which documents may
* be returned during searching.
*/
public abstract class Filter implements java.io.Serializable {
public abstract class Filter {
/**
* Creates a {@link DocIdSet} enumerating the documents that should be

View File

@ -18,7 +18,6 @@ package org.apache.lucene.search;
*/
import java.io.IOException;
import java.io.Serializable;
import org.apache.lucene.index.IndexReader;
import org.apache.lucene.index.Term;
@ -67,7 +66,7 @@ public abstract class MultiTermQuery extends Query {
transient int numberOfTerms = 0;
/** Abstract class that defines how the query is rewritten. */
public static abstract class RewriteMethod implements Serializable {
public static abstract class RewriteMethod {
public abstract Query rewrite(IndexReader reader, MultiTermQuery query) throws IOException;
}
@ -90,11 +89,6 @@ public abstract class MultiTermQuery extends Query {
result.setBoost(query.getBoost());
return result;
}
// Make sure we are still a singleton even after deserializing
protected Object readResolve() {
return CONSTANT_SCORE_FILTER_REWRITE;
}
};
/** A rewrite method that first translates each term into
@ -240,11 +234,6 @@ public abstract class MultiTermQuery extends Query {
public void setDocCountPercent(double percent) {
throw new UnsupportedOperationException("Please create a private instance");
}
// Make sure we are still a singleton even after deserializing
protected Object readResolve() {
return CONSTANT_SCORE_AUTO_REWRITE_DEFAULT;
}
};
/**

View File

@ -44,7 +44,7 @@ import org.apache.lucene.index.Term;
<li>{@link org.apache.lucene.queryParser.QueryParser QueryParser}
</ul>
*/
public abstract class Query implements java.io.Serializable, Cloneable {
public abstract class Query implements Cloneable {
private float boost = 1.0f; // query boost factor
/** Sets the boost for this query clause to <code>b</code>. Documents

Some files were not shown because too many files have changed in this diff Show More