Buggy code:
private Object execute ( int operation , Object [ ] params ) { } private Object execute ( int operation , Map params ) { } public long deleteAll ( ) { } public long deleteAll ( Object [ ] params ) { } public long deleteAll ( Map params ) { } public long updateAll ( ) { } public long updateAll ( Object [ ] params ) { } public long updateAll ( Map params ) { } private boolean isInMemory ( int operation ) { } private Object execute ( StoreQuery q , StoreQuery . Executor ex , Object [ ] params ) throws Exception { } private Number delete ( StoreQuery q , StoreQuery . Executor ex , Object [ ] params ) throws Exception { } public Number deleteInMemory ( StoreQuery q , StoreQuery . Executor executor , Object [ ] params ) { } private Number update ( StoreQuery q , StoreQuery . Executor ex , Object [ ] params ) throws Exception { } public Number updateInMemory ( StoreQuery q , StoreQuery . Executor executor , Object [ ] params ) { } private void updateInMemory ( Object ob , Object [ ] params , StoreQuery q ) { } private void logExecution ( int op , LinkedMap types , Object [ ] params ) { } private void logExecution ( int op , Map params ) { } private boolean isLRS ( long start , long end ) { } protected Object toResult ( StoreQuery q , StoreQuery . Executor ex , ResultObjectProvider rop , StoreQuery . Range range ) throws Exception { } protected ResultList decorateResultList ( ResultList res ) { } private ResultPacker getResultPacker ( StoreQuery q , StoreQuery . Executor ex ) { } private Object emptyResult ( StoreQuery q , StoreQuery . Executor ex ) { } private Object singleResult ( ResultObjectProvider rop , StoreQuery . Range range ) throws Exception { } private boolean isAccessPathDirty ( ) { } public static boolean isAccessPathDirty ( Broker broker , ClassMetaData [ ] accessMetas ) { } public void closeAll ( ) { } public void closeResources ( ) { } private void closeResults ( boolean force ) { } public String [ ] getDataStoreActions ( Map params ) { } public boolean setQuery ( Object query ) { } public String getAlias ( ) { } public String [ ] getProjectionAliases ( ) { } public Class [ ] getProjectionTypes ( ) { } public int getOperation ( ) { } public boolean isAggregate ( ) { } public boolean hasGrouping ( ) { } public ClassMetaData [ ] getAccessPathMetaDatas ( ) { } public LinkedMap getParameterTypes ( ) { } public Map getUpdates ( ) { } public void lock ( ) { } public void unlock ( ) { } public synchronized void startLocking ( ) { } public synchronized void stopLocking ( ) { } public Class classForName ( String name , String [ ] imports ) { } private Class toClass ( String name ) { } public void assertOpen ( ) { } public void assertNotReadOnly ( ) { } public void assertNotSerialized ( ) { } private void assertCandidateType ( ) { } private void assertBulkModify ( StoreQuery q , StoreQuery . Executor ex , Object [ ] params ) { } protected void assertParameters ( StoreQuery q , StoreQuery . Executor ex , Object [ ] params ) { } protected void assertParameters ( StoreQuery q , StoreQuery . Executor ex , Map params ) { if ( ! ( q . requiresParameterDeclarations ( ) ) ) return ; LinkedMap paramTypes = ex . getParameterTypes ( q ) ; for ( Object actual : params . keySet ( ) ) { if ( ! ( paramTypes . containsKey ( actual ) ) ) throw new org . apache . openjpa . util . UserException ( QueryImpl . _loc . get ( "unbound-params" , actual , paramTypes . keySet ( ) ) ) ; } for ( Object expected : paramTypes . keySet ( ) ) { if ( ! ( params . containsKey ( expected ) ) ) <START_BUG> throw new org . apache . openjpa . util . UserException ( QueryImpl . _loc . get ( "unbound-params" , params . keySet ( ) ) ) ; <END_BUG> } Iterator itr = paramTypes . entrySet ( ) . iterator ( ) ; Map . Entry entry ; for ( int i = 0 ; itr . hasNext ( ) ; i ++ ) { entry = ( ( Map . Entry ) ( itr . next ( ) ) ) ; if ( ( ( ( Class ) ( entry . getValue ( ) ) ) . isPrimitive ( ) ) && ( ( params . get ( entry . getKey ( ) ) ) == null ) ) throw new org . apache . openjpa . util . UserException ( QueryImpl . _loc . get ( "null-primitive-param" , entry . getKey ( ) ) ) ; } } public String toString ( ) { } protected static class Compilation implements Serializable { public Executor memory = null ; public Executor datastore = null ; public Object storeData = null ; } private static class CompilationKey implements Serializable { public Class queryType = null ; public Class candidateType = null ; public boolean subclasses = true ; public String query = null ; public String language = null ; public Object storeKey = null ; public int hashCode ( ) { } public boolean equals ( Object other ) { } } private static class MergedExecutor implements StoreQuery . Executor { private final Executor [ ] _executors ; public MergedExecutor ( StoreQuery [ ] executors ) { } public QueryExpressions [ ] getQueryExpressions ( ) { } public ResultObjectProvider executeQuery ( StoreQuery q , Object [ ] params , StoreQuery . Range range ) { }

Fix:
throw new org . apache . openjpa . util . UserException ( QueryImpl . _loc . get ( "unbound-params" , expected , params . keySet ( ) ) ) ;