Eclipse debugging HashMap: Logical Structure using Key and Value's toString() method

前端 未结 4 1498
青春惊慌失措
青春惊慌失措 2021-01-30 18:29

I have recently started to use Eclipse after using IntelliJ for a few years. When debugging Map using IntelliJ, if the key or object implements toString(), a nice list of strin

4条回答
  •  春和景丽
    2021-01-30 19:00

    You need to create a detail formatter on top of the logical structure. In the example screenshot you provided, your logical structure is ConcurrentHashMap$WriteThroughEntry. You can add the detail formatter by right clicking on a row containing a ConcurrentHashMap$WriteThroughEntry and selecting 'add detail formatter'.

    I just knocked up this example using HashMap.

    enter image description here

    java.util.HashMap$Entry //  key + " - " + value
    

    For a

    HashMap map;
    

    .. I quickly populated with rubbish, I now see:

    enter image description here

提交回复
热议问题