LANG-487 - Make default style thread-safe (better Javadoc)

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/lang/trunk@830040 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Stephen Colebourne 2009-10-27 00:59:15 +00:00
parent bf626b85ba
commit 77e3dcc393
1 changed files with 6 additions and 2 deletions

View File

@ -106,7 +106,9 @@ public class ToStringBuilder {
* It is recommended to pass a <code>ToStringStyle</code> to the constructor instead
* of using this global default.</p>
*
* <p>This method is thread-safe, as a <code>volatile</code variable is used internally.</p>
* <p>This method is not intended for use from multiple threads.
* Internally, a <code>volatile</code> variable is used to provide the guarantee
* that the latest value set using {@link #setDefaultStyle} is the value returned.</p>
*
* <p>One reason for changing the default could be to have a verbose style during
* development and a compact style in production.</p>
@ -125,7 +127,9 @@ public class ToStringBuilder {
* It is recommended to pass a <code>ToStringStyle</code> to the constructor instead
* of changing this global default.</p>
*
* <p>This method is thread-safe, as a <code>volatile</code variable is used internally.</p>
* <p>This method is not intended for use from multiple threads.
* Internally, a <code>volatile</code> variable is used to provide the guarantee
* that the latest value set is the value returned from {@link #getDefaultStyle}.</p>
*
* @param style the default <code>ToStringStyle</code>
* @throws IllegalArgumentException if the style is <code>null</code>