diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/ExpressionParser.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/ExpressionParser.java index cf2074a73..8f69f818d 100644 --- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/ExpressionParser.java +++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/ExpressionParser.java @@ -338,7 +338,7 @@ public class ExpressionParser { if (tokenizer.next(TokenKind.OPEN)) { ParserHelper.bws(tokenizer); List expressionList = parseInExpr(); - checkInExpressionTypes(expressionList, kinds); + checkInExpressionTypes(expressionList, leftExprType); return new BinaryImpl(left, BinaryOperatorKind.IN, expressionList, odata.createPrimitiveTypeInstance(EdmPrimitiveTypeKind.Boolean)); } else { @@ -354,19 +354,20 @@ public class ExpressionParser { /** * @param expressionList - * @param kinds + * @param leftExprType * @throws UriParserException * @throws UriParserSemanticException */ - private void checkInExpressionTypes(List expressionList, EdmPrimitiveTypeKind kinds) + private void checkInExpressionTypes(List expressionList, EdmType leftExprType) throws UriParserException, UriParserSemanticException { for (Expression expr : expressionList) { EdmType inExprType = getType(expr); - if (!isType(inExprType, kinds)) { + + if (!(((EdmPrimitiveType) leftExprType).isCompatible((EdmPrimitiveType) inExprType))) { throw new UriParserSemanticException("Incompatible types.", UriParserSemanticException.MessageKeys.TYPES_NOT_COMPATIBLE, inExprType == null ? "" : inExprType.getFullQualifiedName().getFullQualifiedNameAsString(), - kinds.getFullQualifiedName().getFullQualifiedNameAsString()); + leftExprType.getFullQualifiedName().getFullQualifiedNameAsString()); } } }