text: public VariableGapTermsIndexWriter(SegmentWriteState state, IndexTermSelector policy){string indexFileName = IndexFileNames.SegmentFileName(state.SegmentInfo.Name, state.SegmentSuffix, TERMS_INDEX_EXTENSION);m_output = state.Directory.CreateOutput(indexFileName, state.Context);bool success = false;try{fieldInfos = state.FieldInfos;this.policy = policy;WriteHeader(m_output);success = true;}finally{if (!success){IOUtils.DisposeWhileHandlingException(m_output);}}}