commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From James Carman <ja...@carmanconsulting.com>
Subject Re: [lang] Check for Duplicate Event Listener
Date Mon, 11 May 2015 16:43:09 GMT
On Mon, May 11, 2015 at 12:02 PM Matthew Aguirre <matt.aguirre@gmail.com>
wrote:

> I would like to add support to check for a duplicate event listener to the
> org.apache.commons.lang3.event.EventListenerSupport class.
> This would save me (and possibly others) from then checking the listeners
> before adding.
>
>    1. Should I just submit a ticket or should I implement a change within
>    GitHub?
>    2. Since I doubt that a global change would be appreciated, what would
>    an acceptable method for signaling duplicate detection be?
>       1. Flag in the constructor?
>       2. Flag in the addListener method?
>
>
Great ideas!  I would think the non-duplicate part would be a global thing
for that particular EventListenerSupport object, so it should probably be
part of the constructor.  That would change the serialization of the
objects, which is somewhat problematic, but we do control that ourselves
(without version numbers, unfortunately), so we could always default the
flag to false if the data's not there.  I doubt folks are storing event
listeners in long-term storage, though.

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message