You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Sebb (JIRA)" <ji...@apache.org> on 2009/03/14 16:53:50 UTC

[jira] Created: (LANG-487) ToStringBuilder is thread-hostile

ToStringBuilder is thread-hostile
---------------------------------

                 Key: LANG-487
                 URL: https://issues.apache.org/jira/browse/LANG-487
             Project: Commons Lang
          Issue Type: Bug
            Reporter: Sebb


ToStringBuilder is thread-hostile due to the use of the static "defaultStyle" variable.

Adding synchronization won't solve this.

The field only seems to be used now in the get/set methods, so I suspect it could be removed along with the methods and tests

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (LANG-487) ToStringBuilder is thread-hostile

Posted by "Stephen Colebourne (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LANG-487?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12770232#action_12770232 ] 

Stephen Colebourne commented on LANG-487:
-----------------------------------------

Variable made volatile.

I propose we close this call.

> ToStringBuilder is thread-hostile
> ---------------------------------
>
>                 Key: LANG-487
>                 URL: https://issues.apache.org/jira/browse/LANG-487
>             Project: Commons Lang
>          Issue Type: Bug
>            Reporter: Sebb
>             Fix For: 3.0
>
>
> ToStringBuilder is thread-hostile due to the use of the static "defaultStyle" variable.
> Adding synchronization won't solve this.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (LANG-487) ToStringBuilder is thread-hostile

Posted by "Niall Pemberton (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LANG-487?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Niall Pemberton updated LANG-487:
---------------------------------

    Fix Version/s:     (was: 3.0)
                   2.5

> ToStringBuilder is thread-hostile
> ---------------------------------
>
>                 Key: LANG-487
>                 URL: https://issues.apache.org/jira/browse/LANG-487
>             Project: Commons Lang
>          Issue Type: Bug
>          Components: lang.builder.*
>            Reporter: Sebb
>             Fix For: 2.5
>
>
> ToStringBuilder is thread-hostile due to the use of the static "defaultStyle" variable.
> Adding synchronization won't solve this.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (LANG-487) ToStringBuilder is thread-hostile

Posted by "Henri Yandell (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LANG-487?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12697428#action_12697428 ] 

Henri Yandell commented on LANG-487:
------------------------------------

Rewrite for 3.0 to deal with/remove the static variable?

> ToStringBuilder is thread-hostile
> ---------------------------------
>
>                 Key: LANG-487
>                 URL: https://issues.apache.org/jira/browse/LANG-487
>             Project: Commons Lang
>          Issue Type: Bug
>            Reporter: Sebb
>
> ToStringBuilder is thread-hostile due to the use of the static "defaultStyle" variable.
> Adding synchronization won't solve this.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (LANG-487) ToStringBuilder is thread-hostile

Posted by "Henri Yandell (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LANG-487?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Henri Yandell updated LANG-487:
-------------------------------

    Fix Version/s: 3.0

> ToStringBuilder is thread-hostile
> ---------------------------------
>
>                 Key: LANG-487
>                 URL: https://issues.apache.org/jira/browse/LANG-487
>             Project: Commons Lang
>          Issue Type: Bug
>            Reporter: Sebb
>             Fix For: 3.0
>
>
> ToStringBuilder is thread-hostile due to the use of the static "defaultStyle" variable.
> Adding synchronization won't solve this.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (LANG-487) ToStringBuilder is thread-hostile

Posted by "Sebb (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LANG-487?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sebb updated LANG-487:
----------------------

    Description: 
ToStringBuilder is thread-hostile due to the use of the static "defaultStyle" variable.

Adding synchronization won't solve this.

  was:
ToStringBuilder is thread-hostile due to the use of the static "defaultStyle" variable.

Adding synchronization won't solve this.

The field only seems to be used now in the get/set methods, so I suspect it could be removed along with the methods and tests


> ToStringBuilder is thread-hostile
> ---------------------------------
>
>                 Key: LANG-487
>                 URL: https://issues.apache.org/jira/browse/LANG-487
>             Project: Commons Lang
>          Issue Type: Bug
>            Reporter: Sebb
>
> ToStringBuilder is thread-hostile due to the use of the static "defaultStyle" variable.
> Adding synchronization won't solve this.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Closed: (LANG-487) ToStringBuilder is thread-hostile

Posted by "Henri Yandell (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LANG-487?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Henri Yandell closed LANG-487.
------------------------------

    Resolution: Fixed

Closing per Stephen's commit.

> ToStringBuilder is thread-hostile
> ---------------------------------
>
>                 Key: LANG-487
>                 URL: https://issues.apache.org/jira/browse/LANG-487
>             Project: Commons Lang
>          Issue Type: Bug
>          Components: lang.builder.*
>            Reporter: Sebb
>             Fix For: 3.0
>
>
> ToStringBuilder is thread-hostile due to the use of the static "defaultStyle" variable.
> Adding synchronization won't solve this.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (LANG-487) ToStringBuilder is thread-hostile

Posted by "Sebb (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LANG-487?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12682119#action_12682119 ] 

Sebb commented on LANG-487:
---------------------------

If the setDefaultStyle() method is not used, then the class is not thread-hostile, so the Javadoc should at least point this out.

The get/setDefaultStyle() methods should really be synch, otherwise there is no guarantee what one thread will get when another sets.

If this were done, then it would be safe to call the set() method before any use is made of the class.

Users that provide a non-null ToStringStyle to constructors and static methods should not be affected by changes to the default style, so perhaps the constructors should enforce this.

> ToStringBuilder is thread-hostile
> ---------------------------------
>
>                 Key: LANG-487
>                 URL: https://issues.apache.org/jira/browse/LANG-487
>             Project: Commons Lang
>          Issue Type: Bug
>            Reporter: Sebb
>
> ToStringBuilder is thread-hostile due to the use of the static "defaultStyle" variable.
> Adding synchronization won't solve this.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.