You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by pa...@apache.org on 2019/12/20 14:47:08 UTC
[camel] branch master updated: Minimal simplification of
SlackConsumer#getChannelId.
This is an automated email from the ASF dual-hosted git repository.
pascalschumacher pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/master by this push:
new ed452ad Minimal simplification of SlackConsumer#getChannelId.
ed452ad is described below
commit ed452ad9512fc7f6121e86e83794421cad1eb964
Author: Pascal Schumacher <pa...@gmx.net>
AuthorDate: Fri Dec 20 15:46:29 2019 +0100
Minimal simplification of SlackConsumer#getChannelId.
---
.../main/java/org/apache/camel/component/slack/SlackConsumer.java | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/components/camel-slack/src/main/java/org/apache/camel/component/slack/SlackConsumer.java b/components/camel-slack/src/main/java/org/apache/camel/component/slack/SlackConsumer.java
index f04994e..d4ab172 100644
--- a/components/camel-slack/src/main/java/org/apache/camel/component/slack/SlackConsumer.java
+++ b/components/camel-slack/src/main/java/org/apache/camel/component/slack/SlackConsumer.java
@@ -18,6 +18,7 @@ package org.apache.camel.component.slack;
import java.io.IOException;
import java.util.ArrayList;
+import java.util.Collection;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
@@ -136,8 +137,8 @@ public class SlackConsumer extends ScheduledBatchPollingConsumer {
String jsonString = readResponse(response);
JsonObject c = (JsonObject) Jsoner.deserialize(jsonString);
- JsonArray list = (JsonArray) c.getCollection("channels");
- for (JsonObject singleChannel : (List<JsonObject>)(List) list) {
+ Collection<JsonObject> channels = c.getCollection("channels");
+ for (JsonObject singleChannel : channels) {
if (singleChannel.get("name") != null) {
if (singleChannel.get("name").equals(channel)) {
if (singleChannel.get("id") != null) {