Yes, that makes more sense to me. I forgot that
System.identityHashCode(this) was available.
On 7/26/06, Andrus Adamchik <[EMAIL PROTECTED]> wrote:
+1 with this modification:
public String toString() {
return getClass().getName() + "@" + System.identityHashCode(this);
}
On Jul 26, 2006, at 6:57 PM, Mike Kienenberger wrote:
> Here's a proposal for a slightly-better toString() with no side
> effects:
>
> private int unresolvedHashCode() {
> return 15 + objectList.hashCode();
> }
>
> public String toString() {
> return getClass().getName() + "@" +
> Integer.toHexString(unresolvedHashCode());
> }
>
>
> On 7/26/06, Mike Kienenberger <[EMAIL PROTECTED]> wrote:
>> On 7/26/06, Andrus Adamchik <[EMAIL PROTECTED]> wrote:
>> > BTW LinkedList is hard to debug as it only shows one element at a
>> > time, hiding the rest of the chain.
>>
>> Another thing that makes debugging ToManyList hard is that it calls
>> resolvedObjectList() in all of the standard methods.
>>
>> I think we want to consider creating a custom toString() method that
>> shows the object state as-is instead of using the default toString()
>> which calls hashCode().
>>
>