public object Clone()
{
try
{
IndexWriterConfig clone = (IndexWriterConfig)this.MemberwiseClone();
clone.Writer = (SetOnce<IndexWriter>)Writer.Clone();
// Mostly shallow clone, but do a deepish clone of
// certain objects that have state that cannot be shared
// across IW instances:
clone.delPolicy = (IndexDeletionPolicy)delPolicy.Clone();
clone.flushPolicy = (FlushPolicy)flushPolicy.Clone();
clone.indexerThreadPool = (DocumentsWriterPerThreadPool)indexerThreadPool.Clone();
// we clone the infoStream because some impls might have state variables
// such as line numbers, message throughput, ...
clone.infoStream = (InfoStream)infoStream.Clone();
clone.mergePolicy = (MergePolicy)mergePolicy.Clone();
clone.mergeScheduler = (MergeScheduler)mergeScheduler.Clone();
return clone;
}
catch
{
// .NET port: no need to deal with checked exceptions here
throw;
}
}