streams-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From robdouglas <...@git.apache.org>
Subject [GitHub] incubator-streams pull request: Streams 105
Date Mon, 30 Jun 2014 15:02:35 GMT
Github user robdouglas commented on a diff in the pull request:

    https://github.com/apache/incubator-streams/pull/47#discussion_r14354627
  
    --- Diff: streams-contrib/streams-provider-datasift/src/main/java/org/apache/streams/datasift/serializer/DatasiftTweetActivitySerializer.java
---
    @@ -215,18 +217,22 @@ public void addTwitterExtensions(Activity activity, Twitter twitter,
Interaction
             }
     
             if(interaction.getAdditionalProperties() != null) {
    -            Object mentionsObject = interaction.getAdditionalProperties().get("mentions");
    -            if(mentionsObject != null ) {
    -                if(mentionsObject instanceof List) {
    -                    List mentions = (List) mentionsObject;
    -                    List<Map<String, Object>> userMentions = Lists.newLinkedList();
    -                    for(Object mention : mentions) {
    -                        Map<String, Object> actor = Maps.newHashMap();
    -                        actor.put("displayName", mention);
    -                        userMentions.add(actor);
    -                    }
    -                    extensions.put("user_mentions", userMentions);
    +            ArrayList<String> mentions = (ArrayList<String>) interaction.getAdditionalProperties().get("mentions");
    +            ArrayList<Long> mentionIds = (ArrayList<Long>) interaction.getAdditionalProperties().get("mention_ids");
    +            ArrayList<UserMentions> userMentions = new ArrayList<UserMentions>();
    +
    +            if(mentions != null && mentionIds != null && (mentionIds.size()
== mentions.size()) && !mentions.isEmpty() && !mentionIds.isEmpty()) {
    --- End diff --
    
    Alright, then in that case should we still create the UserMention objects in the event
that both lists are the same size?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message