You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4net-dev@logging.apache.org by Stefan Bodewig <bo...@apache.org> on 2013/10/10 21:09:59 UTC

Re: svn commit: r1531076 - in /logging/log4net/trunk/src: Core/StackFrameItem.cs Util/ThreadContextProperties.cs

On 2013-10-10, <bo...@apache.org> wrote:

> Modified: logging/log4net/trunk/src/Util/ThreadContextProperties.cs
> URL: http://svn.apache.org/viewvc/logging/log4net/trunk/src/Util/ThreadContextProperties.cs?rev=1531076&r1=1531075&r2=1531076&view=diff
> ==============================================================================
> --- logging/log4net/trunk/src/Util/ThreadContextProperties.cs (original)
>>>> logging/log4net/trunk/src/Util/ThreadContextProperties.cs Thu Oct 10 18:55:19 2013
>  		internal PropertiesDictionary GetProperties(bool create)
>  		{
> -			if (_dictionary != null && create)
> -			{
> -				return new PropertiesDictionary(_dictionary);
> + #if NETCF
> +			PropertiesDictionary _dictionary = (PropertiesDictionary)System.Threading.Thread.GetData(s_threadLocalSlot);
> + #endif
> +			if (_dictionary == null && create)
> +			{

Note I've modified the meaning of GetProperties(true) here and brought
it back in line with what the documentation says (and back to what
1.2.11 did).

When _dictionary was null, the method used to create a new dictionary
but in 1.2.12 returns null - I think this is a bug.  OTOH if it was not
null then 1.2.12 returned a new dictionary instance in the create ==
true case - now it will always return the existing one.

This doesn't really matter, though, as the method is internal and no
code ever invoked GetProperties(true) in 1.2.12 - at least that's what
grep says.

Stefa