Buggy code:
public ExecRow buildEmptyIndexRow ( TableDescriptor td , ConglomerateDescriptor cd , StoreCostController scc , DataDictionary dd ) throws StandardException { } void generateHolder ( ExpressionClassBuilder acb , MethodBuilder mb ) throws StandardException { } void generateHolder ( ExpressionClassBuilder acb , MethodBuilder mb , FormatableBitSet referencedCols , FormatableBitSet propagatedCols ) throws StandardException { } MethodBuilder generateHolderMethod ( ExpressionClassBuilder acb , FormatableBitSet referencedCols , FormatableBitSet propagatedCols ) throws StandardException { } private void genCreateRow ( ExpressionClassBuilder acb , LocalField field , String rowAllocatorMethod , String rowAllocatorType , int numCols ) throws StandardException { } public ResultColumnDescriptor [ ] makeResultDescriptors ( ) { } public void expandAllsAndNameColumns ( FromList fromList ) throws StandardException { } public void nameAllResultColumns ( ) throws StandardException { } boolean columnTypesAndLengthsMatch ( ) throws StandardException { } boolean columnTypesAndLengthsMatch ( ResultColumnList otherRCL ) throws StandardException { } public boolean nopProjection ( ResultColumnList childRCL ) { } public ResultColumnList copyListAndObjects ( ) throws StandardException { } public void removeOrderByColumns ( ) { } public void genVirtualColumnNodes ( ResultSetNode sourceResultSet , ResultColumnList sourceResultColumnList ) throws StandardException { } public void genVirtualColumnNodes ( ResultSetNode sourceResultSet , ResultColumnList sourceResultColumnList , boolean markReferenced ) throws StandardException { } public void adjustVirtualColumnIds ( int adjust ) { } public void doProjection ( ) throws StandardException { } public String verifyUniqueNames ( boolean errForGenCols ) throws StandardException { } public void propagateDCLInfo ( ResultColumnList derivedRCL , String tableName ) throws StandardException { } void rejectParameters ( ) throws StandardException { } void rejectXMLValues ( ) throws StandardException { } public void setResultSetNumber ( int resultSetNumber ) { } public void setRedundant ( ) { } public void checkColumnUpdateability ( String [ ] ucl , String cursorName ) throws StandardException { } public void setUnionResultExpression ( ResultColumnList otherRCL , int tableNumber , int level , String operatorName ) throws StandardException { } public boolean isExactTypeAndLengthMatch ( ResultColumnList otherRCL ) throws StandardException { } public boolean updateOverlaps ( int [ ] columns ) { } ResultColumn [ ] getSortedByPosition ( ) { } public int [ ] sortMe ( ) { } public ResultColumnList expandToAll ( TableDescriptor td , TableName tableName ) throws StandardException { } public void bindUntypedNullsToResultColumns ( ResultColumnList bindingRCL ) throws StandardException { } void markUpdated ( ) { } void markUpdatableByCursor ( ) { } public void disablePrivilegeCollection ( ) { } public String verifyCreateConstraintColumnList ( TableElementList tel ) { } public void exportNames ( String [ ] columnNames ) { } public ResultColumn findParentResultColumn ( ResultColumn childRC ) { } void markUpdated ( ResultColumnList updateColumns ) { } void markColumnsInSelectListUpdatableByCursor ( Vector updateColumns ) { } private void commonCodeForUpdatableByCursor ( Vector updateColumns , boolean dealingWithSelectResultColumnList ) { } void markUpdatableByCursor ( Vector updateColumns ) { } boolean updatableByCursor ( int columnPosition ) { } public boolean isCloneable ( ) { } public void remapColumnReferencesToExpressions ( ) throws StandardException { } void setIndexRow ( long cid , boolean forUpdate ) { } public boolean hasConsistentTypeInfo ( ) throws StandardException { } public boolean containsAllResultColumn ( ) { } public int countReferencedColumns ( ) { } public void recordColumnReferences ( int [ ] idArray , int basis ) { } public int getPosition ( String name , int basis ) { } public void recordColumnReferences ( boolean [ ] colArray1 , JBitSet [ ] tableColMap , int tableNumber ) { } int allTopCRsFromSameTable ( ) { } public void clearColumnReferences ( ) { } public void copyReferencedColumnsToNewList ( ResultColumnList targetList ) { } public void copyColumnsToNewList ( ResultColumnList targetList , FormatableBitSet copyList ) { } public FormatableBitSet getColumnReferenceMap ( ) { } void pullVirtualIsReferenced ( ) { } public void clearTableNames ( ) { } protected void setCountMismatchAllowed ( boolean allowed ) { } protected boolean getCountMismatchAllowed ( ) { } public int getTotalColumnSize ( ) { } public void createListFromResultSetMetaData ( ResultSetMetaData rsmd , TableName tableName , String javaClassName ) throws StandardException { } public void addColumn ( TableName tableName , String columnName , DataTypeDescriptor dts ) throws StandardException { } public void addRCForRID ( ) throws StandardException { } public void markAllUnreferenced ( ) throws StandardException { } boolean allExpressionsAreColumns ( ResultSetNode sourceRS ) { } int [ ] mapSourceColumns ( ) { } public void setNullability ( boolean nullability ) throws StandardException { } FormatableBitSet getReferencedFormatableBitSet ( boolean positionedUpdate , boolean always , boolean onlyBCNs ) { } ResultColumnList compactColumns ( boolean positionedUpdate , boolean always ) throws StandardException { } void removeJoinColumns ( ResultColumnList joinColumns ) { } ResultColumnList getJoinColumns ( ResultColumnList joinColumns ) { } void resetVirtualColumnIds ( ) { } boolean reusableResult ( ) { } public int [ ] getColumnPositions ( TableDescriptor td ) throws StandardException { } public String [ ] getColumnNames ( ) { } void replaceDefaults ( TableDescriptor ttd , ResultColumnList tcl ) throws StandardException { } void checkForInvalidDefaults ( ) throws StandardException { } void verifyAllOrderable ( ) throws StandardException { } public void populate ( TableDescriptor table , int [ ] columnIDs ) throws StandardException { } private ResultColumn makeColumnFromName ( String columnName ) throws StandardException { } private ResultColumn makeColumnReferenceFromName ( TableName tableName , String columnName ) throws StandardException { ContextManager cm = getContextManager ( ) ; NodeFactory nodeFactory = getNodeFactory ( ) ; <START_BUG> ResultColumn rc = ( ( ResultColumn ) ( nodeFactory . getNode ( RESULT_COLUMN , null , nodeFactory . getNode ( COLUMN_REFERENCE , columnName , tableName , cm ) , cm ) ) ) ; <END_BUG> return rc ; } public void forbidOverrides ( ResultColumnList sourceRSRCL ) throws StandardException { } public void incOrderBySelect ( ) { } private void decOrderBySelect ( ) { } public int getOrderBySelect ( ) { } public void copyOrderBySelect ( ResultColumnList src ) { } protected void markInitialSize ( ) { } private int numGeneratedColumns ( ) { } int numGeneratedColumnsForGroupBy ( ) { } void removeGeneratedGroupingColumns ( ) { } public int visibleSize ( ) { } public boolean containsWindowFunctionResultColumn ( ) { } void removeWindowFunctionColumns ( ) { } }

Fix:
ResultColumn rc = ( ( ResultColumn ) ( nodeFactory . getNode ( RESULT_COLUMN , columnName , nodeFactory . getNode ( COLUMN_REFERENCE , columnName , tableName , cm ) , cm ) ) ) ;