Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id E522D200B54 for ; Thu, 28 Jul 2016 14:59:24 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id E3A8F160A94; Thu, 28 Jul 2016 12:59:24 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 412F7160A63 for ; Thu, 28 Jul 2016 14:59:24 +0200 (CEST) Received: (qmail 46735 invoked by uid 500); 28 Jul 2016 12:59:23 -0000 Mailing-List: contact commits-help@olingo.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@olingo.apache.org Delivered-To: mailing list commits@olingo.apache.org Received: (qmail 46722 invoked by uid 99); 28 Jul 2016 12:59:23 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 28 Jul 2016 12:59:23 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 5B799E0100; Thu, 28 Jul 2016 12:59:23 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: chrisam@apache.org To: commits@olingo.apache.org Date: Thu, 28 Jul 2016 12:59:23 -0000 Message-Id: <92e8a60516b14e7ba0f09998f8335dc4@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [1/2] olingo-odata4 git commit: [OLINGO-964] fix proposal for cast type not taken into account while expanding a collection archived-at: Thu, 28 Jul 2016 12:59:25 -0000 Repository: olingo-odata4 Updated Branches: refs/heads/master ebf4eb928 -> bde34e597 [OLINGO-964] fix proposal for cast type not taken into account while expanding a collection Signed-off-by: Christian Amend Project: http://git-wip-us.apache.org/repos/asf/olingo-odata4/repo Commit: http://git-wip-us.apache.org/repos/asf/olingo-odata4/commit/8a10f47b Tree: http://git-wip-us.apache.org/repos/asf/olingo-odata4/tree/8a10f47b Diff: http://git-wip-us.apache.org/repos/asf/olingo-odata4/diff/8a10f47b Branch: refs/heads/master Commit: 8a10f47b8955f7c4b60b8f3bdcdc8fbf5240199d Parents: ebf4eb9 Author: Jacek Milaczewski Authored: Mon May 30 09:46:38 2016 +0200 Committer: Christian Amend Committed: Thu Jul 28 14:53:11 2016 +0200 ---------------------------------------------------------------------- .../apache/olingo/server/core/uri/parser/ExpandParser.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/8a10f47b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/ExpandParser.java ---------------------------------------------------------------------- diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/ExpandParser.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/ExpandParser.java index 1da143a..8a493ff 100644 --- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/ExpandParser.java +++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/ExpandParser.java @@ -136,13 +136,13 @@ public class ExpandParser { UriResourcePartTyped lastPart = (UriResourcePartTyped) resource.getLastResourcePart(); boolean hasSlash = false; + EdmStructuredType typeCastSuffix = null; if (tokenizer.next(TokenKind.SLASH)) { hasSlash = true; if (lastPart instanceof UriResourceNavigation) { UriResourceNavigationPropertyImpl navigationResource = (UriResourceNavigationPropertyImpl) lastPart; final EdmNavigationProperty navigationProperty = navigationResource.getProperty(); - final EdmStructuredType typeCastSuffix = ParserHelper.parseTypeCast(tokenizer, edm, - navigationProperty.getType()); + typeCastSuffix = ParserHelper.parseTypeCast(tokenizer, edm, navigationProperty.getType()); if (typeCastSuffix != null) { if (navigationProperty.isCollection()) { navigationResource.setCollectionTypeFilter(typeCastSuffix); @@ -154,7 +154,8 @@ public class ExpandParser { } } - final EdmStructuredType newReferencedType = (EdmStructuredType) lastPart.getType(); + final EdmStructuredType newReferencedType = typeCastSuffix != null ? typeCastSuffix + : (EdmStructuredType) lastPart.getType(); final boolean newReferencedIsCollection = lastPart.isCollection(); if (hasSlash || tokenizer.next(TokenKind.SLASH)) { if (tokenizer.next(TokenKind.REF)) {