SKHolmes commented on issue #27753:
URL: https://github.com/apache/beam/issues/27753#issuecomment-1660768368

   After some refactoring I have run into some weird behavior.
    ```
      public MessageParser() {
           Map<MessageType, TupleTag<Message>> messageTypeMap = new HashMap<>();
           List<TupleTag<Message>> tempList = new 
ArrayList<TupleTag<Message>>();
           TupleTagList tempTags = TupleTagList.empty();
   
           EnumSet.allOf(MessageType.class)
                   .forEach(messageType -> {
                       TupleTag<Message> t = new TupleTag<Message>(){};
                       messageTypeMap.put(messageType, t);
                       tempList.add(t);
                       tempTags.and(t);
                   });
   
           System.out.print("tags: ");
           System.out.println(tempTags.getAll());
           System.out.println(tempList);
   
           this.tags = tempTags;
           this.messageTypeMap = messageTypeMap;
           this.defaultTupleTag = new TupleTag<Message>(){};
       }
   ```
   The above prints,
   
   > tags: []
   [Tag<com.example.transforms.MessageParser$1.<init>:30#20ff67585e33a8f6>, 
Tag<com.example.transforms.MessageParser$1.<init>:30#2587af97b4865538>]
   
   I have looked into the TupleTagList source and I don't know why it would be 
behaving like this. By all means it should be adding to it's inner List with 
_.and()_ and should be returning that list with _getAll()_. 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to