Github user gemmellr commented on a diff in the pull request:

    https://github.com/apache/qpid-proton/pull/48#discussion_r36188742
  
    --- Diff: 
proton-j/src/main/java/org/apache/qpid/proton/engine/impl/CollectorImpl.java ---
    @@ -57,9 +58,13 @@ public void pop()
             }
         }
     
    -    public EventImpl put(Event.Type type, Object context)
    +    public EventImpl put(EventType type, Object context)
         {
    -        if (tail != null && tail.getType() == type &&
    +        if (type == null)
    +            throw new IllegalArgumentException("Type cannot be null");
    +        if (!type.isValid())
    +            throw new IllegalArgumentException("Cannot put events of type 
" + type);
    +        if (tail != null && tail.getEventType() == type &&
    --- End diff --
    
    'wrong thing' as in fail to coalesce the 'duplicate' events like it is 
trying to, in the case an EventType instance ever finds its way in there that 
is not an Enum and isn't used via a single instance, which wouldnt have been 
possible before but is now, however unlikely.
    
    There are other cases where the code does an == that I didn't say anything 
about because they are comparing against a specific enum value so their 
behaviour can't change, but it just seemed like in this case when the line was 
already being changed anyway it would be simple to avoid any future issues by 
making the update now.
    
    The comment wasnt meant to be some big thing :)


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to