You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@logging.apache.org by GitBox <gi...@apache.org> on 2018/12/30 15:32:50 UTC

[GitHub] cakofony commented on issue #247: LOG4J2-2527: ListAppender getters return immutable snapshots

cakofony commented on issue #247: LOG4J2-2527: ListAppender getters return immutable snapshots
URL: https://github.com/apache/logging-log4j2/pull/247#issuecomment-450568096
 
 
   > Why not use a CopyOnWriteArrayList?
   
   Two reasons:
   1. I expect more appends than gets. This implementation is basically a CopyOnRead.
   2. I find it confusing that the unmodifiable list we return is updated when new events are logged, while we use it, regardless of the list implementation we use I'd prefer for the returned values to be immutable snapshots. The benefit of a CoW list is that iterator usage is safe, but because we copy the collection this doesn't help us.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services