You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by "dk2k (via GitHub)" <gi...@apache.org> on 2023/04/04 07:11:27 UTC

[GitHub] [camel] dk2k commented on a diff in pull request #9793: added try with resources for ArangoCursor

dk2k commented on code in PR #9793:
URL: https://github.com/apache/camel/pull/9793#discussion_r1156823160


##########
components/camel-arangodb/src/main/java/org/apache/camel/component/arangodb/ArangoDbProducer.java:
##########
@@ -322,8 +323,11 @@ private Function<Exchange, Object> aqlQuery() {
                 resultClassType = resultClassType != null ? resultClassType : BaseDocument.class;
 
                 // perform query and return Collection
-                ArangoCursor<?> cursor = database.query(query, bindParameters, queryOptions, resultClassType);
-                return cursor == null ? null : cursor.asListRemaining();
+                try (ArangoCursor<?> cursor = database.query(query, bindParameters, queryOptions, resultClassType)) {
+                    return cursor == null ? null : cursor.asListRemaining();
+                } catch (IOException e) {
+                    throw new RuntimeCamelException("failed to close instance of ArangoCursor", e);

Review Comment:
   Fixed the capital letter



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org