Program: 130101
Project: 130101
Buggy source:
/** 
 * createTable.
 * @param tableItem
 */
protected void createTable(TreeItem tableItem){
  String tableString=tableItem.getText(0);
  boolean checkConnectionIsDone=managerConnection.check(getIMetadataConnection(),true);
  if (!checkConnectionIsDone) {
    updateStatus(IStatus.WARNING,Messages.getString("String_Node_Str"));
    new ErrorDialogWidthDetailArea(getShell(),PID,Messages.getString("String_Node_Str"),managerConnection.getMessageException());
  }
 else {
    if (ExtractMetaDataFromDataBase.getTableTypeByTableName(tableString).equals(ETableTypes.TABLETYPE_TABLE.getName())) {
      dbtable=RelationalFactory.eINSTANCE.createTdTable();
    }
 else     if (ExtractMetaDataFromDataBase.getTableTypeByTableName(tableString).equals(ETableTypes.TABLETYPE_VIEW.getName())) {
      dbtable=RelationalFactory.eINSTANCE.createTdView();
    }
 else {
      dbtable=RelationalFactory.eINSTANCE.createTdTable();
    }
    dbtable.getTaggedValue().add(CoreFactory.eINSTANCE.createTaggedValue());
    List<TdColumn> metadataColumns=new ArrayList<TdColumn>();
    metadataColumns=ExtractMetaDataFromDataBase.returnMetadataColumnsFormTable(metadataconnection,tableItem.getText(0));
    tableItem.setText(2,"String_Node_Str" + metadataColumns.size());
    tableItem.setText(3,Messages.getString("String_Node_Str"));
    countSuccess++;
    IProxyRepositoryFactory factory=ProxyRepositoryFactory.getInstance();
    initExistingNames();
    String labelName=IndiceHelper.getIndexedLabel(tableString,existingNames);
    if (forTemplate) {
      labelName=MetadataToolHelper.validateValue(labelName);
    }
    dbtable.setLabel(labelName);
    dbtable.setSourceName(tableItem.getText(0));
    dbtable.setId(factory.getNextId());
    dbtable.setTableType(ExtractMetaDataFromDataBase.getTableTypeByTableName(tableString));
    List<MetadataColumn> metadataColumnsValid=new ArrayList<MetadataColumn>();
    Iterator iterate=metadataColumns.iterator();
    while (iterate.hasNext()) {
      MetadataColumn metadataColumn=(MetadataColumn)iterate.next();
      metadataColumnsValid.add(metadataColumn);
      dbtable.getColumns().add(metadataColumn);
    }
    if (!ConnectionHelper.getTables(getConnection()).contains(dbtable) && !limitTemplateTable(dbtable)) {
      Catalog c=(Catalog)ConnectionHelper.getPackage((getConnection().getSID()),getConnection(),Catalog.class);
      if (c != null) {
        PackageHelper.addMetadataTable(dbtable,c);
      }
 else {
        Schema s=(Schema)ConnectionHelper.getPackage((getConnection().getSID()),getConnection(),Schema.class);
        if (s != null) {
          PackageHelper.addMetadataTable(dbtable,s);
        }
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * createTable.
 * @param tableItem
 */
protected void createTable(TreeItem tableItem){
  String tableString=tableItem.getText(0);
  boolean checkConnectionIsDone=managerConnection.check(getIMetadataConnection(),true);
  if (!checkConnectionIsDone) {
    updateStatus(IStatus.WARNING,Messages.getString("String_Node_Str"));
    new ErrorDialogWidthDetailArea(getShell(),PID,Messages.getString("String_Node_Str"),managerConnection.getMessageException());
  }
 else {
    if (ExtractMetaDataFromDataBase.getTableTypeByTableName(tableString).equals(ETableTypes.TABLETYPE_TABLE.getName())) {
      dbtable=RelationalFactory.eINSTANCE.createTdTable();
    }
 else     if (ExtractMetaDataFromDataBase.getTableTypeByTableName(tableString).equals(ETableTypes.TABLETYPE_VIEW.getName())) {
      dbtable=RelationalFactory.eINSTANCE.createTdView();
    }
 else {
      dbtable=RelationalFactory.eINSTANCE.createTdTable();
    }
    dbtable.getTaggedValue().add(CoreFactory.eINSTANCE.createTaggedValue());
    List<TdColumn> metadataColumns=new ArrayList<TdColumn>();
    metadataColumns=ExtractMetaDataFromDataBase.returnMetadataColumnsFormTable(metadataconnection,tableItem.getText(0));
    tableItem.setText(2,"String_Node_Str" + metadataColumns.size());
    tableItem.setText(3,Messages.getString("String_Node_Str"));
    refreshColumnData((TableNode)tableItem.getData(),tableItem);
    countSuccess++;
    IProxyRepositoryFactory factory=ProxyRepositoryFactory.getInstance();
    initExistingNames();
    String labelName=IndiceHelper.getIndexedLabel(tableString,existingNames);
    if (forTemplate) {
      labelName=MetadataToolHelper.validateValue(labelName);
    }
    dbtable.setLabel(labelName);
    dbtable.setSourceName(tableItem.getText(0));
    dbtable.setId(factory.getNextId());
    dbtable.setTableType(ExtractMetaDataFromDataBase.getTableTypeByTableName(tableString));
    List<MetadataColumn> metadataColumnsValid=new ArrayList<MetadataColumn>();
    Iterator iterate=metadataColumns.iterator();
    while (iterate.hasNext()) {
      MetadataColumn metadataColumn=(MetadataColumn)iterate.next();
      metadataColumnsValid.add(metadataColumn);
      dbtable.getColumns().add(metadataColumn);
    }
    if (!ConnectionHelper.getTables(getConnection()).contains(dbtable) && !limitTemplateTable(dbtable)) {
      Catalog c=(Catalog)ConnectionHelper.getPackage((getConnection().getSID()),getConnection(),Catalog.class);
      if (c != null) {
        PackageHelper.addMetadataTable(dbtable,c);
      }
 else {
        Schema s=(Schema)ConnectionHelper.getPackage((getConnection().getSID()),getConnection(),Schema.class);
        if (s != null) {
          PackageHelper.addMetadataTable(dbtable,s);
        }
      }
    }
  }
}