You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-dev@logging.apache.org by Gary Gregory <ga...@gmail.com> on 2014/05/19 03:27:26 UTC

org.apache.logging.log4j.ThreadContext.EMPTY_STACK is not immutable

FYI:

I plan on replacing org.apache.logging.log4j.ThreadContext.EMPTY_STACK with
an object that is in fact immutable, in the style of
Collections.emptyList().

Gary

-- 
E-Mail: garydgregory@gmail.com | ggregory@apache.org
Java Persistence with Hibernate, Second Edition<http://www.manning.com/bauer3/>
JUnit in Action, Second Edition <http://www.manning.com/tahchiev/>
Spring Batch in Action <http://www.manning.com/templier/>
Blog: http://garygregory.wordpress.com
Home: http://garygregory.com/
Tweet! http://twitter.com/GaryGregory

Re: org.apache.logging.log4j.ThreadContext.EMPTY_STACK is not immutable

Posted by Remko Popma <re...@gmail.com>.
Gary,

Good catch!

I'm still thinking it may be easier if ThreadContext.ContextStack does not extend Collection (it adds quite a few methods). Perhaps the client code could use the existing asList method? (I don't have a strong opinion on this, just thought it could save you some work...)

Sent from my iPhone

> On 2014/05/19, at 10:27, Gary Gregory <ga...@gmail.com> wrote:
> 
> FYI:
> 
> I plan on replacing org.apache.logging.log4j.ThreadContext.EMPTY_STACK with an object that is in fact immutable, in the style of Collections.emptyList().
> 
> Gary
> 
> -- 
> E-Mail: garydgregory@gmail.com | ggregory@apache.org 
> Java Persistence with Hibernate, Second Edition
> JUnit in Action, Second Edition
> Spring Batch in Action
> Blog: http://garygregory.wordpress.com 
> Home: http://garygregory.com/
> Tweet! http://twitter.com/GaryGregory