On Dec 29, 2007 7:46 AM, Jerome Louvel <[EMAIL PROTECTED]> wrote:

> I've applied Tim's patch to the trunk.


The List returned by getProtocols is the actual CopyOnWriteArrayList itself,
safe for access (including modification) by multiple threads. Is that what
you want? (Just making sure, not saying it's wrong.)



> The current usage of setProtocols() is mostly for setter injection indeed.
> Couldn't we simply mark the method as synchronized?
>

Yes, but I'm thinking about issue 258, along with use of @ThreadSafe and
@GuardedBy and some yet-to-be-decided-upon annotation (@ReadOnly ?) for
marking methods/fields as read-only once initialized via setter injection.
If setProtocols were @ReadOnly, we wouldn't need the call to
this.protocols.clear() and wouldn't care about synchronization.

Are there really use cases where the list of protocols needs to be changed
dynamically? (I can construct an artificial example, but I want to know if
anyone really does this in practice.)

--tim

Reply via email to