Lucene.Net.Store.MockIndexInputWrapper.Clone C# (CSharp) Method

Clone() public method

public Clone ( ) : object
return object
        public override object Clone()
        {
            EnsureOpen();
            Dir.InputCloneCount_Renamed.IncrementAndGet();
            IndexInput iiclone = (IndexInput)@delegate.Clone();
            MockIndexInputWrapper clone = new MockIndexInputWrapper(Dir, Name, iiclone);
            clone.IsClone = true;
            // Pending resolution on LUCENE-686 we may want to
            // uncomment this code so that we also track that all
            // clones get closed:
            /*
            synchronized(dir.openFiles) {
              if (dir.openFiles.containsKey(name)) {
                Integer v = (Integer) dir.openFiles.get(name);
                v = Integer.valueOf(v.intValue()+1);
                dir.openFiles.put(name, v);
              } else {
                throw new RuntimeException("BUG: cloned file was not open?");
              }
            }
            */
            return clone;
        }