Eclipse调试HashMap:使用Key和Value的toString()方法进行逻辑结构 [英] Eclipse debugging HashMap: Logical Structure using Key and Value's toString() method
问题描述
我最近在使用IntelliJ几年后才开始使用Eclipse。当使用IntelliJ调试Map时,如果键或对象实现toString(),则会显示一个不错的键值字符串表示形式。
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 string representation of key-value is displayed.
在Eclipse中,当我选择显示逻辑结构,我看到如下所示:
In Eclipse, when I select Show Logical Structure, I see something like the following:
此视图的问题是您需要展开每个条目才能看到实际的键和价值。如果你需要在地图上找到超过10个元素的东西,那将变得非常乏味。
我明白你可以制作自定义逻辑结构Map的默认值为:
I understand that you can make custom Logical Structure and the default for Map look the this:
return entrySet().toArray();
有没有办法,通过自定义逻辑结构或插件以查看比
Is there any way, either through custom Logical Structure or plugin to view Map Entries more useful than
ConcurrentHashMap$WriteThroughEntry (id=193)
推荐答案
我发现当我在调试器的变量窗格中选择一个值,其值如下所示,使用toString()方法。例如,这对地图非常有用。
I find that when I select a value in the "Variables" pane in the debugger, its value is shown below using the toString() method. This works nicely for maps, for example.
这篇关于Eclipse调试HashMap:使用Key和Value的toString()方法进行逻辑结构的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!