HashMap debugging showing recursive recordset? What is it?

I use HashMap<String,Serializable> , and during debugging I see the following recursively. What does it mean? Why is this so?

enter image description here

+4
source share
2 answers

HashMap$EntrySet is an inner class, it has an explicit link called this$0 in HashMap . And the HashMap has a private transient Set<Map.Entry<K,V>> entrySet that references it. So, just regular circular references.

+6
source

The HashMap instance has an entrySet field of type HashMap$EntrySet . Since the entrySet class is an internal HashMap class, it has an implicit reference to the contained instance ( this$0 ).

This is normal and is required for the entrySet instance to access the containing HashMap instance.

+5
source

All Articles