commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Henri Yandell (JIRA)" <j...@apache.org>
Subject [jira] Updated: (LANG-69) [lang] ToStringBuilder throws StackOverflowError when an Object cycle exists
Date Mon, 03 Jul 2006 19:06:30 GMT
     [ http://issues.apache.org/jira/browse/LANG-69?page=all ]

Henri Yandell updated LANG-69:
------------------------------

    Bugzilla Id:   (was: 36061)
    Fix Version: 2.3
                     (was: 2.2)

Pushing back to 2.3 as it needs quite a bit of investigation to determine the problem and
write a new fix that passes all tests (without such a code change hopefully).

> [lang] ToStringBuilder throws StackOverflowError when an Object cycle exists
> ----------------------------------------------------------------------------
>
>          Key: LANG-69
>          URL: http://issues.apache.org/jira/browse/LANG-69
>      Project: Commons Lang
>         Type: Bug

>     Versions: 2.1
>  Environment: Operating System: other
> Platform: Other
>     Reporter: Maarten Coene
>      Fix For: 2.3
>  Attachments: 15938.patch, 36061.patch, ReflectionToStringBuilder.java.patch, ToStringBuilderTest.java.patch,
ToStringStyle.java.patch
>
> Hi,
> The ToStringBuilder throws a StackOverflowError if you have a cycle in the
> object graph. For instance, the following toString() method will cause a
> StackOverflowError:
> public class ObjectCycle {
>     Object obj;
>     	
>     public String toString() {
>         return new ToStringBuilder(this).append(obj).toString();
>     }
> }
> public void testObjectCycle() {
>     ObjectCycle a = new ObjectCycle();
>     ObjectCycle b = new ObjectCycle();
>     a.obj = b;
>     b.obj = a;
>     a.toString();  // ouch: StackOverflowError    	
> }
> I'll submit some patches that fixes this problem...
> regards,
> Maarten

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


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


Mime
View raw message