Program: 131894
Project: 131894
Buggy source:
protected OClass getOrCreateClass(final String iClassName,final String iSuperClass){
  OClass cls;
  if (dbType == DB_TYPE.DOCUMENT) {
    final ODatabaseDocumentTx documentDatabase=pipeline.getDocumentDatabase();
    if (documentDatabase.getMetadata().getSchema().existsClass(iClassName))     cls=documentDatabase.getMetadata().getSchema().getClass(iClassName);
 else {
      if (iSuperClass != null) {
        final OClass superClass=documentDatabase.getMetadata().getSchema().getClass(iSuperClass);
        if (superClass == null)         throw new OLoaderException("String_Node_Str" + iSuperClass + "String_Node_Str");
        cls=documentDatabase.getMetadata().getSchema().createClass(iClassName,superClass);
        log(OETLProcessor.LOG_LEVELS.DEBUG,"String_Node_Str",iClassName,iSuperClass);
      }
 else {
        cls=documentDatabase.getMetadata().getSchema().createClass(iClassName);
        log(OETLProcessor.LOG_LEVELS.DEBUG,"String_Node_Str",iClassName);
      }
    }
  }
 else {
    final OrientBaseGraph graphDatabase=pipeline.getGraphDatabase();
    cls=graphDatabase.getVertexType(iClassName);
    if (cls == null) {
      if (iSuperClass != null) {
        final OClass superClass=graphDatabase.getRawGraph().getMetadata().getSchema().getClass(iSuperClass);
        if (superClass == null)         throw new OLoaderException("String_Node_Str" + iSuperClass + "String_Node_Str");
        if (graphDatabase.getVertexBaseType().isSuperClassOf(superClass)) {
          cls=graphDatabase.createVertexType(iClassName,superClass);
          log(OETLProcessor.LOG_LEVELS.DEBUG,"String_Node_Str",iClassName,iSuperClass);
        }
 else {
          cls=graphDatabase.createEdgeType(iClassName,superClass);
          log(OETLProcessor.LOG_LEVELS.DEBUG,"String_Node_Str",iClassName,iSuperClass);
        }
      }
 else {
        cls=graphDatabase.createVertexType(iClassName);
        log(OETLProcessor.LOG_LEVELS.DEBUG,"String_Node_Str",iClassName);
      }
    }
  }
  return cls;
}

Fixed version (ground truth):
protected OClass getOrCreateClass(final String iClassName,final String iSuperClass){
  OClass cls;
  if (dbType == DB_TYPE.DOCUMENT) {
    final ODatabaseDocumentTx documentDatabase=pipeline.getDocumentDatabase();
    if (documentDatabase.getMetadata().getSchema().existsClass(iClassName))     cls=documentDatabase.getMetadata().getSchema().getClass(iClassName);
 else {
      if (iSuperClass != null) {
        final OClass superClass=documentDatabase.getMetadata().getSchema().getClass(iSuperClass);
        if (superClass == null)         throw new OLoaderException("String_Node_Str" + iSuperClass + "String_Node_Str");
        cls=documentDatabase.getMetadata().getSchema().createClass(iClassName,superClass);
        log(OETLProcessor.LOG_LEVELS.DEBUG,"String_Node_Str",iClassName,iSuperClass);
      }
 else {
        cls=documentDatabase.getMetadata().getSchema().createClass(iClassName);
        log(OETLProcessor.LOG_LEVELS.DEBUG,"String_Node_Str",iClassName);
      }
    }
  }
 else {
    final OrientBaseGraph graphDatabase=pipeline.getGraphDatabase();
    cls=graphDatabase.getRawGraph().getMetadata().getSchema().getClass(iClassName);
    if (cls == null) {
      if (iSuperClass != null) {
        final OClass superClass=graphDatabase.getRawGraph().getMetadata().getSchema().getClass(iSuperClass);
        if (superClass == null)         throw new OLoaderException("String_Node_Str" + iSuperClass + "String_Node_Str");
        if (graphDatabase.getVertexBaseType().isSuperClassOf(superClass)) {
          cls=graphDatabase.createVertexType(iClassName,superClass);
          log(OETLProcessor.LOG_LEVELS.DEBUG,"String_Node_Str",iClassName,iSuperClass);
        }
 else {
          cls=graphDatabase.createEdgeType(iClassName,superClass);
          log(OETLProcessor.LOG_LEVELS.DEBUG,"String_Node_Str",iClassName,iSuperClass);
        }
      }
 else {
        cls=graphDatabase.createVertexType(iClassName);
        log(OETLProcessor.LOG_LEVELS.DEBUG,"String_Node_Str",iClassName);
      }
    }
  }
  return cls;
}