Program: 125108
Project: 125108
Buggy source:
/** 
 * run method in Runnable will execute this 
 */
public void executeInRunnable(IMetadataConnection metadataConnection,Object currentNode,DatabaseConnection dbconn){
  HBaseAdmin hAdmin=getAdmin(metadataConnection);
  Configuration config=null;
  MetadataTable metadataTable=null;
  TableNode columnNode=null;
  try {
    if (hAdmin != null) {
      config=hAdmin.getConfiguration();
    }
    if (currentNode instanceof TableNode) {
      columnNode=(TableNode)currentNode;
    }
    if (columnNode == null) {
      return;
    }
    TableNode columnFamilyNode=columnNode.getParent();
    TableNode tableNode=null;
    String tableName=null;
    String columnFamilyName=null;
    if (columnFamilyNode != null) {
      columnFamilyName=columnFamilyNode.getValue();
      tableNode=columnFamilyNode.getParent();
      if (tableNode != null) {
        tableName=tableNode.getValue();
        metadataTable=(MetadataTable)tableNode.getTable();
      }
    }
    if (columnNode != null && columnNode.getType() == TableNode.COLUMN) {
      org.apache.hadoop.hbase.client.Scan scan=new org.apache.hadoop.hbase.client.Scan();
      org.apache.hadoop.hbase.client.HTable table=new org.apache.hadoop.hbase.client.HTable(config,tableName);
      scan.addFamily(columnFamilyName.getBytes());
      ResultScanner resultSetscanner=table.getScanner(scan);
      while (resultSetscanner.iterator().hasNext()) {
        Result result=resultSetscanner.iterator().next();
        if (result != null) {
          List<KeyValue> list=result.list();
          if (list != null) {
            for (            KeyValue kv : list) {
              if (Bytes.toStringBinary(kv.getFamily()).equals(columnFamilyNode.getValue())) {
                String columnName=Bytes.toStringBinary(kv.getQualifier());
                if (columnName != null && columnName.equals(columnNode.getValue())) {
                  TdColumn column=RelationalFactory.eINSTANCE.createTdColumn();
                  column.setLabel(columnName);
                  column.setName(columnName);
                  column.setTalendType("String_Node_Str");
                  TaggedValue tv=TaggedValueHelper.createTaggedValue(COLUMN_FAMILY,columnFamilyName);
                  column.getTaggedValue().add(tv);
                  List<MetadataColumn> columns=metadataTable.getColumns();
                  columns.add(column);
                  List<Catalog> catalogs=ConnectionHelper.getCatalogs(dbconn);
                  Catalog catalogToWrite=null;
                  for (                  Catalog c : catalogs) {
                    if (c.getName() != null && c.getName().equals(getDefaultCatalogName())) {
                      catalogToWrite=c;
                      break;
                    }
                  }
                  if (catalogToWrite != null) {
                    boolean findTable=false;
                    List exsitTables=CatalogHelper.getTables(catalogToWrite);
                    for (                    Object obj : exsitTables) {
                      if (obj instanceof TdTable) {
                        TdTable tb=(TdTable)obj;
                        if (tableName != null && tb.getLabel().equals(tableName)) {
                          List<MetadataColumn> columnsExsit=tb.getColumns();
                          columnsExsit.add(column);
                          findTable=true;
                        }
                      }
                    }
                    if (!findTable) {
                      PackageHelper.addMetadataTable((MetadataTable)metadataTable,catalogToWrite);
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
 catch (  MasterNotRunningException e) {
    e.printStackTrace();
  }
catch (  ZooKeeperConnectionException e) {
    e.printStackTrace();
  }
catch (  IOException e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
/** 
 * run method in Runnable will execute this 
 */
@Override public void executeInRunnable(IMetadataConnection metadataConnection,Object currentNode,DatabaseConnection dbconn){
  HBaseAdmin hAdmin=getAdmin(metadataConnection);
  Configuration config=null;
  MetadataTable metadataTable=null;
  TableNode columnNode=null;
  try {
    if (hAdmin != null) {
      config=hAdmin.getConfiguration();
    }
    if (currentNode instanceof TableNode) {
      columnNode=(TableNode)currentNode;
    }
    if (columnNode == null) {
      return;
    }
    TableNode columnFamilyNode=columnNode.getParent();
    TableNode tableNode=null;
    String tableName=null;
    String columnFamilyName=null;
    if (columnFamilyNode != null) {
      columnFamilyName=columnFamilyNode.getValue();
      tableNode=columnFamilyNode.getParent();
      if (tableNode != null) {
        tableName=tableNode.getValue();
        metadataTable=(MetadataTable)tableNode.getTable();
      }
    }
    if (columnNode != null && columnNode.getType() == TableNode.COLUMN) {
      org.apache.hadoop.hbase.client.Scan scan=new org.apache.hadoop.hbase.client.Scan();
      org.apache.hadoop.hbase.client.HTable table=new org.apache.hadoop.hbase.client.HTable(config,tableName);
      scan.addFamily(columnFamilyName.getBytes());
      ResultScanner resultSetscanner=table.getScanner(scan);
      while (resultSetscanner.iterator().hasNext()) {
        Result result=resultSetscanner.iterator().next();
        if (result != null) {
          List<KeyValue> list=result.list();
          if (list != null) {
            for (            KeyValue kv : list) {
              if (Bytes.toStringBinary(kv.getFamily()).equals(columnFamilyNode.getValue())) {
                String columnName=Bytes.toStringBinary(kv.getQualifier());
                if (columnName != null && columnName.equals(columnNode.getValue())) {
                  TdColumn column=RelationalFactory.eINSTANCE.createTdColumn();
                  column.setLabel(columnName);
                  column.setName(columnName);
                  column.setTalendType("String_Node_Str");
                  TaggedValue tv=TaggedValueHelper.createTaggedValue(COLUMN_FAMILY,columnFamilyName);
                  column.getTaggedValue().add(tv);
                  List<MetadataColumn> columns=metadataTable.getColumns();
                  columns.add(column);
                  List<Catalog> catalogs=ConnectionHelper.getCatalogs(dbconn);
                  Catalog catalogToWrite=null;
                  for (                  Catalog c : catalogs) {
                    if (c.getName() != null && c.getName().equals(getDefaultCatalogName())) {
                      catalogToWrite=c;
                      break;
                    }
                  }
                  if (catalogToWrite != null) {
                    boolean findTable=false;
                    List exsitTables=CatalogHelper.getTables(catalogToWrite);
                    for (                    Object obj : exsitTables) {
                      if (obj instanceof TdTable) {
                        TdTable tb=(TdTable)obj;
                        if (tableName != null && tb.getLabel().equals(tableName)) {
                          List<MetadataColumn> columnsExsit=tb.getColumns();
                          columnsExsit.add(column);
                          findTable=true;
                        }
                      }
                    }
                    if (!findTable) {
                      PackageHelper.addMetadataTable(metadataTable,catalogToWrite);
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
 catch (  MasterNotRunningException e) {
    e.printStackTrace();
  }
catch (  ZooKeeperConnectionException e) {
    e.printStackTrace();
  }
catch (  IOException e) {
    e.printStackTrace();
  }
}