Buggy code:
public class QueryDefinitionImpl extends ExpressionImpl implements Expression , QueryDefinition { private final QueryBuilderImpl _builder ; private List < AbstractDomainObject > _domains ; private List < PathExpression > _groupBys ; private List < OrderableItem > _orderBys ; private List < SelectItem > _projections ; private boolean _distinct ; private Predicate _where ; private Predicate _having ; private static enum Visit { PROJECTION , EXPRESSION , JOINABLE ; } protected static Localizer _loc = Localizer . forPackage ( QueryDefinitionImpl . class ) ; protected QueryDefinitionImpl ( QueryBuilderImpl builder ) { } public DomainObject addRoot ( Class cls ) { } public DomainObject addSubqueryRoot ( PathExpression path ) { } boolean hasDomain ( PathExpression path ) { } protected < T extends AbstractDomainObject > T addDomain ( T path ) { } public Subquery all ( ) { } public Subquery any ( ) { } public Expression coalesce ( Expression ... exp ) { } public Expression coalesce ( String ... exp ) { } public Expression coalesce ( Date ... exp ) { } public Expression coalesce ( Calendar ... exp ) { } public Expression currentDate ( ) { } public Expression currentTime ( ) { } public Expression currentTimestamp ( ) { } public Predicate exists ( ) { } public CaseExpression generalCase ( ) { } public QueryDefinition groupBy ( PathExpression ... pathExprs ) { } public QueryDefinition groupBy ( List < PathExpression > pathExprList ) { } public QueryDefinition having ( Predicate predicate ) { } public Expression literal ( String s ) { } public Expression literal ( Number n ) { } public Expression literal ( boolean b ) { } public Expression literal ( Calendar c ) { } public Expression literal ( Date d ) { } public Expression literal ( char c ) { } public Expression literal ( Class cls ) { } public Expression literal ( Enum < ? > e ) { } public Expression nullLiteral ( ) { } public SelectItem newInstance ( Class cls , SelectItem ... args ) { } public Expression nullif ( Expression exp1 , Expression exp2 ) { } public Expression nullif ( Number arg1 , Number arg2 ) { } public Expression nullif ( String arg1 , String arg2 ) { } public Expression nullif ( Date arg1 , Date arg2 ) { } public Expression nullif ( Calendar arg1 , Calendar arg2 ) { } public Expression nullif ( Class arg1 , Class arg2 ) { } public Expression nullif ( Enum < ? > arg1 , Enum < ? > arg2 ) { } public QueryDefinition orderBy ( OrderByItem ... orderByItems ) { } public QueryDefinition orderBy ( List < OrderByItem > orderByItemList ) { } public Expression param ( String name ) { } public Predicate predicate ( boolean b ) { } public QueryDefinition select ( SelectItem ... items ) { } public QueryDefinition select ( List < SelectItem > items ) { } public QueryDefinition selectDistinct ( SelectItem ... items ) { } public QueryDefinition selectDistinct ( List < SelectItem > items ) { <START_BUG> return select ( items , false ) ; <END_BUG> } private QueryDefinition select ( List < SelectItem > items , boolean isDistinct ) { } public CaseExpression simpleCase ( Expression caseOperand ) { } public CaseExpression simpleCase ( Number caseOperand ) { } public CaseExpression simpleCase ( String caseOperand ) { } public CaseExpression simpleCase ( Date caseOperand ) { } public CaseExpression simpleCase ( Calendar caseOperand ) { } public CaseExpression simpleCase ( Class caseOperand ) { } public CaseExpression simpleCase ( Enum < ? > caseOperand ) { } public Subquery some ( ) { } public QueryDefinition where ( Predicate predicate ) { } private List < SelectItem > getProjections ( ) { } @ Override public String asExpression ( AliasContext ctx ) { } public String asProjection ( AliasContext ctx ) { } public void fillBuffer ( String header , StringBuffer buffer , AliasContext ctx , List list , QueryDefinitionImpl . Visit visit ) { } public void fillBuffer ( String header , StringBuffer buffer , AliasContext ctx , Predicate p ) { } private void registerDomains ( AliasContext ctx ) { } static class DomainSorter implements Comparator < AbstractDomainObject > { static List < Class > _order = Arrays . asList ( new Class [ ] { RootPath . class , NavigationPath . class , OperatorPath . class , JoinPath . class , FetchPath . class } ) ; public int compare ( AbstractDomainObject a , AbstractDomainObject b ) { } } }

Fix:
return select ( items , true ) ;