Program: 125043
Project: 125043
Buggy source:
/** 
 * run method in Runnable will execute this 
 */
@Override public void executeInRunnable(IMetadataConnection metadataConnection,Object currentNode,DatabaseConnection dbconn){
  Object hAdmin=getAdmin(metadataConnection);
  Object config=null;
  MetadataTable metadataTable=null;
  TableNode columnNode=null;
  ClassLoader oldClassLoaderLoader=Thread.currentThread().getContextClassLoader();
  try {
    Thread.currentThread().setContextClassLoader(classLoader);
    if (hAdmin != null) {
      config=ReflectionUtils.invokeMethod(hAdmin,"String_Node_Str",new Object[0]);
    }
    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) {
      Object scan=Class.forName("String_Node_Str",true,classLoader).newInstance();
      Object table=ReflectionUtils.newInstance("String_Node_Str",classLoader,new Object[]{config,tableName});
      ReflectionUtils.invokeMethod(scan,"String_Node_Str",new Object[]{columnFamilyName.getBytes()});
      List<String> columnNameExsit=new ArrayList<String>();
      Object resultSetscanner=ReflectionUtils.invokeMethod(table,"String_Node_Str",new Object[]{scan});
      Object result=ReflectionUtils.invokeMethod(resultSetscanner,"String_Node_Str",new Object[0]);
      while (result != null) {
        List<Object> list=(List<Object>)ReflectionUtils.invokeMethod(result,"String_Node_Str",new Object[0]);
        if (list != null) {
          for (          Object kv : list) {
            byte[] family=(byte[])ReflectionUtils.invokeMethod(kv,"String_Node_Str",new Object[0]);
            String familyName=(String)ReflectionUtils.invokeStaticMethod("String_Node_Str",classLoader,"String_Node_Str",new Object[]{family});
            if (familyName.equals(columnFamilyNode.getValue())) {
              byte[] qualifier=(byte[])ReflectionUtils.invokeMethod(kv,"String_Node_Str",new Object[0]);
              String columnName=(String)ReflectionUtils.invokeStaticMethod("String_Node_Str",classLoader,"String_Node_Str",new Object[]{qualifier});
              if (columnName != null && columnName.equals(columnNode.getValue()) && !columnNameExsit.contains(columnName)) {
                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);
                columnNameExsit.add(columnName);
                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);
                  }
                }
              }
            }
          }
        }
        result=ReflectionUtils.invokeMethod(resultSetscanner,"String_Node_Str",new Object[0]);
      }
    }
  }
 catch (  Exception e) {
    ExceptionHandler.process(e);
  }
 finally {
    Thread.currentThread().setContextClassLoader(oldClassLoaderLoader);
  }
}

Fixed version (ground truth):
/** 
 * run method in Runnable will execute this 
 */
@Override public void executeInRunnable(IMetadataConnection metadataConnection,Object currentNode,DatabaseConnection dbconn){
  Object hAdmin=getAdmin(metadataConnection);
  Object config=null;
  MetadataTable metadataTable=null;
  TableNode columnNode=null;
  ClassLoader oldClassLoaderLoader=Thread.currentThread().getContextClassLoader();
  try {
    Thread.currentThread().setContextClassLoader(classLoader);
    if (hAdmin != null) {
      config=ReflectionUtils.invokeMethod(hAdmin,"String_Node_Str",new Object[0]);
    }
    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) {
      Object scan=Class.forName("String_Node_Str",true,classLoader).newInstance();
      Object table=ReflectionUtils.newInstance("String_Node_Str",classLoader,new Object[]{config,tableName});
      ReflectionUtils.invokeMethod(scan,"String_Node_Str",new Object[]{columnFamilyName.getBytes()});
      List<String> columnNameExsit=new ArrayList<String>();
      Object resultSetscanner=ReflectionUtils.invokeMethod(table,"String_Node_Str",new Object[]{scan});
      Object result=ReflectionUtils.invokeMethod(resultSetscanner,"String_Node_Str",new Object[0]);
      while (result != null) {
        List<Object> list=(List<Object>)ReflectionUtils.invokeMethod(result,"String_Node_Str",new Object[0]);
        if (list != null) {
          for (          Object kv : list) {
            byte[] family=(byte[])ReflectionUtils.invokeMethod(kv,"String_Node_Str",new Object[0]);
            String familyName=(String)ReflectionUtils.invokeStaticMethod("String_Node_Str",classLoader,"String_Node_Str",new Object[]{family});
            if (familyName.equals(columnFamilyNode.getValue())) {
              byte[] qualifier=(byte[])ReflectionUtils.invokeMethod(kv,"String_Node_Str",new Object[0]);
              String columnName=(String)ReflectionUtils.invokeStaticMethod("String_Node_Str",classLoader,"String_Node_Str",new Object[]{qualifier});
              if (columnName != null && columnName.equals(columnNode.getValue()) && !columnNameExsit.contains(columnName)) {
                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);
                columnNameExsit.add(columnName);
                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) {
                    if (metadataTable.getId() == null) {
                      IProxyRepositoryFactory factory=ProxyRepositoryFactory.getInstance();
                      metadataTable.setId(factory.getNextId());
                    }
                    PackageHelper.addMetadataTable(metadataTable,catalogToWrite);
                  }
                }
              }
            }
          }
        }
        result=ReflectionUtils.invokeMethod(resultSetscanner,"String_Node_Str",new Object[0]);
      }
    }
  }
 catch (  Exception e) {
    ExceptionHandler.process(e);
  }
 finally {
    Thread.currentThread().setContextClassLoader(oldClassLoaderLoader);
  }
}