commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stephen Colebourne <scolebou...@btopenworld.com>
Subject Re: svn commit: r829991 - /commons/proper/lang/trunk/src/java/org/apache/commons/lang/builder/ToStringBuilder.java
Date Tue, 27 Oct 2009 01:04:09 GMT
sebb wrote:
>>  +     * <p>This method is thread-safe, as a <code>volatile</code
variable is used internally.</p>
> 
> I think it's misleading to call the method thread-safe.
> Adding volatile/synch. merely ensures that the new value is published correctly.
> 
> The use of a mutable static variable means that the method cannot
> really be considered thread-safe. Two independent threads cannot - in
> general - both use the set method and still be assured of predictable
> behaviour.

Reworded.
Stephen

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Mime
View raw message