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 500F2200CC1 for ; Thu, 1 Jun 2017 09:13:18 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 4EBD0160BDF; Thu, 1 Jun 2017 07:13:18 +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 4AFE6160BB5 for ; Thu, 1 Jun 2017 09:13:17 +0200 (CEST) Received: (qmail 71693 invoked by uid 500); 1 Jun 2017 07:13:16 -0000 Mailing-List: contact commits-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@camel.apache.org Delivered-To: mailing list commits@camel.apache.org Received: (qmail 71080 invoked by uid 99); 1 Jun 2017 07:13:16 -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, 01 Jun 2017 07:13:16 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id E373DE93DC; Thu, 1 Jun 2017 07:13:15 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: davsclaus@apache.org To: commits@camel.apache.org Date: Thu, 01 Jun 2017 07:13:21 -0000 Message-Id: In-Reply-To: <835a098af6614bcfbedbab3ee671497a@git.apache.org> References: <835a098af6614bcfbedbab3ee671497a@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [07/10] camel git commit: Update CMISSessionFacade.java archived-at: Thu, 01 Jun 2017 07:13:18 -0000 Update CMISSessionFacade.java Hi, this piece of code causes two calls in a row for content stream. Result of document.getContentStream() has to be stored and used where is needed, not to call document.getContentStream() in condition and than again in return statement. Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/94d4881a Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/94d4881a Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/94d4881a Branch: refs/heads/camel-2.18.x Commit: 94d4881acd6ded66f02c7df003bdee65d6f59fa4 Parents: 121a834 Author: Tomáš Burian Authored: Wed May 31 15:06:01 2017 +0200 Committer: Claus Ibsen Committed: Thu Jun 1 09:12:18 2017 +0200 ---------------------------------------------------------------------- .../java/org/apache/camel/component/cmis/CMISSessionFacade.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/camel/blob/94d4881a/components/camel-cmis/src/main/java/org/apache/camel/component/cmis/CMISSessionFacade.java ---------------------------------------------------------------------- diff --git a/components/camel-cmis/src/main/java/org/apache/camel/component/cmis/CMISSessionFacade.java b/components/camel-cmis/src/main/java/org/apache/camel/component/cmis/CMISSessionFacade.java index 7b47e69..d143d7c 100644 --- a/components/camel-cmis/src/main/java/org/apache/camel/component/cmis/CMISSessionFacade.java +++ b/components/camel-cmis/src/main/java/org/apache/camel/component/cmis/CMISSessionFacade.java @@ -182,8 +182,9 @@ public class CMISSessionFacade { public InputStream getContentStreamFor(QueryResult item) { Document document = getDocument(item); - if (document != null && document.getContentStream() != null) { - return document.getContentStream().getStream(); + ContentStream contentStream = document.getContentStream(); + if (document != null && contentStream != null) { + return contentStream.getStream(); } return null; }