Buggy code:
public class PreparedQueryImpl implements PreparedQuery { private static Localizer _loc = Localizer . forPackage ( PreparedQueryImpl . class ) ; private final String _id ; private String _sql ; private boolean _initialized ; private Class < ? > _candidate ; private boolean _subclasses ; private QueryExpressions [ ] _exps ; private Class < ? > [ ] _projTypes ; private Map < Object , int [ ] > _userParamPositions ; private Map < Integer , Object > _template ; private SelectImpl select ; public PreparedQueryImpl ( String id , Query compiled ) { } public PreparedQueryImpl ( String id , String sql , Query compiled ) { } public String getIdentifier ( ) { } public String getLanguage ( ) { } public String getOriginalQuery ( ) { } public String getTargetQuery ( ) { } void setTargetQuery ( String sql ) { } public boolean isInitialized ( ) { } public QueryExpressions [ ] getQueryExpressions ( ) { } public Class [ ] getProjectionTypes ( ) { } public void setInto ( Query q ) { } public Exclusion initialize ( Object result ) { } private Object [ ] extractSelectExecutor ( Object result ) { if ( ( result instanceof ResultList ) == false ) return new Object [ ] { null , PreparedQueryImpl . _loc . get ( "exclude-not-result" , _id ) } ; Object userObject = ( ( ResultList < ? > ) ( result ) ) . getUserObject ( ) ; if ( ( ( userObject == null ) || ( ! ( userObject . getClass ( ) . isArray ( ) ) ) ) || ( ( ( ( Object [ ] ) ( userObject ) ) . length ) != 2 ) ) return new Object [ ] { null , PreparedQueryImpl . _loc . get ( "exclude-no-user-object" , _id ) } ; Object provider = ( ( Object [ ] ) ( userObject ) ) [ 0 ] ; Object executor = ( ( Object [ ] ) ( userObject ) ) [ 1 ] ; if ( ( executor instanceof StoreQuery . Executor ) == false ) return new Object [ ] { null , PreparedQueryImpl . _loc . get ( "exclude-not-executor" , _id ) } ; _exps = ( ( StoreQuery . Executor ) ( executor ) ) . getQueryExpressions ( ) ; for ( int i = 0 ; i < ( _exps . length ) ; i ++ ) { QueryExpressions exp = _exps [ i ] ; <START_BUG> if ( exp . hasInExpression ) <END_BUG> return new Object [ ] { null , PreparedQueryImpl . _loc . get ( "exclude-in-expression" , _id ) } ; if ( isUsingExternalizedParameter ( exp ) ) { return new Object [ ] { null , PreparedQueryImpl . _loc . get ( "exclude-externalized-param" , _id ) } ; } } if ( ( _exps [ 0 ] . projections . length ) == 0 ) { _projTypes = StoreQuery . EMPTY_CLASSES ; } else { _projTypes = new Class [ _exps [ 0 ] . projections . length ] ; for ( int i = 0 ; i < ( _exps [ 0 ] . projections . length ) ; i ++ ) { _projTypes [ i ] = _exps [ 0 ] . projections [ i ] . getType ( ) ; } } if ( provider instanceof QueryImpl . PackingResultObjectProvider ) { provider = ( ( QueryImpl . PackingResultObjectProvider ) ( provider ) ) . getDelegate ( ) ; } if ( provider instanceof RangeResultObjectProvider ) { provider = ( ( RangeResultObjectProvider ) ( provider ) ) . getDelegate ( ) ; } if ( provider instanceof SelectResultObjectProvider ) { return new Object [ ] { ( ( SelectResultObjectProvider ) ( provider ) ) . getSelect ( ) , null } ; } return new Object [ ] { null , PreparedQueryImpl . _loc . get ( "exclude-not-select-rop" , _id , provider . getClass ( ) . getName ( ) ) } ; } private SelectImpl extractImplementation ( SelectExecutor selector ) { } private boolean isUsingExternalizedParameter ( QueryExpressions exp ) { } private boolean isPaginated ( ) { } private boolean isUsingFieldStrategy ( ) { } private boolean isUsingFieldStrategy ( QueryExpressions exp ) { } public Map < Integer , Object > reparametrize ( Map user , Broker broker ) { } private void setPersistenceCapableParameter ( Map < Integer , Object > result , Object pc , int [ ] indices , Broker broker ) { } private void setCollectionValuedParameter ( Map < Integer , Object > result , Collection values , int [ ] indices , Object param , Broker broker ) { } void setUserParameterPositions ( List list ) { } void setParameters ( List list ) { } SelectImpl getSelect ( ) { } public String toString ( ) { } }

Fix:
if ( exp . hasParameterizedInExpression )