streams-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mfrank...@apache.org
Subject [1/2] git commit: STREAMS-182 | Fixing issue where memory reference to the hashtags set could be incorrect
Date Thu, 25 Sep 2014 17:29:59 GMT
Repository: incubator-streams
Updated Branches:
  refs/heads/master 5f47348c0 -> e6045f85e


STREAMS-182 | Fixing issue where memory reference to the hashtags set could be incorrect


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

Branch: refs/heads/master
Commit: 2443022e28fa0b98611ba8fc9f01d66645dd0099
Parents: 2397f4b
Author: Robert Douglas <rdouglas@w2odigital.com>
Authored: Tue Sep 23 12:10:10 2014 -0500
Committer: Robert Douglas <rdouglas@w2odigital.com>
Committed: Tue Sep 23 12:10:10 2014 -0500

----------------------------------------------------------------------
 .../apache/streams/regex/AbstractRegexExtensionExtractor.java  | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-streams/blob/2443022e/streams-contrib/streams-processor-regex/src/main/java/org/apache/streams/regex/AbstractRegexExtensionExtractor.java
----------------------------------------------------------------------
diff --git a/streams-contrib/streams-processor-regex/src/main/java/org/apache/streams/regex/AbstractRegexExtensionExtractor.java
b/streams-contrib/streams-processor-regex/src/main/java/org/apache/streams/regex/AbstractRegexExtensionExtractor.java
index ef31cdf..88b2880 100644
--- a/streams-contrib/streams-processor-regex/src/main/java/org/apache/streams/regex/AbstractRegexExtensionExtractor.java
+++ b/streams-contrib/streams-processor-regex/src/main/java/org/apache/streams/regex/AbstractRegexExtensionExtractor.java
@@ -114,12 +114,14 @@ public abstract class AbstractRegexExtensionExtractor<T> implements
StreamsProce
     protected Collection<T> ensureTargetObject(Activity activity) {
         Map<String, Object> extensions = ensureExtensions(activity);
         Set<T> hashtags;
-        if(extensions.containsKey(extensionKey)) {
+        if(extensions.containsKey(extensionKey) && extensions.get(extensionKey) !=
null) {
             hashtags = Sets.newHashSet((Iterable<T>) extensions.get(extensionKey));
         } else {
             hashtags = Sets.newHashSet();
-            extensions.put(extensionKey, hashtags);
         }
+
+        extensions.put(extensionKey, hashtags);
+
         return hashtags;
     }
 }


Mime
View raw message