camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject [07/10] camel git commit: Update CMISSessionFacade.java
Date Thu, 01 Jun 2017 07:13:21 GMT
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 <tomas.burian@lundegaard.eu>
Authored: Wed May 31 15:06:01 2017 +0200
Committer: Claus Ibsen <davsclaus@apache.org>
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;
     }


Mime
View raw message