[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-2717) toString() method with cyclic associations and a dynamic model causes StackOverflowException

Stefan Wachter (JIRA) noreply at atlassian.com
Wed Jul 11 04:58:52 EDT 2007


    [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-2717?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_27443 ] 

Stefan Wachter commented on HHH-2717:
-------------------------------------

Ah - ok - you are right.

Yet, I checked the JavaDoc for Collection, Map, and List. It does not say anything about the toString() method.

It is the AbstractCollection and AbstractList classes that bring in the problematic implementation of the toString() method.

The PersistentList class is free to choose another implementation of its toString() method.

Nevertheless, I think this issue is of minor importance.

> toString() method with cyclic associations and a dynamic model causes StackOverflowException
> --------------------------------------------------------------------------------------------
>
>                 Key: HHH-2717
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2717
>             Project: Hibernate3
>          Issue Type: Bug
>    Affects Versions: 3.2.4.sp1
>         Environment: Hibernate 3.2.4.sp1; MySQL
>            Reporter: Stefan Wachter
>
> When the toString() method is called on an entity (i.e. on a HashMap) then a StackOverflow occurs.
> The members of an association are stored in map entry with a PersistentList value.
> The PersistentList in turn contains HashMaps, that contain PersistentLists again, ...
> The toString() method must take care of cycles.

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

        



More information about the hibernate-issues mailing list