streams-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mfrank...@apache.org
Subject [7/9] git commit: STREAMS-86 | providerQueue is constructed before checking to see if it is null. Otherwise, will fail every time
Date Tue, 27 May 2014 13:44:01 GMT
STREAMS-86 | providerQueue is constructed before checking to see if it is null. Otherwise,
will fail every time


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

Branch: refs/heads/master
Commit: ea7b6622d505f0f0c0089760d3a59b888bb38aa3
Parents: 12af7b3
Author: Robert Douglas <rdouglas@w2odigital.com>
Authored: Mon May 19 14:38:12 2014 -0500
Committer: mfranklin <mfranklin@apache.org>
Committed: Tue May 27 09:33:21 2014 -0400

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


http://git-wip-us.apache.org/repos/asf/incubator-streams/blob/ea7b6622/streams-contrib/streams-provider-twitter/src/main/java/org/apache/streams/twitter/provider/TwitterTimelineProvider.java
----------------------------------------------------------------------
diff --git a/streams-contrib/streams-provider-twitter/src/main/java/org/apache/streams/twitter/provider/TwitterTimelineProvider.java
b/streams-contrib/streams-provider-twitter/src/main/java/org/apache/streams/twitter/provider/TwitterTimelineProvider.java
index 8927577..15828fc 100644
--- a/streams-contrib/streams-provider-twitter/src/main/java/org/apache/streams/twitter/provider/TwitterTimelineProvider.java
+++ b/streams-contrib/streams-provider-twitter/src/main/java/org/apache/streams/twitter/provider/TwitterTimelineProvider.java
@@ -266,6 +266,13 @@ public class TwitterTimelineProvider implements StreamsProvider, Serializable
{
 
         executor = MoreExecutors.listeningDecorator(newFixedThreadPoolWithQueueSize(5, 20));
 
+        try {
+            lock.writeLock().lock();
+            providerQueue = constructQueue();
+        } finally {
+            lock.writeLock().unlock();
+        }
+
         Preconditions.checkNotNull(providerQueue);
         Preconditions.checkNotNull(this.klass);
         Preconditions.checkNotNull(config.getOauth().getConsumerKey());
@@ -281,13 +288,6 @@ public class TwitterTimelineProvider implements StreamsProvider, Serializable
{
         includeEntitiesEnabled = Optional.fromNullable(new Boolean(Boolean.parseBoolean(config.getIncludeEntities()))).or(true);
 
         client = getTwitterClient();
-
-        try {
-            lock.writeLock().lock();
-            providerQueue = constructQueue();
-        } finally {
-            lock.writeLock().unlock();
-        }
     }
 
     protected Twitter getTwitterClient()


Mime
View raw message