Program: 126856
Project: 126856
Buggy source:
/** 
 * test fill columns for odbc teradata in method "fillColumns(ColumnSet colSet, DatabaseMetaData dbJDBCMetadata, List<String> columnFilter, String columnPattern)".
 * @param columnSet
 * @throws SQLException
 */
private void testFillColumnCommon_TeraOdbc(ColumnSet columnSet) throws SQLException {
  columnSet.setName("String_Node_Str");
  DatabaseMetaData dbJDBCMetadata=mock(DatabaseMetaData.class);
  List<String> columnFilter=new ArrayList<String>();
  Schema schema=mock(Schema.class);
  when(schema.getName()).thenReturn("String_Node_Str");
  PowerMockito.mockStatic(CatalogHelper.class);
  when(CatalogHelper.getParentCatalog(columnSet)).thenReturn(null);
  PowerMockito.mockStatic(SchemaHelper.class);
  when(SchemaHelper.getParentSchema(columnSet)).thenReturn(schema);
  stub(method(MetadataConnectionUtils.class,"String_Node_Str",DatabaseMetaData.class)).toReturn(false);
  stub(method(MetadataConnectionUtils.class,"String_Node_Str",DatabaseMetaData.class)).toReturn(false);
  PowerMockito.mockStatic(ConnectionUtils.class);
  when(ConnectionUtils.isOdbcTeradata(dbJDBCMetadata)).thenReturn(true);
  ResultSet rs=mock(ResultSet.class);
  when(rs.next()).thenReturn(true).thenReturn(true).thenReturn(false);
  when(rs.getString(GetColumn.COLUMN_NAME.name())).thenReturn("String_Node_Str").thenReturn("String_Node_Str");
  when(rs.getString(GetColumn.TYPE_NAME.name())).thenReturn("String_Node_Str");
  when(rs.getInt(GetColumn.NULLABLE.name())).thenReturn(0);
  when(rs.getInt(GetColumn.DATA_TYPE.name())).thenReturn(1);
  when(rs.getString(GetColumn.REMARKS.name())).thenReturn("String_Node_Str");
  when(rs.getString(GetColumn.IS_NULLABLE.name())).thenReturn("String_Node_Str");
  when(dbJDBCMetadata.getColumns(anyString(),anyString(),anyString(),anyString())).thenReturn(rs);
  PowerMockito.mockStatic(ConnectionHelper.class);
  when(ConnectionHelper.getConnection(columnSet)).thenReturn(dbConnection);
  stub(method(MetadataToolHelper.class,"String_Node_Str",String.class)).toReturn("String_Node_Str");
  PowerMockito.mockStatic(ColumnSetHelper.class);
  stub(method(ColumnSetHelper.class,"String_Node_Str")).toReturn(true);
  List<TdColumn> fillColumns=dBConnectionFillerImpl.fillColumns(columnSet,dbJDBCMetadata,columnFilter,null);
  assertNotNull(fillColumns);
  assertTrue(fillColumns.size() == 2);
  for (  TdColumn tdColumn : fillColumns) {
    assertEquals(tdColumn.getSqlDataType().getNumericPrecision(),0);
    assertEquals(tdColumn.getSqlDataType().getNumericPrecisionRadix(),0);
    assertEquals(tdColumn.getLength(),0);
    assertNull(null,tdColumn.getInitialValue().getBody());
  }
}

Fixed version (ground truth):
/** 
 * test fill columns for odbc teradata in method "fillColumns(ColumnSet colSet, DatabaseMetaData dbJDBCMetadata, List<String> columnFilter, String columnPattern)".
 * @param columnSet
 * @throws SQLException
 */
private void testFillColumnCommon_TeraOdbc(ColumnSet columnSet) throws SQLException {
  columnSet.setName("String_Node_Str");
  DatabaseMetaData dbJDBCMetadata=mock(DatabaseMetaData.class);
  List<String> columnFilter=new ArrayList<String>();
  Schema schema=mock(Schema.class);
  when(schema.getName()).thenReturn("String_Node_Str");
  PowerMockito.mockStatic(CatalogHelper.class);
  when(CatalogHelper.getParentCatalog(columnSet)).thenReturn(null);
  PowerMockito.mockStatic(SchemaHelper.class);
  when(SchemaHelper.getParentSchema(columnSet)).thenReturn(schema);
  stub(method(MetadataConnectionUtils.class,"String_Node_Str",DatabaseMetaData.class)).toReturn(false);
  stub(method(MetadataConnectionUtils.class,"String_Node_Str",DatabaseMetaData.class)).toReturn(false);
  stub(method(MetadataConnectionUtils.class,"String_Node_Str",DatabaseMetaData.class)).toReturn(true);
  PowerMockito.mockStatic(ConnectionUtils.class);
  when(ConnectionUtils.isOdbcTeradata(dbJDBCMetadata)).thenReturn(true);
  ResultSet rs=mock(ResultSet.class);
  when(rs.next()).thenReturn(true).thenReturn(true).thenReturn(false);
  when(rs.getString(GetColumn.COLUMN_NAME.name())).thenReturn("String_Node_Str").thenReturn("String_Node_Str");
  when(rs.getString(GetColumn.TYPE_NAME.name())).thenReturn("String_Node_Str");
  when(rs.getInt(GetColumn.NULLABLE.name())).thenReturn(0);
  when(rs.getInt(GetColumn.DATA_TYPE.name())).thenReturn(1);
  when(rs.getString(GetColumn.REMARKS.name())).thenReturn("String_Node_Str");
  when(rs.getString(GetColumn.IS_NULLABLE.name())).thenReturn("String_Node_Str");
  when(dbJDBCMetadata.getColumns(anyString(),anyString(),anyString(),anyString())).thenReturn(rs);
  PowerMockito.mockStatic(ConnectionHelper.class);
  when(ConnectionHelper.getConnection(columnSet)).thenReturn(dbConnection);
  stub(method(MetadataToolHelper.class,"String_Node_Str",String.class)).toReturn("String_Node_Str");
  PowerMockito.mockStatic(ColumnSetHelper.class);
  stub(method(ColumnSetHelper.class,"String_Node_Str")).toReturn(true);
  List<TdColumn> fillColumns=dBConnectionFillerImpl.fillColumns(columnSet,dbJDBCMetadata,columnFilter,null);
  assertNotNull(fillColumns);
  assertTrue(fillColumns.size() == 2);
  for (  TdColumn tdColumn : fillColumns) {
    assertEquals(tdColumn.getSqlDataType().getNumericPrecision(),0);
    assertEquals(tdColumn.getSqlDataType().getNumericPrecisionRadix(),0);
    assertEquals(tdColumn.getLength(),0);
    assertNull(null,tdColumn.getInitialValue().getBody());
  }
}