Buggy code:
public class ResultColumnList extends QueryTreeNodeVector { protected boolean indexRow ; protected long conglomerateId ; int orderBySelect = 0 ; protected boolean forUpdate ; private boolean countMismatchAllowed ; private int initialListSize = 0 ; public ResultColumnList ( ) { } public void addResultColumn ( ResultColumn resultColumn ) { } public void appendResultColumns ( ResultColumnList resultColumns , boolean destructiveCopy ) { } public ResultColumn getResultColumn ( int position ) { } public ResultColumn getOrderByColumn ( int position ) { } public ResultColumn getResultColumn ( String columnName ) { } public ResultColumn getResultColumn ( String columnsTableName , String columnName ) { } public ResultColumn getAtMostOneResultColumn ( ColumnReference cr , String exposedTableName ) throws StandardException { } public ResultColumn getOrderByColumn ( String columnName , TableName tableName , int tableNumber ) throws StandardException { } public ResultColumn getOrderByColumn ( String columnName , TableName tableName ) throws StandardException { } void copyResultColumnNames ( ResultColumnList nameList ) { } public void treePrint ( int depth ) { } public void bindExpressions ( FromList fromList , SubqueryList subqueryList , Vector aggregateVector ) throws StandardException { } public void bindResultColumnsToExpressions ( ) throws StandardException { } public void bindResultColumnsByName ( TableDescriptor targetTableDescriptor , DMLStatementNode statement ) throws StandardException { } public void bindResultColumnsByName ( ResultColumnList fullRCL , FromVTI targetVTI , DMLStatementNode statement ) throws StandardException { int size = size ( ) ; Hashtable ht = new Hashtable ( ( size + 2 ) , ( ( float ) ( 0.999 ) ) ) ; for ( int index = 0 ; index < size ; index ++ ) { ResultColumn matchRC ; ResultColumn rc = ( ( ResultColumn ) ( elementAt ( index ) ) ) ; String colName = rc . getName ( ) ; Object object = ht . put ( colName , colName ) ; if ( ( object != null ) && ( ( ( String ) ( object ) ) . equals ( colName ) ) ) { if ( SanityManager . DEBUG ) { SanityManager . ASSERT ( ( ( statement instanceof UpdateNode ) || ( statement instanceof InsertNode ) ) , "statement<seq2seq4repair_space>is<seq2seq4repair_space>expected<seq2seq4repair_space>to<seq2seq4repair_space>be<seq2seq4repair_space>instanceof<seq2seq4repair_space>UpdateNode<seq2seq4repair_space>or<seq2seq4repair_space>InsertNode" ) ; } if ( statement instanceof UpdateNode ) { throw StandardException . newException ( LANG_DUPLICATE_COLUMN_NAME_UPDATE , colName ) ; } else { throw StandardException . newException ( LANG_DUPLICATE_COLUMN_NAME_INSERT , colName ) ; } } matchRC = fullRCL . getResultColumn ( null , rc . getName ( ) ) ; if ( matchRC == null ) { throw StandardException . newException ( LANG_COLUMN_NOT_FOUND_IN_TABLE , rc . getName ( ) , targetVTI . getNewInvocation ( ) . getJavaClassName ( ) ) ; } <START_BUG> ColumnDescriptor cd = new ColumnDescriptor ( rc . getName ( ) , matchRC . getVirtualColumnId ( ) , matchRC . getType ( ) , null , null , ( ( TableDescriptor ) ( null ) ) , null , 0 , 0 , false ) ; <END_BUG> rc . setColumnDescriptor ( null , cd ) ; rc . setVirtualColumnId ( ( index + 1 ) ) ; } } public void bindResultColumnsByPosition ( TableDescriptor targetTableDescriptor ) throws StandardException { } public void preprocess ( int numTables , FromList outerFromList , SubqueryList outerSubqueryList , PredicateList outerPredicateList ) throws StandardException { } void checkStorableExpressions ( ResultColumnList toStore ) throws StandardException { } public int [ ] getStreamStorableColIds ( int heapColCount ) throws StandardException { } void checkStorableExpressions ( ) throws StandardException { } public void generate ( ActivationClassBuilder acb , MethodBuilder mb ) throws StandardException { } void generateNulls ( ActivationClassBuilder acb , MethodBuilder mb ) throws StandardException { } void generateCore ( ExpressionClassBuilder acb , MethodBuilder mb , boolean genNulls ) throws StandardException { } public ExecRow buildEmptyRow ( ) throws StandardException { } 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 ( ) { } ResultColumnDescriptor [ ] makeResultDescriptors ( ExecutionContext ec ) { } public void expandAllsAndNameColumns ( FromList fromList ) throws StandardException { } public void nameAllResultColumns ( ) throws StandardException { } public void copyTypesAndLengthsToSource ( ResultColumnList sourceRCL ) { } boolean columnTypesAndLengthsMatch ( ) throws StandardException { } boolean columnTypesAndLengthsMatch ( ResultColumnList otherRCL ) throws StandardException { } public boolean nopProjection ( ResultColumnList childRCL ) { } public ResultColumnList copyListAndObjects ( ) throws StandardException { } 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 void checkAutoincrementUnion ( ResultSetNode rs ) throws StandardException { } public boolean isExactTypeAndLengthMatch ( ResultColumnList otherRCL ) { } public boolean updateOverlaps ( int [ ] columns ) { } ResultColumn [ ] getSortedByPosition ( ) { } public int [ ] sortMe ( ) { } public ResultColumnList expandToAll ( TableDescriptor td , TableName tableName ) throws StandardException { }

Fix:
ColumnDescriptor cd = new ColumnDescriptor ( rc . getName ( ) , matchRC . getVirtualColumnId ( ) , matchRC . getType ( ) , null , null , ( ( TableDescriptor ) ( null ) ) , null , 0 , 0 ) ;