You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@streams.apache.org by mf...@apache.org on 2014/07/30 03:11:51 UTC

[2/2] git commit: STREAMS-135 | Adjusted checks for config so that the sample endpoint can be used

STREAMS-135 | Adjusted checks for config so that the sample endpoint can be used


Project: http://git-wip-us.apache.org/repos/asf/incubator-streams/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-streams/commit/28406d9c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-streams/tree/28406d9c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-streams/diff/28406d9c

Branch: refs/heads/STREAMS-135
Commit: 28406d9c732e4871096606b95b71f86261cff31a
Parents: ace69cf
Author: mfranklin <mf...@apache.org>
Authored: Tue Jul 29 19:46:23 2014 -0400
Committer: mfranklin <mf...@apache.org>
Committed: Tue Jul 29 19:46:23 2014 -0400

----------------------------------------------------------------------
 .../twitter/provider/TwitterStreamProvider.java       | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-streams/blob/28406d9c/streams-contrib/streams-provider-twitter/src/main/java/org/apache/streams/twitter/provider/TwitterStreamProvider.java
----------------------------------------------------------------------
diff --git a/streams-contrib/streams-provider-twitter/src/main/java/org/apache/streams/twitter/provider/TwitterStreamProvider.java b/streams-contrib/streams-provider-twitter/src/main/java/org/apache/streams/twitter/provider/TwitterStreamProvider.java
index 2e82ea2..9e1ce45 100644
--- a/streams-contrib/streams-provider-twitter/src/main/java/org/apache/streams/twitter/provider/TwitterStreamProvider.java
+++ b/streams-contrib/streams-provider-twitter/src/main/java/org/apache/streams/twitter/provider/TwitterStreamProvider.java
@@ -151,17 +151,17 @@ public class TwitterStreamProvider implements StreamsProvider, Serializable, Dat
 
             hosebirdHosts = new HttpHosts(Constants.STREAM_HOST);
 
-            Optional<List<String>> track = Optional.fromNullable(config.getTrack());
-            Optional<List<Long>> follow = Optional.fromNullable(config.getFollow());
+            boolean track = config.getTrack() != null && !config.getTrack().isEmpty();
+            boolean follow = config.getFollow() != null && !config.getFollow().isEmpty();
 
-            if( track.isPresent() || follow.isPresent() ) {
+            if( track || follow ) {
                 LOGGER.debug("***\tPRESENT\t***");
                 StatusesFilterEndpoint statusesFilterEndpoint = new StatusesFilterEndpoint();
-                if( track.isPresent() ) {
-                    statusesFilterEndpoint.trackTerms(track.get());
+                if( track ) {
+                    statusesFilterEndpoint.trackTerms(config.getTrack());
                 }
-                else {
-                    statusesFilterEndpoint.followings(follow.get());
+                if( follow ) {
+                    statusesFilterEndpoint.followings(config.getFollow());
                 }
                 this.endpoint = statusesFilterEndpoint;
             } else {