Buggy code:
public boolean isKey ( ) { } public boolean isXPath ( ) { } public String getXPath ( ) { } public String getPCPathString ( ) { } public ClassMapping getClassMapping ( ExpState state ) { } public FieldMapping getFieldMapping ( ExpState state ) { } public Column [ ] getColumns ( ExpState state ) { } private Column [ ] calculateColumns ( PCPath . PathExpState pstate ) { } public boolean isVariable ( ) { } public void get ( FieldMetaData field , boolean nullTraversal ) { } public void get ( FieldMetaData fmd , XMLMetaData meta ) { } public void get ( XMLMetaData meta , String name ) { } public XMLMetaData getXmlMapping ( ) { } public synchronized void getKey ( ) { } private void checkObjectPathInheritanceTypeJoined ( PCPath . PathExpState pstate ) { } public FieldMetaData last ( ) { } private PCPath . Action lastFieldAction ( ) { } public Class getType ( ) { } public void setImplicitType ( Class type ) { } public ExpState initialize ( Select sel , ExpContext ctx , int flags ) { } private String findSubqAlias ( Select sel ) { } private boolean navigateFromParentRootInSubselect ( Select sel ) { } private static boolean isJoinedField ( FieldMapping src , boolean key , FieldMapping target ) { } protected Object eval ( Object candidate , Object orig , StoreContext ctx , Object [ ] params ) { } public static class PathExpState extends ExpState { public FieldMapping field = null ; public FieldMapping cmpfield = null ; public Column [ ] cols = null ; public boolean joinedRel = false ; public boolean isEmbedElementColl = false ; public PathExpState ( Joins joins ) { } } private ClassMapping traverseField ( PCPath . PathExpState pstate , boolean key , boolean forceOuter , boolean last ) { } private void joinRelation ( PCPath . PathExpState pstate , boolean key , boolean forceOuter , boolean traverse ) { } public Object toDataStoreValue ( Select sel , ExpContext ctx , ExpState state , Object val ) { } public void select ( Select sel , ExpContext ctx , ExpState state , boolean pks ) { } public void selectColumns ( Select sel , ExpContext ctx , ExpState state , boolean pks ) { } public void groupBy ( Select sel , ExpContext ctx , ExpState state ) { } public void orderBy ( Select sel , ExpContext ctx , ExpState state , boolean asc ) { } public Object load ( ExpContext ctx , ExpState state , Result res ) throws SQLException { } Object load ( ExpContext ctx , ExpState state , Result res , boolean pks ) throws SQLException { } private void validateMapStrategy ( Strategy strategy ) { } private void selectEmbeddedMapKey ( Select sel , ExpContext ctx , ExpState state ) { } private Object loadEmbeddedMapKey ( ExpContext ctx , ExpState state , Result res ) throws SQLException { } public void calculateValue ( Select sel , ExpContext ctx , ExpState state , Val other , ExpState otherState ) { } public void verifyIndexedField ( ) { } public int length ( Select sel , ExpContext ctx , ExpState state ) { } public void appendTo ( Select sel , ExpContext ctx , ExpState state , SQLBuffer sql ) { } public void appendTo ( Select sel , ExpContext ctx , ExpState state , SQLBuffer sql , int index ) { } public void appendTo ( Select sel , ExpState state , SQLBuffer sql , Column col ) { } public void appendIsEmpty ( Select sel , ExpContext ctx , ExpState state , SQLBuffer sql ) { } public void appendIsNotEmpty ( Select sel , ExpContext ctx , ExpState state , SQLBuffer sql ) { } public void appendIndex ( Select sel , ExpContext ctx , ExpState state , SQLBuffer sql ) { } public void appendType ( Select sel , ExpContext ctx , ExpState state , SQLBuffer sql ) { Discriminator disc = null ; ClassMapping sup = _class ; while ( ( sup . getMappedPCSuperclassMapping ( ) ) != null ) sup = sup . getMappedPCSuperclassMapping ( ) ; disc = sup . getDiscriminator ( ) ; Column [ ] cols = null ; if ( disc != null ) cols = disc . getColumns ( ) ; else cols = getColumns ( state ) ; <START_BUG> if ( cols == null ) { <END_BUG> sql . append ( "1" ) ; return ; } for ( int i = 0 ; i < ( cols . length ) ; i ++ ) { if ( i > 0 ) sql . append ( ",<seq2seq4repair_space>" ) ; sql . append ( sel . getColumnAlias ( cols [ i ] , state . joins ) ) ; } } public void appendSize ( Select sel , ExpContext ctx , ExpState state , SQLBuffer sql ) { } public void appendIsNull ( Select sel , ExpContext ctx , ExpState state , SQLBuffer sql ) { } public void appendIsNotNull ( Select sel , ExpContext ctx , ExpState state , SQLBuffer sql ) { } public boolean isSubqueryPath ( ) { } public int hashCode ( ) { } public boolean equals ( Object other ) { } public int getId ( ) { } private static class Action implements Serializable { public static final int GET = 0 ; public static final int GET_OUTER = 1 ; public static final int GET_KEY = 2 ; public static final int VAR = 3 ; public static final int SUBQUERY = 4 ; public static final int UNBOUND_VAR = 5 ; public static final int CAST = 6 ; public static final int GET_XPATH = 7 ; public int op = - 1 ; public Object data = null ; public String var = null ; public Context context = null ; public String toString ( ) { } public int hashCode ( ) { }

Fix:
if ( ( cols == null ) || ( ( cols . length ) == 0 ) ) {