Program: 33160
Project: 33160
Buggy source:
protected static List<UriParameter> parseFunctionParameters(UriTokenizer tokenizer,final Edm edm,final EdmType referringType,final boolean withComplex,final Map<String,AliasQueryOption> aliases) throws UriParserException, UriValidationException {
  List<UriParameter> parameters=new ArrayList<UriParameter>();
  ParserHelper.requireNext(tokenizer,TokenKind.OPEN);
  if (tokenizer.next(TokenKind.CLOSE)) {
    return parameters;
  }
  do {
    ParserHelper.requireNext(tokenizer,TokenKind.ODataIdentifier);
    final String name=tokenizer.getText();
    if (parameters.contains(name)) {
      throw new UriParserSemanticException("String_Node_Str" + name,UriParserSemanticException.MessageKeys.INVALID_KEY_VALUE,name);
    }
    ParserHelper.requireNext(tokenizer,TokenKind.EQ);
    if (tokenizer.next(TokenKind.COMMA) || tokenizer.next(TokenKind.CLOSE) || tokenizer.next(TokenKind.EOF)) {
      throw new UriParserSyntaxException("String_Node_Str",UriParserSyntaxException.MessageKeys.SYNTAX);
    }
    UriParameterImpl parameter=new UriParameterImpl().setName(name);
    if (tokenizer.next(TokenKind.ParameterAliasName)) {
      final String aliasName=tokenizer.getText();
      parameter.setAlias(aliasName).setExpression(aliases.containsKey(aliasName) ? aliases.get(aliasName).getValue() : null);
    }
 else     if (tokenizer.next(TokenKind.jsonArrayOrObject)) {
      if (withComplex) {
        parameter.setText(tokenizer.getText());
      }
 else {
        throw new UriParserSemanticException("String_Node_Str",UriParserSemanticException.MessageKeys.COMPLEX_PARAMETER_IN_RESOURCE_PATH,tokenizer.getText());
      }
    }
 else     if (withComplex) {
      final Expression expression=new ExpressionParser(edm,odata).parse(tokenizer,referringType,null,aliases);
      parameter.setText(expression instanceof Literal ? "String_Node_Str".equals(((Literal)expression).getText()) ? null : ((Literal)expression).getText() : null).setExpression(expression instanceof Literal ? null : expression);
    }
 else     if (nextPrimitiveValue(tokenizer) == null) {
      throw new UriParserSemanticException("String_Node_Str",UriParserSemanticException.MessageKeys.INVALID_KEY_VALUE,"String_Node_Str");
    }
 else {
      final String literalValue=tokenizer.getText();
      parameter.setText("String_Node_Str".equals(literalValue) ? null : literalValue);
    }
    parameters.add(parameter);
  }
 while (tokenizer.next(TokenKind.COMMA));
  ParserHelper.requireNext(tokenizer,TokenKind.CLOSE);
  return parameters;
}

Fixed version (ground truth):
protected static List<UriParameter> parseFunctionParameters(UriTokenizer tokenizer,final Edm edm,final EdmType referringType,final boolean withComplex,final Map<String,AliasQueryOption> aliases) throws UriParserException, UriValidationException {
  List<UriParameter> parameters=new ArrayList<UriParameter>();
  Set<String> parameterNames=new HashSet<String>();
  ParserHelper.requireNext(tokenizer,TokenKind.OPEN);
  if (tokenizer.next(TokenKind.CLOSE)) {
    return parameters;
  }
  do {
    ParserHelper.requireNext(tokenizer,TokenKind.ODataIdentifier);
    final String name=tokenizer.getText();
    if (parameterNames.contains(name)) {
      throw new UriParserSemanticException("String_Node_Str" + name,UriParserSemanticException.MessageKeys.INVALID_KEY_VALUE,name);
    }
    parameterNames.add(name);
    ParserHelper.requireNext(tokenizer,TokenKind.EQ);
    if (tokenizer.next(TokenKind.COMMA) || tokenizer.next(TokenKind.CLOSE) || tokenizer.next(TokenKind.EOF)) {
      throw new UriParserSyntaxException("String_Node_Str",UriParserSyntaxException.MessageKeys.SYNTAX);
    }
    UriParameterImpl parameter=new UriParameterImpl().setName(name);
    if (tokenizer.next(TokenKind.ParameterAliasName)) {
      final String aliasName=tokenizer.getText();
      parameter.setAlias(aliasName).setExpression(aliases.containsKey(aliasName) ? aliases.get(aliasName).getValue() : null);
    }
 else     if (tokenizer.next(TokenKind.jsonArrayOrObject)) {
      if (withComplex) {
        parameter.setText(tokenizer.getText());
      }
 else {
        throw new UriParserSemanticException("String_Node_Str",UriParserSemanticException.MessageKeys.COMPLEX_PARAMETER_IN_RESOURCE_PATH,tokenizer.getText());
      }
    }
 else     if (withComplex) {
      final Expression expression=new ExpressionParser(edm,odata).parse(tokenizer,referringType,null,aliases);
      parameter.setText(expression instanceof Literal ? "String_Node_Str".equals(((Literal)expression).getText()) ? null : ((Literal)expression).getText() : null).setExpression(expression instanceof Literal ? null : expression);
    }
 else     if (nextPrimitiveValue(tokenizer) == null) {
      throw new UriParserSemanticException("String_Node_Str",UriParserSemanticException.MessageKeys.INVALID_KEY_VALUE,"String_Node_Str");
    }
 else {
      final String literalValue=tokenizer.getText();
      parameter.setText("String_Node_Str".equals(literalValue) ? null : literalValue);
    }
    parameters.add(parameter);
  }
 while (tokenizer.next(TokenKind.COMMA));
  ParserHelper.requireNext(tokenizer,TokenKind.CLOSE);
  return parameters;
}