Apache Lucene open-source search software
LUCENE-4055: nuke clone
Robert Muir8e596ef6ea94
diff --git a/lucene/core/src/java/org/apache/lucene/index/SegmentInfo.java b/lucene/core/src/java/org/apache/lucene/index/SegmentInfo.javaindex fb80ac2e89d..4e46018fba5 100644--- a/lucene/core/src/java/org/apache/lucene/index/SegmentInfo.java+++ b/lucene/core/src/java/org/apache/lucene/index/SegmentInfo.java@@ -19,20 +19,13 @@ package org.apache.lucene.index;import java.io.IOException;-import java.util.ArrayList;import java.util.Collection;-import java.util.HashMap;-import java.util.HashSet;-import java.util.List;-import java.util.Map.Entry;import java.util.Map;import java.util.Set;-import java.util.regex.Pattern;import org.apache.lucene.codecs.Codec;import org.apache.lucene.store.Directory;import org.apache.lucene.store.TrackingDirectoryWrapper;-import org.apache.lucene.util.Constants;// nocommit fix codec api to pass this around so they can// store attrs@@ -46,7 +39,7 @@ import org.apache.lucene.util.Constants;* @lucene.experimental*/// nocommit make final again once atts are working here-public class SegmentInfo implements Cloneable {+public class SegmentInfo {// TODO: remove these from this class, for now this is the representationpublic static final int NO = -1; // e.g. no norms; no deletes;@@ -141,32 +134,6 @@ public class SegmentInfo implements Cloneable {sizeInBytes = -1;}- // nocommit nuke?- @Override- public SegmentInfo clone() {- final HashMap<Integer,Long> clonedNormGen;- if (normGen != null) {- clonedNormGen = new HashMap<Integer, Long>();- for (Entry<Integer,Long> entry : normGen.entrySet()) {- clonedNormGen.put(entry.getKey(), entry.getValue());- }- } else {- clonedNormGen = null;- }-- SegmentInfo newInfo = new SegmentInfo(dir, version, name, docCount, docStoreOffset,- docStoreSegment, docStoreIsCompoundFile, clonedNormGen, isCompoundFile,- codec, new HashMap<String,String>(diagnostics));- final Set<String> clonedFiles;- if (setFiles != null) {- clonedFiles = new HashSet<String>(setFiles);- } else {- clonedFiles = null;- }- newInfo.setFiles(clonedFiles);- return newInfo;- }-/*** @deprecated separate norms are not supported in >= 4.0*/