Buggy code:
public Class getResultClass ( ) { } public OpenJPAQuery < X > setResultClass ( Class cls ) { } public boolean hasSubclasses ( ) { } public OpenJPAQuery < X > setSubclasses ( boolean subs ) { } public int getFirstResult ( ) { } public OpenJPAQuery < X > setFirstResult ( int startPosition ) { } public int getMaxResults ( ) { } public OpenJPAQuery < X > setMaxResults ( int max ) { } public OpenJPAQuery < X > compile ( ) { } Map < Object , Object > getParameterValues ( ) { } private Object execute ( ) { } public List getResultList ( ) { } public X getSingleResult ( ) { } public int executeUpdate ( ) { } private static int asInt ( long l ) { } public FlushModeType getFlushMode ( ) { } public OpenJPAQuery < X > setFlushMode ( FlushModeType flushMode ) { } public boolean isNative ( ) { } void assertJPQLOrCriteriaQuery ( ) { } public OpenJPAQuery < X > closeAll ( ) { } public String [ ] getDataStoreActions ( Map params ) { } public LockModeType getLockMode ( ) { } public TypedQuery < X > setLockMode ( LockModeType lockMode ) { } public int hashCode ( ) { } public boolean equals ( Object other ) { } public Map < String , Object > getHints ( ) { } public OpenJPAQuery < X > setHint ( String key , Object value ) { } public Set < String > getSupportedHints ( ) { } public < T > T unwrap ( Class < T > cls ) { } private boolean preExecute ( Map params ) { } private boolean postExecute ( Object result ) { } boolean invalidatePreparedQuery ( ) { } void ignorePreparedQuery ( ) { } QueryImpl setId ( String id ) { } void lock ( ) { } void unlock ( ) { } public OpenJPAQuery < X > setParameter ( int pos , Object value ) { } public OpenJPAQuery < X > setParameter ( int position , Calendar value , TemporalType t ) { } public OpenJPAQuery < X > setParameter ( int position , Date value , TemporalType type ) { } Object convertTemporalType ( Date value , TemporalType type ) { } Object convertTemporalType ( Calendar value , TemporalType type ) { } public boolean hasPositionalParameters ( ) { } public Object [ ] getPositionalParameters ( ) { } int calculateMaxKey ( Set < Integer > p ) { } public OpenJPAQuery < X > setParameters ( Object ... params ) { } void clearBinding ( ) { } public Map < String , Object > getNamedParameters ( ) { } public OpenJPAQuery < X > setParameters ( Map params ) { } public < T > Parameter < T > getParameter ( String name , Class < T > type ) { } public < T > Parameter < T > getParameter ( int pos , Class < T > type ) { } public < T > T getParameterValue ( Parameter < T > p ) { } public Set < Parameter < ? > > getParameters ( ) { } public < T > OpenJPAQuery < X > setParameter ( Parameter < T > p , T arg1 ) { } public OpenJPAQuery < X > setParameter ( Parameter < Date > p , Date date , TemporalType type ) { } public TypedQuery < X > setParameter ( Parameter < Calendar > p , Calendar cal , TemporalType type ) { } public Parameter < ? > getParameter ( String name ) { } public Parameter < ? > getParameter ( int pos ) { } public Object getParameterValue ( String name ) { } public Object getParameterValue ( int pos ) { } public Set < ? > getBoundParameterKeys ( ) { } public Set < ? > getDeclaredParameterKeys ( ) { } public < T > Set < T > getDeclaredParameterKeys ( Class < T > keyType ) { } public Map < Object , Parameter < ? > > getDeclaredParameters ( ) { if ( ( _declaredParams ) == null ) { _declaredParams = new HashMap < Object , Parameter < ? > > ( ) ; <START_BUG> OrderedMap < Object , Class < ? > > paramTypes = _query . getParameterTypes ( ) ; <END_BUG> for ( Object key : paramTypes . keySet ( ) ) { Parameter < ? > param = null ; Class < ? > expectedValueType = paramTypes . get ( key ) ; if ( key instanceof Integer ) { param = new ParameterImpl ( ( ( Integer ) ( key ) ) , expectedValueType ) ; } else if ( key instanceof String ) { param = new ParameterImpl ( ( ( String ) ( key ) ) , expectedValueType ) ; } else if ( key instanceof Parameter ) { param = ( ( Parameter < ? > ) ( key ) ) ; } else { throw new IllegalArgumentException ( ( ( "parameter<seq2seq4repair_space>identifier<seq2seq4repair_space>" + key ) + "<seq2seq4repair_space>unrecognized" ) ) ; } declareParameter ( key , param ) ; } } return _declaredParams ; } public void declareParameter ( Object key , Parameter < ? > param ) { } public boolean isBound ( Parameter < ? > param ) { } void assertBound ( Parameter < ? > param ) { } void bindValue ( Parameter < ? > param , Object value ) { } public OpenJPAQuery < X > setParameter ( String name , Calendar value , TemporalType type ) { } public OpenJPAQuery < X > setParameter ( String name , Date value , TemporalType type ) { } public OpenJPAQuery < X > setParameter ( String name , Object value ) { } void assertValueAssignable ( Parameter < ? > param , Object v ) { } }

Fix:
OrderedMap < Object , Class < ? > > paramTypes = _query . getOrderedParameterTypes ( ) ;