mirror of https://github.com/apache/lucene.git
LUCENE-2000: clone() now returns covariant types where possible.
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1306626 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
ec18632428
commit
05fe168961
|
@ -257,6 +257,8 @@ Changes in backwards compatibility policy
|
|||
you can use SlowCompositeReaderWrapper to make all parallel readers atomic
|
||||
and use ParallelAtomicReader. (Uwe Schindler, Mike McCandless, Robert Muir)
|
||||
|
||||
* LUCENE-2000: clone() now returns covariant types where possible. (ryan)
|
||||
|
||||
Changes in Runtime Behavior
|
||||
|
||||
* LUCENE-2846: omitNorms now behaves like omitTermFrequencyAndPositions, if you
|
||||
|
|
|
@ -424,7 +424,7 @@ public class NativeUnixDirectory extends FSDirectory {
|
|||
}
|
||||
|
||||
@Override
|
||||
public Object clone() {
|
||||
public NativeUnixIndexInput clone() {
|
||||
try {
|
||||
return new NativeUnixIndexInput(this);
|
||||
} catch (IOException ioe) {
|
||||
|
|
|
@ -120,7 +120,7 @@ public class WindowsDirectory extends FSDirectory {
|
|||
}
|
||||
|
||||
@Override
|
||||
public Object clone() {
|
||||
public WindowsIndexInput clone() {
|
||||
WindowsIndexInput clone = (WindowsIndexInput)super.clone();
|
||||
clone.isClone = true;
|
||||
return clone;
|
||||
|
|
|
@ -366,7 +366,7 @@ public class Token extends CharTermAttributeImpl
|
|||
}
|
||||
|
||||
@Override
|
||||
public Object clone() {
|
||||
public Token clone() {
|
||||
Token t = (Token)super.clone();
|
||||
// Do a deep clone
|
||||
if (payload != null) {
|
||||
|
|
|
@ -208,7 +208,7 @@ public class CharTermAttributeImpl extends AttributeImpl implements CharTermAttr
|
|||
}
|
||||
|
||||
@Override
|
||||
public Object clone() {
|
||||
public CharTermAttributeImpl clone() {
|
||||
CharTermAttributeImpl t = (CharTermAttributeImpl)super.clone();
|
||||
// Do a deep clone
|
||||
t.termBuffer = new char[this.termLength];
|
||||
|
|
|
@ -58,7 +58,7 @@ public class PayloadAttributeImpl extends AttributeImpl implements PayloadAttrib
|
|||
}
|
||||
|
||||
@Override
|
||||
public Object clone() {
|
||||
public PayloadAttributeImpl clone() {
|
||||
PayloadAttributeImpl clone = (PayloadAttributeImpl) super.clone();
|
||||
if (payload != null) {
|
||||
clone.payload = (Payload) payload.clone();
|
||||
|
|
|
@ -95,7 +95,7 @@ public class BlockTermsReader extends FieldsProducer {
|
|||
}
|
||||
|
||||
@Override
|
||||
public Object clone() {
|
||||
public FieldAndTerm clone() {
|
||||
return new FieldAndTerm(this);
|
||||
}
|
||||
|
||||
|
|
|
@ -181,7 +181,7 @@ public abstract class FixedIntBlockIndexInput extends IntIndexInput {
|
|||
}
|
||||
|
||||
@Override
|
||||
public Object clone() {
|
||||
public Index clone() {
|
||||
Index other = new Index();
|
||||
other.fp = fp;
|
||||
other.upto = upto;
|
||||
|
|
|
@ -207,7 +207,7 @@ public abstract class VariableIntBlockIndexInput extends IntIndexInput {
|
|||
}
|
||||
|
||||
@Override
|
||||
public Object clone() {
|
||||
public Index clone() {
|
||||
Index other = new Index();
|
||||
other.fp = fp;
|
||||
other.upto = upto;
|
||||
|
|
|
@ -100,7 +100,7 @@ final class SegmentTermEnum implements Cloneable {
|
|||
}
|
||||
|
||||
@Override
|
||||
protected Object clone() {
|
||||
protected SegmentTermEnum clone() {
|
||||
SegmentTermEnum clone = null;
|
||||
try {
|
||||
clone = (SegmentTermEnum) super.clone();
|
||||
|
|
|
@ -111,7 +111,7 @@ final class TermBuffer implements Cloneable {
|
|||
}
|
||||
|
||||
@Override
|
||||
protected Object clone() {
|
||||
protected TermBuffer clone() {
|
||||
TermBuffer clone = null;
|
||||
try {
|
||||
clone = (TermBuffer)super.clone();
|
||||
|
|
|
@ -82,7 +82,7 @@ final class TermInfosReader {
|
|||
}
|
||||
|
||||
@Override
|
||||
public Object clone() {
|
||||
public CloneableTerm clone() {
|
||||
return new CloneableTerm(term);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -105,7 +105,7 @@ public class Lucene40PostingsReader extends PostingsReaderBase {
|
|||
byte[] bytes;
|
||||
|
||||
@Override
|
||||
public Object clone() {
|
||||
public StandardTermState clone() {
|
||||
StandardTermState other = new StandardTermState();
|
||||
other.copyFrom(this);
|
||||
return other;
|
||||
|
|
|
@ -73,7 +73,7 @@ public class PulsingPostingsReader extends PostingsReaderBase {
|
|||
private byte[] inlinedBytes;
|
||||
|
||||
@Override
|
||||
public Object clone() {
|
||||
public PulsingTermState clone() {
|
||||
PulsingTermState clone;
|
||||
clone = (PulsingTermState) super.clone();
|
||||
if (postingsSize != -1) {
|
||||
|
|
|
@ -47,7 +47,7 @@ public abstract class IntIndexInput implements Closeable {
|
|||
public abstract void set(Index other);
|
||||
|
||||
@Override
|
||||
public abstract Object clone();
|
||||
public abstract Index clone();
|
||||
}
|
||||
|
||||
public abstract static class Reader {
|
||||
|
|
|
@ -161,7 +161,7 @@ public class SepPostingsReader extends PostingsReaderBase {
|
|||
ByteArrayDataInput bytesReader;
|
||||
|
||||
@Override
|
||||
public Object clone() {
|
||||
public SepTermState clone() {
|
||||
SepTermState other = new SepTermState();
|
||||
other.copyFrom(this);
|
||||
return other;
|
||||
|
|
|
@ -87,7 +87,7 @@ public final class FieldInfo {
|
|||
}
|
||||
|
||||
@Override
|
||||
public Object clone() {
|
||||
public FieldInfo clone() {
|
||||
return new FieldInfo(name, isIndexed, number, storeTermVector,
|
||||
omitNorms, storePayloads, indexOptions, docValueType, normType);
|
||||
}
|
||||
|
|
|
@ -163,7 +163,7 @@ public final class FieldInfos implements Iterable<FieldInfo> {
|
|||
* Returns a deep clone of this FieldInfos instance.
|
||||
*/
|
||||
@Override
|
||||
synchronized public Object clone() {
|
||||
synchronized public FieldInfos clone() {
|
||||
FieldInfos fis = new FieldInfos(globalFieldNumbers);
|
||||
fis.hasFreq = hasFreq;
|
||||
fis.hasProx = hasProx;
|
||||
|
|
|
@ -185,11 +185,11 @@ public final class IndexWriterConfig implements Cloneable {
|
|||
}
|
||||
|
||||
@Override
|
||||
public Object clone() {
|
||||
public IndexWriterConfig clone() {
|
||||
// Shallow clone is the only thing that's possible, since parameters like
|
||||
// analyzer, index commit etc. do not implement Cloneable.
|
||||
try {
|
||||
return super.clone();
|
||||
return (IndexWriterConfig)super.clone();
|
||||
} catch (CloneNotSupportedException e) {
|
||||
// should not happen
|
||||
throw new RuntimeException(e);
|
||||
|
|
|
@ -155,7 +155,7 @@ public class Payload implements Cloneable {
|
|||
* byte array.
|
||||
*/
|
||||
@Override
|
||||
public Object clone() {
|
||||
public Payload clone() {
|
||||
try {
|
||||
// Start with a shallow copy of data
|
||||
Payload clone = (Payload) super.clone();
|
||||
|
|
|
@ -252,7 +252,7 @@ public final class SegmentInfo implements Cloneable {
|
|||
}
|
||||
|
||||
@Override
|
||||
public Object clone() {
|
||||
public SegmentInfo clone() {
|
||||
final SegmentInfo si = new SegmentInfo(name, docCount, dir, isCompoundFile, codec,
|
||||
fieldInfos == null ? null : (FieldInfos) fieldInfos.clone());
|
||||
si.docStoreOffset = docStoreOffset;
|
||||
|
|
|
@ -374,7 +374,7 @@ public final class SegmentInfos implements Cloneable, Iterable<SegmentInfo> {
|
|||
*/
|
||||
|
||||
@Override
|
||||
public Object clone() {
|
||||
public SegmentInfos clone() {
|
||||
try {
|
||||
final SegmentInfos sis = (SegmentInfos) super.clone();
|
||||
// deep clone, first recreate all collections:
|
||||
|
|
|
@ -36,9 +36,9 @@ public abstract class TermState implements Cloneable {
|
|||
public abstract void copyFrom(TermState other);
|
||||
|
||||
@Override
|
||||
public Object clone() {
|
||||
public TermState clone() {
|
||||
try {
|
||||
return super.clone();
|
||||
return (TermState)super.clone();
|
||||
} catch (CloneNotSupportedException cnse) {
|
||||
// should not happen
|
||||
throw new RuntimeException(cnse);
|
||||
|
|
|
@ -454,7 +454,7 @@ public class BooleanQuery extends Query implements Iterable<BooleanClause> {
|
|||
// The BooleanQuery clone is lazily initialized so only initialize
|
||||
// it if a rewritten clause differs from the original clause (and hasn't been
|
||||
// initialized already). If nothing differs, the clone isn't needlessly created
|
||||
clone = (BooleanQuery)this.clone();
|
||||
clone = this.clone();
|
||||
}
|
||||
clone.clauses.set(i, new BooleanClause(query, c.getOccur()));
|
||||
}
|
||||
|
@ -474,7 +474,7 @@ public class BooleanQuery extends Query implements Iterable<BooleanClause> {
|
|||
}
|
||||
|
||||
@Override @SuppressWarnings("unchecked")
|
||||
public Object clone() {
|
||||
public BooleanQuery clone() {
|
||||
BooleanQuery clone = (BooleanQuery)super.clone();
|
||||
clone.clauses = (ArrayList<BooleanClause>) this.clauses.clone();
|
||||
return clone;
|
||||
|
|
|
@ -200,7 +200,7 @@ public class DisjunctionMaxQuery extends Query implements Iterable<Query> {
|
|||
Query clause = disjuncts.get(i);
|
||||
Query rewrite = clause.rewrite(reader);
|
||||
if (rewrite != clause) {
|
||||
if (clone == null) clone = (DisjunctionMaxQuery)this.clone();
|
||||
if (clone == null) clone = this.clone();
|
||||
clone.disjuncts.set(i, rewrite);
|
||||
}
|
||||
}
|
||||
|
@ -211,7 +211,7 @@ public class DisjunctionMaxQuery extends Query implements Iterable<Query> {
|
|||
/** Create a shallow copy of us -- used in rewriting if necessary
|
||||
* @return a copy of us (but reuse, don't copy, our subqueries) */
|
||||
@Override @SuppressWarnings("unchecked")
|
||||
public Object clone() {
|
||||
public DisjunctionMaxQuery clone() {
|
||||
DisjunctionMaxQuery clone = (DisjunctionMaxQuery)super.clone();
|
||||
clone.disjuncts = (ArrayList<Query>) this.disjuncts.clone();
|
||||
return clone;
|
||||
|
|
|
@ -97,9 +97,9 @@ public abstract class Query implements Cloneable {
|
|||
|
||||
/** Returns a clone of this query. */
|
||||
@Override
|
||||
public Object clone() {
|
||||
public Query clone() {
|
||||
try {
|
||||
return super.clone();
|
||||
return (Query)super.clone();
|
||||
} catch (CloneNotSupportedException e) {
|
||||
throw new RuntimeException("Clone not supported: " + e.getMessage());
|
||||
}
|
||||
|
|
|
@ -76,7 +76,7 @@ public class PayloadNearQuery extends SpanNearQuery {
|
|||
}
|
||||
|
||||
@Override
|
||||
public Object clone() {
|
||||
public PayloadNearQuery clone() {
|
||||
int sz = clauses.size();
|
||||
SpanQuery[] newClauses = new SpanQuery[sz];
|
||||
|
||||
|
|
|
@ -61,7 +61,7 @@ public class SpanFirstQuery extends SpanPositionRangeQuery {
|
|||
}
|
||||
|
||||
@Override
|
||||
public Object clone() {
|
||||
public SpanFirstQuery clone() {
|
||||
SpanFirstQuery spanFirstQuery = new SpanFirstQuery((SpanQuery) match.clone(), end);
|
||||
spanFirstQuery.setBoost(getBoost());
|
||||
return spanFirstQuery;
|
||||
|
|
|
@ -88,7 +88,7 @@ public class SpanNearPayloadCheckQuery extends SpanPositionCheckQuery {
|
|||
}
|
||||
|
||||
@Override
|
||||
public Object clone() {
|
||||
public SpanNearPayloadCheckQuery clone() {
|
||||
SpanNearPayloadCheckQuery result = new SpanNearPayloadCheckQuery((SpanNearQuery) match.clone(), payloadToMatch);
|
||||
result.setBoost(getBoost());
|
||||
return result;
|
||||
|
|
|
@ -140,7 +140,7 @@ public class SpanNearQuery extends SpanQuery implements Cloneable {
|
|||
SpanQuery query = (SpanQuery) c.rewrite(reader);
|
||||
if (query != c) { // clause rewrote: must clone
|
||||
if (clone == null)
|
||||
clone = (SpanNearQuery) this.clone();
|
||||
clone = this.clone();
|
||||
clone.clauses.set(i,query);
|
||||
}
|
||||
}
|
||||
|
@ -152,7 +152,7 @@ public class SpanNearQuery extends SpanQuery implements Cloneable {
|
|||
}
|
||||
|
||||
@Override
|
||||
public Object clone() {
|
||||
public SpanNearQuery clone() {
|
||||
int sz = clauses.size();
|
||||
SpanQuery[] newClauses = new SpanQuery[sz];
|
||||
|
||||
|
|
|
@ -71,7 +71,7 @@ public class SpanNotQuery extends SpanQuery implements Cloneable {
|
|||
}
|
||||
|
||||
@Override
|
||||
public Object clone() {
|
||||
public SpanNotQuery clone() {
|
||||
SpanNotQuery spanNotQuery = new SpanNotQuery((SpanQuery)include.clone(),(SpanQuery) exclude.clone());
|
||||
spanNotQuery.setBoost(getBoost());
|
||||
return spanNotQuery;
|
||||
|
@ -175,12 +175,12 @@ public class SpanNotQuery extends SpanQuery implements Cloneable {
|
|||
|
||||
SpanQuery rewrittenInclude = (SpanQuery) include.rewrite(reader);
|
||||
if (rewrittenInclude != include) {
|
||||
clone = (SpanNotQuery) this.clone();
|
||||
clone = this.clone();
|
||||
clone.include = rewrittenInclude;
|
||||
}
|
||||
SpanQuery rewrittenExclude = (SpanQuery) exclude.rewrite(reader);
|
||||
if (rewrittenExclude != exclude) {
|
||||
if (clone == null) clone = (SpanNotQuery) this.clone();
|
||||
if (clone == null) clone = this.clone();
|
||||
clone.exclude = rewrittenExclude;
|
||||
}
|
||||
|
||||
|
|
|
@ -76,7 +76,7 @@ public class SpanOrQuery extends SpanQuery implements Cloneable {
|
|||
}
|
||||
|
||||
@Override
|
||||
public Object clone() {
|
||||
public SpanOrQuery clone() {
|
||||
int sz = clauses.size();
|
||||
SpanQuery[] newClauses = new SpanQuery[sz];
|
||||
|
||||
|
@ -96,7 +96,7 @@ public class SpanOrQuery extends SpanQuery implements Cloneable {
|
|||
SpanQuery query = (SpanQuery) c.rewrite(reader);
|
||||
if (query != c) { // clause rewrote: must clone
|
||||
if (clone == null)
|
||||
clone = (SpanOrQuery) this.clone();
|
||||
clone = this.clone();
|
||||
clone.clauses.set(i,query);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -90,7 +90,7 @@ public class SpanPayloadCheckQuery extends SpanPositionCheckQuery{
|
|||
}
|
||||
|
||||
@Override
|
||||
public Object clone() {
|
||||
public SpanPayloadCheckQuery clone() {
|
||||
SpanPayloadCheckQuery result = new SpanPayloadCheckQuery((SpanQuery) match.clone(), payloadToMatch);
|
||||
result.setBoost(getBoost());
|
||||
return result;
|
||||
|
|
|
@ -77,7 +77,7 @@ public class SpanPositionRangeQuery extends SpanPositionCheckQuery {
|
|||
}
|
||||
|
||||
@Override
|
||||
public Object clone() {
|
||||
public SpanPositionRangeQuery clone() {
|
||||
SpanPositionRangeQuery result = new SpanPositionRangeQuery((SpanQuery) match.clone(), start, end);
|
||||
result.setBoost(getBoost());
|
||||
return result;
|
||||
|
|
|
@ -306,7 +306,7 @@ public abstract class BufferedIndexInput extends IndexInput {
|
|||
protected abstract void seekInternal(long pos) throws IOException;
|
||||
|
||||
@Override
|
||||
public Object clone() {
|
||||
public BufferedIndexInput clone() {
|
||||
BufferedIndexInput clone = (BufferedIndexInput)super.clone();
|
||||
|
||||
clone.buffer = null;
|
||||
|
|
|
@ -184,7 +184,7 @@ public abstract class DataInput implements Cloneable {
|
|||
* were cloned from.
|
||||
*/
|
||||
@Override
|
||||
public Object clone() {
|
||||
public DataInput clone() {
|
||||
DataInput clone = null;
|
||||
try {
|
||||
clone = (DataInput)super.clone();
|
||||
|
|
|
@ -284,7 +284,7 @@ public abstract class Directory implements Closeable {
|
|||
}
|
||||
|
||||
@Override
|
||||
public Object clone() {
|
||||
public SlicedIndexInput clone() {
|
||||
SlicedIndexInput clone = (SlicedIndexInput)super.clone();
|
||||
clone.base = (IndexInput)base.clone();
|
||||
clone.fileOffset = fileOffset;
|
||||
|
|
|
@ -412,7 +412,7 @@ public class MMapDirectory extends FSDirectory {
|
|||
}
|
||||
|
||||
@Override
|
||||
public Object clone() {
|
||||
public MMapIndexInput clone() {
|
||||
if (buffers == null) {
|
||||
throw new AlreadyClosedException("MMapIndexInput already closed: " + this);
|
||||
}
|
||||
|
|
|
@ -193,7 +193,7 @@ public class SimpleFSDirectory extends FSDirectory {
|
|||
}
|
||||
|
||||
@Override
|
||||
public Object clone() {
|
||||
public SimpleFSIndexInput clone() {
|
||||
SimpleFSIndexInput clone = (SimpleFSIndexInput)super.clone();
|
||||
clone.isClone = true;
|
||||
return clone;
|
||||
|
|
|
@ -123,10 +123,10 @@ public abstract class AttributeImpl implements Cloneable, Attribute {
|
|||
* need to clone any members deeply,
|
||||
*/
|
||||
@Override
|
||||
public Object clone() {
|
||||
Object clone = null;
|
||||
public AttributeImpl clone() {
|
||||
AttributeImpl clone = null;
|
||||
try {
|
||||
clone = super.clone();
|
||||
clone = (AttributeImpl)super.clone();
|
||||
} catch (CloneNotSupportedException e) {
|
||||
throw new RuntimeException(e); // shouldn't happen
|
||||
}
|
||||
|
|
|
@ -101,12 +101,12 @@ public class AttributeSource {
|
|||
State next;
|
||||
|
||||
@Override
|
||||
public Object clone() {
|
||||
public State clone() {
|
||||
State clone = new State();
|
||||
clone.attribute = (AttributeImpl) attribute.clone();
|
||||
clone.attribute = attribute.clone();
|
||||
|
||||
if (next != null) {
|
||||
clone.next = (State) next.clone();
|
||||
clone.next = next.clone();
|
||||
}
|
||||
|
||||
return clone;
|
||||
|
|
|
@ -47,7 +47,7 @@ final public class DoubleBarrelLRUCache<K extends DoubleBarrelLRUCache.Cloneable
|
|||
/** Object providing clone(); the key class must subclass this. */
|
||||
public static abstract class CloneableKey {
|
||||
@Override
|
||||
abstract public Object clone();
|
||||
abstract public CloneableKey clone();
|
||||
}
|
||||
|
||||
private final Map<K,V> cache1;
|
||||
|
|
|
@ -389,7 +389,7 @@ public final class FixedBitSet extends DocIdSet implements Bits {
|
|||
}
|
||||
|
||||
@Override
|
||||
public Object clone() {
|
||||
public FixedBitSet clone() {
|
||||
return new FixedBitSet(this);
|
||||
}
|
||||
|
||||
|
|
|
@ -731,7 +731,7 @@ public class OpenBitSet extends DocIdSet implements Bits, Cloneable {
|
|||
}
|
||||
|
||||
@Override
|
||||
public Object clone() {
|
||||
public OpenBitSet clone() {
|
||||
try {
|
||||
OpenBitSet obs = (OpenBitSet)super.clone();
|
||||
obs.bits = obs.bits.clone(); // hopefully an array clone is as fast(er) than arraycopy
|
||||
|
|
|
@ -415,7 +415,7 @@ public final class PagedBytes {
|
|||
}
|
||||
|
||||
@Override
|
||||
public Object clone() {
|
||||
public PagedBytesDataInput clone() {
|
||||
PagedBytesDataInput clone = getDataInput();
|
||||
clone.setPosition(getPosition());
|
||||
return clone;
|
||||
|
|
|
@ -117,7 +117,7 @@ public class Test2BTerms extends LuceneTestCase {
|
|||
}
|
||||
|
||||
@Override
|
||||
public Object clone() {
|
||||
public MyTermAttributeImpl clone() {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -183,7 +183,7 @@ public class TestFieldsReader extends LuceneTestCase {
|
|||
delegate.close();
|
||||
}
|
||||
@Override
|
||||
public Object clone() {
|
||||
public FaultyIndexInput clone() {
|
||||
return new FaultyIndexInput((IndexInput) delegate.clone());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -225,7 +225,7 @@ public class TestLazyProxSkipping extends LuceneTestCase {
|
|||
}
|
||||
|
||||
@Override
|
||||
public Object clone() {
|
||||
public SeeksCountingStream clone() {
|
||||
return new SeeksCountingStream((IndexInput) this.input.clone());
|
||||
}
|
||||
|
||||
|
|
|
@ -190,7 +190,7 @@ public class TestMultiLevelSkipList extends LuceneTestCase {
|
|||
}
|
||||
|
||||
@Override
|
||||
public Object clone() {
|
||||
public CountingStream clone() {
|
||||
return new CountingStream((IndexInput) this.input.clone());
|
||||
}
|
||||
|
||||
|
|
|
@ -156,7 +156,7 @@ public class TestDoubleBarrelLRUCache extends LuceneTestCase {
|
|||
}
|
||||
|
||||
@Override
|
||||
public Object clone() {
|
||||
public CloneableObject clone() {
|
||||
return new CloneableObject(value);
|
||||
}
|
||||
}
|
||||
|
@ -179,7 +179,7 @@ public class TestDoubleBarrelLRUCache extends LuceneTestCase {
|
|||
}
|
||||
|
||||
@Override
|
||||
public Object clone() {
|
||||
public CloneableInteger clone() {
|
||||
return new CloneableInteger(value);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -99,7 +99,7 @@ public class MockSingleIntIndexInput extends IntIndexInput {
|
|||
}
|
||||
|
||||
@Override
|
||||
public Object clone() {
|
||||
public Index clone() {
|
||||
Index other = new Index();
|
||||
other.fp = fp;
|
||||
return other;
|
||||
|
|
|
@ -65,7 +65,7 @@ public class MockIndexInputWrapper extends IndexInput {
|
|||
}
|
||||
|
||||
@Override
|
||||
public Object clone() {
|
||||
public MockIndexInputWrapper clone() {
|
||||
ensureOpen();
|
||||
dir.inputCloneCount.incrementAndGet();
|
||||
IndexInput iiclone = (IndexInput) delegate.clone();
|
||||
|
|
|
@ -80,7 +80,7 @@ public class CharVector implements Cloneable {
|
|||
}
|
||||
|
||||
@Override
|
||||
public Object clone() {
|
||||
public CharVector clone() {
|
||||
CharVector cv = new CharVector(array.clone(), blockSize);
|
||||
cv.n = this.n;
|
||||
return cv;
|
||||
|
|
|
@ -348,7 +348,7 @@ public class TernaryTree implements Cloneable {
|
|||
}
|
||||
|
||||
@Override
|
||||
public Object clone() {
|
||||
public TernaryTree clone() {
|
||||
TernaryTree t = new TernaryTree();
|
||||
t.lo = this.lo.clone();
|
||||
t.hi = this.hi.clone();
|
||||
|
@ -484,7 +484,7 @@ public class TernaryTree implements Cloneable {
|
|||
}
|
||||
|
||||
@Override
|
||||
public Object clone() {
|
||||
public Item clone() {
|
||||
return new Item(parent, child);
|
||||
}
|
||||
|
||||
|
|
|
@ -113,9 +113,9 @@ public abstract class CharArrayIterator implements CharacterIterator {
|
|||
}
|
||||
|
||||
@Override
|
||||
public Object clone() {
|
||||
public CharArrayIterator clone() {
|
||||
try {
|
||||
return super.clone();
|
||||
return (CharArrayIterator)super.clone();
|
||||
} catch (CloneNotSupportedException e) {
|
||||
// CharacterIterator does not allow you to throw CloneNotSupported
|
||||
throw new RuntimeException(e);
|
||||
|
|
|
@ -109,7 +109,7 @@ final class CharArrayIterator implements CharacterIterator {
|
|||
}
|
||||
|
||||
@Override
|
||||
public Object clone() {
|
||||
public CharArrayIterator clone() {
|
||||
CharArrayIterator clone = new CharArrayIterator();
|
||||
clone.setText(array, start, length);
|
||||
clone.index = index;
|
||||
|
|
|
@ -211,7 +211,7 @@ public class LaoBreakIterator extends BreakIterator {
|
|||
* @return The clone.
|
||||
*/
|
||||
@Override
|
||||
public Object clone() {
|
||||
public LaoBreakIterator clone() {
|
||||
LaoBreakIterator other = (LaoBreakIterator) super.clone();
|
||||
other.rules = (RuleBasedBreakIterator) rules.clone();
|
||||
other.verify = (RuleBasedBreakIterator) verify.clone();
|
||||
|
|
|
@ -83,7 +83,7 @@ public class MorphosyntacticTagAttributeImpl extends AttributeImpl
|
|||
((MorphosyntacticTagAttribute) target).setTag(this.tag);
|
||||
}
|
||||
|
||||
public Object clone() {
|
||||
public MorphosyntacticTagAttributeImpl clone() {
|
||||
MorphosyntacticTagAttributeImpl cloned = new MorphosyntacticTagAttributeImpl();
|
||||
cloned.tag = (tag == null ? null : tag.toString());
|
||||
return cloned;
|
||||
|
|
|
@ -208,7 +208,7 @@ public class TaskStats implements Cloneable {
|
|||
* @see java.lang.Object#clone()
|
||||
*/
|
||||
@Override
|
||||
public Object clone() throws CloneNotSupportedException {
|
||||
public TaskStats clone() throws CloneNotSupportedException {
|
||||
TaskStats c = (TaskStats) super.clone();
|
||||
if (c.countsByTime != null) {
|
||||
c.countsByTime = c.countsByTime.clone();
|
||||
|
|
|
@ -111,10 +111,10 @@ public abstract class PerfTask implements Cloneable {
|
|||
}
|
||||
|
||||
@Override
|
||||
protected Object clone() throws CloneNotSupportedException {
|
||||
protected PerfTask clone() throws CloneNotSupportedException {
|
||||
// tasks having non primitive data structures should override this.
|
||||
// otherwise parallel running of a task sequence might not run correctly.
|
||||
return super.clone();
|
||||
return (PerfTask)super.clone();
|
||||
}
|
||||
|
||||
public void close() throws Exception {
|
||||
|
|
|
@ -508,7 +508,7 @@ public class TaskSequence extends PerfTask {
|
|||
* @see java.lang.Object#clone()
|
||||
*/
|
||||
@Override
|
||||
protected Object clone() throws CloneNotSupportedException {
|
||||
protected TaskSequence clone() throws CloneNotSupportedException {
|
||||
TaskSequence res = (TaskSequence) super.clone();
|
||||
res.tasks = new ArrayList<PerfTask>();
|
||||
for (int i = 0; i < tasks.size(); i++) {
|
||||
|
|
|
@ -121,7 +121,7 @@ public final class CategoryAttributeImpl extends AttributeImpl implements
|
|||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public CategoryAttribute clone() {
|
||||
public CategoryAttributeImpl clone() {
|
||||
CategoryAttributeImpl ca = (CategoryAttributeImpl) super.clone();
|
||||
if (categoryPath != null) {
|
||||
ca.categoryPath = (CategoryPath) categoryPath.clone();
|
||||
|
|
|
@ -114,9 +114,9 @@ public abstract class FacetRequest implements Cloneable {
|
|||
}
|
||||
|
||||
@Override
|
||||
public Object clone() throws CloneNotSupportedException {
|
||||
public FacetRequest clone() throws CloneNotSupportedException {
|
||||
// Overridden to make it public
|
||||
return super.clone();
|
||||
return (FacetRequest)super.clone();
|
||||
}
|
||||
|
||||
public void setNumLabel(int numLabel) {
|
||||
|
|
|
@ -622,7 +622,7 @@ public class CategoryPath implements Serializable, Cloneable, Comparable<Categor
|
|||
}
|
||||
|
||||
@Override
|
||||
public Object clone() {
|
||||
public CategoryPath clone() {
|
||||
return new CategoryPath(this);
|
||||
}
|
||||
|
||||
|
|
|
@ -107,7 +107,7 @@ public class SlowRAMDirectory extends RAMDirectory {
|
|||
ii.readBytes(b, offset, len);
|
||||
}
|
||||
|
||||
@Override public Object clone() { return ii.clone(); }
|
||||
@Override public IndexInput clone() { return (IndexInput)ii.clone(); }
|
||||
@Override public void close() throws IOException { ii.close(); }
|
||||
@Override public boolean equals(Object o) { return ii.equals(o); }
|
||||
@Override public long getFilePointer() { return ii.getFilePointer(); }
|
||||
|
|
|
@ -335,7 +335,7 @@ public class ToChildBlockJoinQuery extends Query {
|
|||
}
|
||||
|
||||
@Override
|
||||
public Object clone() {
|
||||
public ToChildBlockJoinQuery clone() {
|
||||
return new ToChildBlockJoinQuery((Query) origParentQuery.clone(),
|
||||
parentsFilter,
|
||||
doScores);
|
||||
|
|
|
@ -450,7 +450,7 @@ public class ToParentBlockJoinQuery extends Query {
|
|||
}
|
||||
|
||||
@Override
|
||||
public Object clone() {
|
||||
public ToParentBlockJoinQuery clone() {
|
||||
return new ToParentBlockJoinQuery((Query) origChildQuery.clone(),
|
||||
parentsFilter,
|
||||
scoreMode);
|
||||
|
|
|
@ -114,7 +114,7 @@ public class CustomScoreQuery extends Query {
|
|||
|
||||
/*(non-Javadoc) @see org.apache.lucene.search.Query#clone() */
|
||||
@Override
|
||||
public Object clone() {
|
||||
public CustomScoreQuery clone() {
|
||||
CustomScoreQuery clone = (CustomScoreQuery)super.clone();
|
||||
clone.subQuery = (Query) subQuery.clone();
|
||||
clone.scoringQueries = new Query[scoringQueries.length];
|
||||
|
|
|
@ -131,7 +131,7 @@ public abstract class QueryNodeImpl implements QueryNode, Cloneable {
|
|||
}
|
||||
|
||||
@Override
|
||||
public Object clone() throws CloneNotSupportedException {
|
||||
public QueryNode clone() throws CloneNotSupportedException {
|
||||
return cloneTree();
|
||||
}
|
||||
|
||||
|
|
|
@ -74,7 +74,7 @@ abstract class RewriteQuery<SQ extends SrndQuery> extends Query {
|
|||
|
||||
/** @throws UnsupportedOperationException */
|
||||
@Override
|
||||
public Object clone() {
|
||||
public RewriteQuery clone() {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -62,9 +62,9 @@ public abstract class SrndQuery implements Cloneable {
|
|||
public boolean isFieldsSubQueryAcceptable() {return true;}
|
||||
|
||||
@Override
|
||||
public Object clone() {
|
||||
public SrndQuery clone() {
|
||||
try {
|
||||
return super.clone();
|
||||
return (SrndQuery)super.clone();
|
||||
} catch (CloneNotSupportedException cns) {
|
||||
throw new Error(cns);
|
||||
}
|
||||
|
|
|
@ -401,7 +401,7 @@ public class DateField extends PrimitiveFieldType {
|
|||
}
|
||||
|
||||
@Override
|
||||
public Object clone() {
|
||||
public DateFormat clone() {
|
||||
ISO8601CanonicalDateFormat c
|
||||
= (ISO8601CanonicalDateFormat) super.clone();
|
||||
c.millisParser = NumberFormat.getIntegerInstance(CANONICAL_LOCALE);
|
||||
|
|
|
@ -69,7 +69,7 @@ public class WrappedQuery extends ExtendedQueryBase {
|
|||
}
|
||||
|
||||
@Override
|
||||
public Object clone() {
|
||||
public WrappedQuery clone() {
|
||||
WrappedQuery newQ = (WrappedQuery)super.clone();
|
||||
newQ.q = (Query) q.clone();
|
||||
return newQ;
|
||||
|
|
Loading…
Reference in New Issue