Program: 129020
Project: 129020
Buggy source:
private void addNode(RepositoryNode parent,ERepositoryObjectType type,RepositoryNode recBinNode,IRepositoryViewObject repositoryObject){
  boolean isAvaliableInTOS=true;
  if (type == ERepositoryObjectType.METADATA_CONNECTIONS) {
    DatabaseConnection metadataConnection=(DatabaseConnection)((ConnectionItem)repositoryObject.getProperty().getItem()).getConnection();
    isAvaliableInTOS=EDatabaseTypeName.getTypeFromDbType(metadataConnection.getDatabaseType(),false) == null ? false : true;
  }
  RepositoryNode node=new RepositoryNode(repositoryObject,parent,ENodeType.REPOSITORY_ELEMENT);
  node.setProperties(EProperties.CONTENT_TYPE,type);
  node.setProperties(EProperties.LABEL,repositoryObject.getLabel());
  if ((repositoryObject.isDeleted() && parent.getObject() == null) || (repositoryObject.isDeleted() && !parent.getObject().isDeleted())) {
  }
 else {
    if (GlobalServiceRegister.getDefault().isServiceRegistered(IDesignerCoreService.class)) {
      IDesignerCoreService designerCoreService=(IDesignerCoreService)GlobalServiceRegister.getDefault().getService(IDesignerCoreService.class);
      if (designerCoreService != null) {
        for (        IRepositoryNode repositoryNode : parent.getChildren()) {
          if (repositoryNode.getObject() != null) {
            if (repositoryNode.getObject().getId().equals(repositoryObject.getId())) {
              Problem problem=new Problem();
              problem.setDescription(type.name() + "String_Node_Str" + repositoryNode.getObject().getLabel()+ "String_Node_Str"+ repositoryNode.getObject().getVersion()+ "String_Node_Str"+ repositoryObject.getLabel()+ "String_Node_Str"+ repositoryObject.getVersion()+ "String_Node_Str");
              problem.setStatus(ProblemStatus.WARNING);
              designerCoreService.addProblems(problem);
            }
          }
        }
      }
    }
    if (isAvaliableInTOS) {
      parent.getChildren().add(node);
    }
  }
  if (type == ERepositoryObjectType.METADATA_CONNECTIONS && isAvaliableInTOS) {
    DatabaseConnection metadataConnection=(DatabaseConnection)((ConnectionItem)repositoryObject.getProperty().getItem()).getConnection();
    createTables(recBinNode,node,repositoryObject,metadataConnection);
  }
  if (type == ERepositoryObjectType.METADATA_SAPCONNECTIONS) {
    SAPConnection metadataConnection=(SAPConnection)((ConnectionItem)repositoryObject.getProperty().getItem()).getConnection();
    createTables(recBinNode,node,repositoryObject,metadataConnection);
  }
  if (type == ERepositoryObjectType.METADATA_FILE_DELIMITED) {
    DelimitedFileConnection metadataConnection=(DelimitedFileConnection)((ConnectionItem)repositoryObject.getProperty().getItem()).getConnection();
    createTables(recBinNode,node,repositoryObject,metadataConnection);
  }
  if (type == ERepositoryObjectType.METADATA_FILE_POSITIONAL) {
    PositionalFileConnection metadataConnection=(PositionalFileConnection)((ConnectionItem)repositoryObject.getProperty().getItem()).getConnection();
    createTables(recBinNode,node,repositoryObject,metadataConnection);
  }
  if (type == ERepositoryObjectType.METADATA_FILE_REGEXP) {
    RegexpFileConnection metadataConnection=(RegexpFileConnection)((ConnectionItem)repositoryObject.getProperty().getItem()).getConnection();
    createTables(recBinNode,node,repositoryObject,metadataConnection);
  }
  if (type == ERepositoryObjectType.METADATA_FILE_XML) {
    XmlFileConnection metadataConnection=(XmlFileConnection)((ConnectionItem)repositoryObject.getProperty().getItem()).getConnection();
    createTables(recBinNode,node,repositoryObject,metadataConnection);
  }
  if (type == ERepositoryObjectType.METADATA_FILE_EXCEL) {
    FileExcelConnection metadataConnection=(FileExcelConnection)((ConnectionItem)repositoryObject.getProperty().getItem()).getConnection();
    createTables(recBinNode,node,repositoryObject,metadataConnection);
  }
  if (type == ERepositoryObjectType.METADATA_FILE_LDIF) {
    LdifFileConnection metadataConnection=(LdifFileConnection)((ConnectionItem)repositoryObject.getProperty().getItem()).getConnection();
    createTables(recBinNode,node,repositoryObject,metadataConnection);
  }
  if (type == ERepositoryObjectType.METADATA_LDAP_SCHEMA) {
    LDAPSchemaConnection metadataConnection=(LDAPSchemaConnection)((ConnectionItem)repositoryObject.getProperty().getItem()).getConnection();
    createTables(recBinNode,node,repositoryObject,metadataConnection);
  }
  if (type == ERepositoryObjectType.METADATA_GENERIC_SCHEMA) {
    GenericSchemaConnection genericSchemaConnection=(GenericSchemaConnection)((ConnectionItem)repositoryObject.getProperty().getItem()).getConnection();
    createTables(recBinNode,node,repositoryObject,genericSchemaConnection);
  }
  if (type == ERepositoryObjectType.METADATA_WSDL_SCHEMA) {
    WSDLSchemaConnection genericSchemaConnection=(WSDLSchemaConnection)((ConnectionItem)repositoryObject.getProperty().getItem()).getConnection();
    createTables(recBinNode,node,repositoryObject,genericSchemaConnection);
  }
  if (type == ERepositoryObjectType.METADATA_SALESFORCE_SCHEMA) {
    SalesforceSchemaConnection genericSchemaConnection=(SalesforceSchemaConnection)((ConnectionItem)repositoryObject.getProperty().getItem()).getConnection();
    createTables(recBinNode,node,repositoryObject,genericSchemaConnection);
  }
  if (type == ERepositoryObjectType.METADATA_FILE_EBCDIC) {
    EbcdicConnection ebcdicConnection=(EbcdicConnection)((ConnectionItem)repositoryObject.getProperty().getItem()).getConnection();
    createTables(recBinNode,node,repositoryObject,ebcdicConnection);
  }
  if (type == ERepositoryObjectType.METADATA_FILE_HL7) {
    HL7Connection hl7Connection=(HL7Connection)((ConnectionItem)repositoryObject.getProperty().getItem()).getConnection();
    createTables(recBinNode,node,repositoryObject,hl7Connection);
  }
  if (type == ERepositoryObjectType.METADATA_FILE_FTP) {
    FTPConnection ftpConnection=(FTPConnection)((ConnectionItem)repositoryObject.getProperty().getItem()).getConnection();
    createTables(recBinNode,node,repositoryObject,ftpConnection);
  }
  if (type == ERepositoryObjectType.METADATA_FILE_BRMS) {
    BRMSConnection brmsConnection=(BRMSConnection)((ConnectionItem)repositoryObject.getProperty().getItem()).getConnection();
    createTables(recBinNode,node,repositoryObject,brmsConnection);
  }
  if (type == ERepositoryObjectType.METADATA_MDMCONNECTION) {
    MDMConnection mdmConnection=(MDMConnection)((ConnectionItem)repositoryObject.getProperty().getItem()).getConnection();
    createTables(recBinNode,node,repositoryObject,mdmConnection);
  }
  if (type == ERepositoryObjectType.METADATA_EDIFACT) {
    EDIFACTConnection edifactConnection=(EDIFACTConnection)((ConnectionItem)repositoryObject.getProperty().getItem()).getConnection();
    createTables(recBinNode,node,repositoryObject,edifactConnection);
  }
  for (  IRepositoryContentHandler handler : RepositoryContentManager.getHandlers()) {
    handler.addNode(type,recBinNode,repositoryObject,node);
    if (handler.isCreateTableNode()) {
      Item item=repositoryObject.getProperty().getItem();
      if (item != null && item instanceof ConnectionItem) {
        createTables(recBinNode,node,repositoryObject,((ConnectionItem)item).getConnection());
      }
    }
  }
}

