Buggy code:
class CriteriaQueryImpl < T > implements AliasContext , OpenJPACriteriaQuery < T > { private static final Localizer _loc = Localizer . forPackage ( CriteriaQueryImpl . class ) ; private final MetamodelImpl _model ; private Set < Root < ? > > _roots ; private PredicateImpl _where ; private List < Order > _orders ; private OrderedMap < Object , Class < ? > > _params ; private Selection < ? extends T > _selection ; private List < Selection < ? > > _selections ; private List < Expression < ? > > _groups ; private PredicateImpl _having ; private List < Subquery < ? > > _subqueries ; private boolean _distinct ; private final SubqueryImpl < ? > _delegator ; private final Class < T > _resultClass ; private boolean _compiled ; private int aliasCount = 0 ; private static String ALIAS_BASE = "autoAlias" ; private Map < Selection < ? > , Value > _variables = new HashMap < Selection < ? > , Value > ( ) ; private Map < Selection < ? > , Value > _values = new HashMap < Selection < ? > , Value > ( ) ; private Map < Selection < ? > , String > _aliases = null ; private Map < Selection < ? > , Value > _rootVariables = new HashMap < Selection < ? > , Value > ( ) ; private Stack < Context > _contexts = null ; public CriteriaQueryImpl ( MetamodelImpl model , Class < T > resultClass ) { } CriteriaQueryImpl ( MetamodelImpl model , SubqueryImpl < T > delegator ) { } SubqueryImpl < ? > getDelegator ( ) { } public MetamodelImpl getMetamodel ( ) { } Stack < Context > getContexts ( ) { } public CriteriaQuery < T > distinct ( boolean distinct ) { } public List < Order > getOrderList ( ) { } public Selection < T > getSelection ( ) { } public CriteriaQuery < T > multiselect ( Selection < ? > ... selections ) { } void registerParameter ( ParameterExpressionImpl < ? > p ) { } public Set < ParameterExpression < ? > > getParameters ( ) { } public List < Selection < ? > > getSelectionList ( ) { } public CriteriaQuery < T > groupBy ( Expression < ? > ... grouping ) { } public CriteriaQuery < T > groupBy ( List < Expression < ? > > grouping ) { } public CriteriaQuery < T > having ( Expression < Boolean > restriction ) { } public CriteriaQuery < T > having ( Predicate ... restrictions ) { } public CriteriaQuery < T > orderBy ( Order ... orders ) { } public CriteriaQuery < T > orderBy ( List < Order > orders ) { } public CriteriaQuery < T > select ( Selection < ? extends T > selection ) { } public CriteriaQuery < T > where ( Expression < Boolean > restriction ) { } public CriteriaQuery < T > where ( Predicate ... restrictions ) { } public < X > Root < X > from ( EntityType < X > entity ) { } public < X > Root < X > from ( Class < X > cls ) { } public List < Expression < ? > > getGroupList ( ) { } public PredicateImpl getGroupRestriction ( ) { } public PredicateImpl getRestriction ( ) { } public Set < Root < ? > > getRoots ( ) { } public Root < ? > getRoot ( ) { } Root < ? > getRoot ( boolean mustExist ) { } void addRoot ( RootImpl < ? > root ) { } public boolean isDistinct ( ) { } public < U > Subquery < U > subquery ( Class < U > type ) { } public OrderedMap < Object , Class < ? > > getParameterTypes ( ) { collectParameters ( new CriteriaExpressionVisitor . ParameterVisitor ( this ) ) ; <START_BUG> return ( _params ) == null ? StoreQuery . EMPTY_PARAMS : _params ; <END_BUG> } QueryExpressions getQueryExpressions ( ExpressionFactory factory ) { } public void assertRoot ( ) { } public void assertSelection ( ) { } void setContexts ( Stack < Context > contexts ) { } CriteriaQueryImpl < ? > getAncestor ( ) { } public Map < Selection < ? > , String > getAliases ( ) { } Context ctx ( ) { } public String getAlias ( Selection < ? > selection ) { } public void registerVariable ( Selection < ? > node , Value var , Value path ) { } public boolean isRegistered ( Selection < ? > selection ) { } public Value getRegisteredVariable ( Selection < ? > selection ) { } public Value getRegisteredValue ( Selection < ? > selection ) { } void registerRoot ( Root < ? > root , Value var ) { } public Value getRegisteredRootVariable ( Root < ? > root ) { } CriteriaQueryImpl < ? > getDelegatorParent ( ) { } public Class < T > getResultType ( ) { } public CriteriaQuery < T > multiselect ( List < Selection < ? > > list ) { } boolean isMultiselect ( ) { } protected boolean isDefaultProjection ( ) { } void invalidateCompilation ( ) { } public OpenJPACriteriaQuery < T > compile ( ) { } private void collectParameters ( CriteriaExpressionVisitor visitor ) { } public String toCQL ( ) { } void render ( StringBuilder buffer , Set < Root < ? > > roots , List < Join < ? , ? > > correlatedJoins ) { } private void renderJoins ( StringBuilder buffer , Collection < Join < ? , ? > > joins ) { } private void renderRoots ( StringBuilder buffer , Collection < Root < ? > > roots ) { }

Fix:
return ( _params ) == null ? StoreQuery . EMPTY_ORDERED_PARAMS : _params ;