logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gary Gregory <garydgreg...@gmail.com>
Subject Re: [v2] Should Message impls be immutable?
Date Sat, 06 Oct 2012 17:23:36 GMT
Can we then make more ivars final?

Gary

On Sat, Oct 6, 2012 at 2:39 AM, Ralph Goers <ralph.goers@dslextreme.com>wrote:

> So I took a look at these.  ObjectMessage and SimpleMessage already are
> immutable.  I've modified ParameterizedMessage, StringFormattedMessage and
> ThreadDumpMessage so that they are also immutable and not seen any side
> effects.  I've made LocalizedMessage mostly immutable but it is updated
> when the LCan ogEvent is created as it needs the Logger name to locate the
> resource bundle (this is one of the things I really dislike about the class
> but it is required to allow compatibility with Log4j 1.x).  MapMessage
> isn't immutable as the Map can be updated by calling the put method. After
> thinking about it I'm more inclined to leave that class as is as the
> default constructor creates an empty Map to be populated.
>
> Ralph
>
> On Oct 5, 2012, at 2:03 PM, Gary Gregory wrote:
>
> Ok, cool. I'd like to assume this piece is settled so we can move the
> other chat forward :)
>
> Gary
>
> On Fri, Oct 5, 2012 at 4:37 PM, Ralph Goers <ralph.goers@dslextreme.com>wrote:
>
>> Yes, they should all be. Even MapMessage really shouldn't allow the Map
>> to be updated through the Message.  I'll have to look at them and figure
>> out why I let some of them have set methods.
>>
>> Ralph
>>
>>
>> On Oct 5, 2012, at 1:25 PM, Gary Gregory wrote:
>>
>> Hi All:
>>
>> Should Message implementations be immutable?
>>
>> At least:
>>
>>    - ObjectMessage
>>    - ParameterizedMessage
>>    - SimpleMessage
>>    - StringFormattedMessage
>>    - ThreadDumpMessage
>>
>>
>> Gary
>>
>> --
>> E-Mail: garydgregory@gmail.com | ggregory@apache.org
>> JUnit in Action, 2nd Ed: <http://goog_1249600977/>http://bit.ly/ECvg0
>> Spring Batch in Action: <http://s.apache.org/HOq>http://bit.ly/bqpbCK
>> Blog: http://garygregory.wordpress.com
>> Home: http://garygregory.com/
>> Tweet! http://twitter.com/GaryGregory
>>
>>
>>
>
>
> --
> E-Mail: garydgregory@gmail.com | ggregory@apache.org
> JUnit in Action, 2nd Ed: <http://goog_1249600977/>http://bit.ly/ECvg0
> Spring Batch in Action: <http://s.apache.org/HOq>http://bit.ly/bqpbCK
> Blog: http://garygregory.wordpress.com
> Home: http://garygregory.com/
> Tweet! http://twitter.com/GaryGregory
>
>
>


-- 
E-Mail: garydgregory@gmail.com | ggregory@apache.org
JUnit in Action, 2nd Ed: <http://goog_1249600977>http://bit.ly/ECvg0
Spring Batch in Action: <http://s.apache.org/HOq>http://bit.ly/bqpbCK
Blog: http://garygregory.wordpress.com
Home: http://garygregory.com/
Tweet! http://twitter.com/GaryGregory

Mime
View raw message