Program: 160431
Project: 160431
Buggy source:
public void initInternalStructure(DatabaseSession databaseSession) throws BimserverLockConflictException, BimserverDatabaseException {
  RecordIterator recordIterator=keyValueStore.getRecordIterator(CLASS_LOOKUP_TABLE,databaseSession);
  try {
    Record record=recordIterator.next();
    while (record != null) {
      String packageAndClassName=BinUtils.byteArrayToString(record.getValue());
      String packageName=packageAndClassName.substring(0,packageAndClassName.indexOf("String_Node_Str"));
      String className=packageAndClassName.substring(packageAndClassName.indexOf("String_Node_Str") + 1);
      EClass eClass=(EClass)getEClassifier(packageName,className);
      boolean transactional=!(eClass.getEPackage() == Ifc2x3tc1Package.eINSTANCE || eClass.getEPackage() == Ifc4Package.eINSTANCE);
      keyValueStore.openTable(packageAndClassName,transactional);
      for (      EStructuralFeature eStructuralFeature : eClass.getEAllStructuralFeatures()) {
        if (eStructuralFeature.getEAnnotation("String_Node_Str") != null) {
          String indexTableName=eClass.getEPackage().getName() + "String_Node_Str" + eClass.getName()+ "String_Node_Str"+ eStructuralFeature.getName();
          try {
            keyValueStore.openIndexTable(indexTableName,transactional);
          }
 catch (          DatabaseNotFoundException e) {
          }
        }
      }
      Short cid=BinUtils.byteArrayToShort(record.getKey());
      classifiers.put(cid,eClass);
      record=recordIterator.next();
    }
  }
  finally {
    recordIterator.close();
  }
}

Fixed version (ground truth):
public void initInternalStructure(DatabaseSession databaseSession) throws BimserverLockConflictException, BimserverDatabaseException {
  RecordIterator recordIterator=keyValueStore.getRecordIterator(CLASS_LOOKUP_TABLE,databaseSession);
  try {
    Record record=recordIterator.next();
    while (record != null) {
      String packageAndClassName=BinUtils.byteArrayToString(record.getValue());
      String packageName=packageAndClassName.substring(0,packageAndClassName.indexOf("String_Node_Str"));
      String className=packageAndClassName.substring(packageAndClassName.indexOf("String_Node_Str") + 1);
      EClass eClass=(EClass)getEClassifier(packageName,className);
      boolean transactional=!(eClass.getEPackage() == Ifc2x3tc1Package.eINSTANCE || eClass.getEPackage() == Ifc4Package.eINSTANCE);
      keyValueStore.openTable(packageAndClassName,transactional);
      for (      EStructuralFeature eStructuralFeature : eClass.getEAllStructuralFeatures()) {
        if (eStructuralFeature.getEAnnotation("String_Node_Str") != null) {
          String indexTableName=eClass.getEPackage().getName() + "String_Node_Str" + eClass.getName()+ "String_Node_Str"+ eStructuralFeature.getName();
          try {
            keyValueStore.openIndexTable(indexTableName,transactional);
          }
 catch (          DatabaseNotFoundException e) {
          }
        }
      }
      Short cid=BinUtils.byteArrayToShort(record.getKey());
      cidToEclass[cid]=eClass;
      eClassToCid.put(eClass,cid);
      record=recordIterator.next();
    }
  }
  finally {
    recordIterator.close();
  }
}