Program: 146770
Project: 146770
Buggy source:
private void repairIndexStore(){
  log("String_Node_Str","String_Node_Str");
  RMS ix=null;
  if (index != null && index.getIndexStore() != null) {
    ix=index.getIndexStore();
  }
 else {
    try {
      ix=rmsFactory.getIndexRMS(indexStoreName(),false);
    }
 catch (    RecordStoreException rse) {
    }
  }
  byte[] storageInfo=null;
  byte[] indexData=null;
  if (ix != null) {
    try {
      storageInfo=ix.readRecord(STORAGE_INFO_REC_ID);
    }
 catch (    RuntimeException rse) {
    }
    try {
      indexData=ix.readRecord(ID_INDEX_REC_ID);
    }
 catch (    RuntimeException rse) {
    }
  }
  if (ix != null) {
    ix.close();
  }
  try {
    RecordStore.deleteRecordStore(indexStoreName());
  }
 catch (  RecordStoreNotFoundException rsnfe) {
  }
catch (  RecordStoreException e) {
    String message="String_Node_Str" + indexStoreName() + "String_Node_Str"+ e.getMessage();
    log("String_Node_Str",message);
    throw new RuntimeException(message);
  }
  this.initIndexStore();
  ix=index.getIndexStore();
  boolean infoRecordRecovered=false;
  if (storageInfo != null) {
    ix.updateRecord(STORAGE_INFO_REC_ID,storageInfo,true);
    infoRecordRecovered=true;
  }
  if (!infoRecordRecovered) {
    log("String_Node_Str",indexStoreName() + "String_Node_Str" + "String_Node_Str");
  }
 else {
    log("String_Node_Str","String_Node_Str");
  }
  ;
  boolean indexDataRecoverd=false;
  if (indexData != null) {
    ix.updateRecord(ID_INDEX_REC_ID,storageInfo,true);
    indexDataRecoverd=true;
  }
  if (!indexDataRecoverd) {
    log("String_Node_Str",indexStoreName() + "String_Node_Str" + "String_Node_Str");
  }
 else {
    log("String_Node_Str","String_Node_Str");
  }
  ;
  if (!infoRecordRecovered) {
    RMSStorageInfo info=(RMSStorageInfo)ix.readRecord(STORAGE_INFO_REC_ID,RMSStorageInfo.class);
    int stores=0;
    boolean failed=false;
    while (!failed) {
      try {
        RMS rms=rmsFactory.getDataRMS(dataStoreName(stores),false);
        stores++;
        rms.close();
      }
 catch (      RecordStoreException rse) {
        failed=true;
      }
    }
    info.numDataStores=stores;
    log("String_Node_Str",indexStoreName() + "String_Node_Str" + stores+ "String_Node_Str");
    if (!ix.updateRecord(STORAGE_INFO_REC_ID,ExtUtil.serialize(info),true)) {
    }
  }
  this.datastores=new RMS[0];
  getInfoRecord();
  for (int i=0; i < datastores.length; ++i) {
    log("String_Node_Str",indexStoreName() + "String_Node_Str" + i);
    this.getDataStore(i);
    datastores[i].ensureOpen();
    log("String_Node_Str",indexStoreName() + "String_Node_Str" + i+ "String_Node_Str");
  }
  this.repair(true);
}

Fixed version (ground truth):
private void repairIndexStore(){
  log("String_Node_Str","String_Node_Str");
  RMS ix=null;
  if (index != null && index.getIndexStore() != null) {
    ix=index.getIndexStore();
  }
 else {
    try {
      ix=rmsFactory.getIndexRMS(indexStoreName(),false);
    }
 catch (    RecordStoreException rse) {
    }
  }
  byte[] storageInfo=null;
  byte[] indexData=null;
  if (ix != null) {
    try {
      storageInfo=ix.readRecord(STORAGE_INFO_REC_ID);
    }
 catch (    RuntimeException rse) {
    }
    try {
      indexData=ix.readRecord(ID_INDEX_REC_ID);
    }
 catch (    RuntimeException rse) {
    }
  }
  if (ix != null) {
    ix.close();
  }
  try {
    RecordStore.deleteRecordStore(indexStoreName());
  }
 catch (  RecordStoreNotFoundException rsnfe) {
  }
catch (  RecordStoreException e) {
    String message="String_Node_Str" + indexStoreName() + "String_Node_Str"+ e.getMessage();
    log("String_Node_Str",message);
    throw new RuntimeException(message);
  }
  this.initIndexStore();
  ix=index.getIndexStore();
  boolean infoRecordRecovered=false;
  if (storageInfo != null) {
    ix.updateRecord(STORAGE_INFO_REC_ID,storageInfo,true);
    infoRecordRecovered=true;
  }
  if (!infoRecordRecovered) {
    log("String_Node_Str",indexStoreName() + "String_Node_Str" + "String_Node_Str");
  }
 else {
    log("String_Node_Str","String_Node_Str");
  }
  ;
  boolean indexDataRecoverd=false;
  if (indexData != null) {
    ix.updateRecord(ID_INDEX_REC_ID,indexData,true);
    indexDataRecoverd=true;
  }
  if (!indexDataRecoverd) {
    log("String_Node_Str",indexStoreName() + "String_Node_Str" + "String_Node_Str");
  }
 else {
    log("String_Node_Str","String_Node_Str");
  }
  ;
  if (!infoRecordRecovered) {
    RMSStorageInfo info=(RMSStorageInfo)ix.readRecord(STORAGE_INFO_REC_ID,RMSStorageInfo.class);
    int stores=0;
    boolean failed=false;
    while (!failed) {
      try {
        RMS rms=rmsFactory.getDataRMS(dataStoreName(stores),false);
        stores++;
        rms.close();
      }
 catch (      RecordStoreException rse) {
        failed=true;
      }
    }
    info.numDataStores=stores;
    log("String_Node_Str",indexStoreName() + "String_Node_Str" + stores+ "String_Node_Str");
    if (!ix.updateRecord(STORAGE_INFO_REC_ID,ExtUtil.serialize(info),true)) {
    }
  }
  this.datastores=new RMS[0];
  getInfoRecord();
  for (int i=0; i < datastores.length; ++i) {
    log("String_Node_Str",indexStoreName() + "String_Node_Str" + i);
    this.getDataStore(i);
    datastores[i].ensureOpen();
    log("String_Node_Str",indexStoreName() + "String_Node_Str" + i+ "String_Node_Str");
  }
  this.repair(true);
}