Fixed version (ground truth):
private void addNode(RepositoryNode parent,ERepositoryObjectType type,RepositoryNode recBinNode,IRepositoryViewObject repositoryObject){
  boolean isAvaliableInTOS=true;
  if (type == ERepositoryObjectType.METADATA_CONNECTIONS) {
    DatabaseConnection metadataConnection=(DatabaseConnection)((ConnectionItem)repositoryObject.getProperty().getItem()).getConnection();
    isAvaliableInTOS=EDatabaseTypeName.getTypeFromDbType(metadataConnection.getDatabaseType(),false) == null ? false : true;
  }
  RepositoryNode node=new RepositoryNode(repositoryObject,parent,ENodeType.REPOSITORY_ELEMENT);
  node.setProperties(EProperties.CONTENT_TYPE,type);
  node.setProperties(EProperties.LABEL,repositoryObject.getLabel());
  if ((repositoryObject.isDeleted() && parent.getObject() == null) || (repositoryObject.isDeleted() && !parent.getObject().isDeleted())) {
  }
 else {
    if (GlobalServiceRegister.getDefault().isServiceRegistered(IDesignerCoreService.class)) {
      IDesignerCoreService designerCoreService=(IDesignerCoreService)GlobalServiceRegister.getDefault().getService(IDesignerCoreService.class);
      if (designerCoreService != null) {
        for (        IRepositoryNode repositoryNode : parent.getChildren()) {
          if (repositoryNode.getObject() != null) {
            if (repositoryNode.getObject().getId().equals(repositoryObject.getId())) {
              Problem problem=new Problem();
              problem.setDescription(type.name() + "String_Node_Str" + repositoryNode.getObject().getLabel()+ "String_Node_Str"+ repositoryNode.getObject().getVersion()+ "String_Node_Str"+ repositoryObject.getLabel()+ "String_Node_Str"+ repositoryObject.getVersion()+ "String_Node_Str");
              problem.setStatus(ProblemStatus.WARNING);
              designerCoreService.addProblems(problem);
            }
          }
        }
      }
    }
    if (isAvaliableInTOS) {
      parent.getChildren().add(node);
    }
  }
  if (type == ERepositoryObjectType.METADATA_CONNECTIONS && isAvaliableInTOS) {
    DatabaseConnection metadataConnection=(DatabaseConnection)((ConnectionItem)repositoryObject.getProperty().getItem()).getConnection();
    createTables(recBinNode,node,repositoryObject,metadataConnection);
  }
  if (type == ERepositoryObjectType.METADATA_SAPCONNECTIONS) {
    SAPConnection metadataConnection=(SAPConnection)((ConnectionItem)repositoryObject.getProperty().getItem()).getConnection();
    createTables(recBinNode,node,repositoryObject,metadataConnection);
  }
  if (type == ERepositoryObjectType.METADATA_FILE_DELIMITED) {
    DelimitedFileConnection metadataConnection=(DelimitedFileConnection)((ConnectionItem)repositoryObject.getProperty().getItem()).getConnection();
    createTables(recBinNode,node,repositoryObject,metadataConnection);
  }
  if (type == ERepositoryObjectType.METADATA_FILE_POSITIONAL) {
    PositionalFileConnection metadataConnection=(PositionalFileConnection)((ConnectionItem)repositoryObject.getProperty().getItem()).getConnection();
    createTables(recBinNode,node,repositoryObject,metadataConnection);
  }
  if (type == ERepositoryObjectType.METADATA_FILE_REGEXP) {
    RegexpFileConnection metadataConnection=(RegexpFileConnection)((ConnectionItem)repositoryObject.getProperty().getItem()).getConnection();
    createTables(recBinNode,node,repositoryObject,metadataConnection);
  }
  if (type == ERepositoryObjectType.METADATA_FILE_XML) {
    XmlFileConnection metadataConnection=(XmlFileConnection)((ConnectionItem)repositoryObject.getProperty().getItem()).getConnection();
    createTables(recBinNode,node,repositoryObject,metadataConnection);
  }
  if (type == ERepositoryObjectType.METADATA_FILE_EXCEL) {
    FileExcelConnection metadataConnection=(FileExcelConnection)((ConnectionItem)repositoryObject.getProperty().getItem()).getConnection();
    createTables(recBinNode,node,repositoryObject,metadataConnection);
  }
  if (type == ERepositoryObjectType.METADATA_FILE_LDIF) {
    LdifFileConnection metadataConnection=(LdifFileConnection)((ConnectionItem)repositoryObject.getProperty().getItem()).getConnection();
    createTables(recBinNode,node,repositoryObject,metadataConnection);
  }
  if (type == ERepositoryObjectType.METADATA_LDAP_SCHEMA) {
    LDAPSchemaConnection metadataConnection=(LDAPSchemaConnection)((ConnectionItem)repositoryObject.getProperty().getItem()).getConnection();
    createTables(recBinNode,node,repositoryObject,metadataConnection);
  }
  if (type == ERepositoryObjectType.METADATA_GENERIC_SCHEMA) {
    GenericSchemaConnection genericSchemaConnection=(GenericSchemaConnection)((ConnectionItem)repositoryObject.getProperty().getItem()).getConnection();
    createTables(recBinNode,node,repositoryObject,genericSchemaConnection);
  }
  if (type == ERepositoryObjectType.METADATA_WSDL_SCHEMA) {
    WSDLSchemaConnection genericSchemaConnection=(WSDLSchemaConnection)((ConnectionItem)repositoryObject.getProperty().getItem()).getConnection();
    createTables(recBinNode,node,repositoryObject,genericSchemaConnection);
  }
  if (type == ERepositoryObjectType.METADATA_SALESFORCE_SCHEMA) {
    SalesforceSchemaConnection genericSchemaConnection=(SalesforceSchemaConnection)((ConnectionItem)repositoryObject.getProperty().getItem()).getConnection();
    createTables(recBinNode,node,repositoryObject,genericSchemaConnection);
  }
  if (type == ERepositoryObjectType.METADATA_FILE_EBCDIC) {
    EbcdicConnection ebcdicConnection=(EbcdicConnection)((ConnectionItem)repositoryObject.getProperty().getItem()).getConnection();
    createTables(recBinNode,node,repositoryObject,ebcdicConnection);
  }
  if (type == ERepositoryObjectType.METADATA_FILE_HL7) {
    HL7Connection hl7Connection=(HL7Connection)((ConnectionItem)repositoryObject.getProperty().getItem()).getConnection();
    createTables(recBinNode,node,repositoryObject,hl7Connection);
  }
  if (type == ERepositoryObjectType.METADATA_FILE_FTP) {
    FTPConnection ftpConnection=(FTPConnection)((ConnectionItem)repositoryObject.getProperty().getItem()).getConnection();
    createTables(recBinNode,node,repositoryObject,ftpConnection);
  }
  if (type == ERepositoryObjectType.METADATA_FILE_BRMS) {
    BRMSConnection brmsConnection=(BRMSConnection)((ConnectionItem)repositoryObject.getProperty().getItem()).getConnection();
    createTables(recBinNode,node,repositoryObject,brmsConnection);
  }
  if (type == ERepositoryObjectType.METADATA_MDMCONNECTION) {
    MDMConnection mdmConnection=(MDMConnection)((ConnectionItem)repositoryObject.getProperty().getItem()).getConnection();
    createTables(recBinNode,node,repositoryObject,mdmConnection);
  }
  if (type == ERepositoryObjectType.METADATA_EDIFACT) {
    EDIFACTConnection edifactConnection=(EDIFACTConnection)((ConnectionItem)repositoryObject.getProperty().getItem()).getConnection();
    createTables(recBinNode,node,repositoryObject,edifactConnection);
  }
  for (  IRepositoryContentHandler handler : RepositoryContentManager.getHandlers()) {
    handler.addNode(type,recBinNode,repositoryObject,node);
  }
}