java - 在 Eclipse 中调试 List<Class> 对象?

标签 java eclipse debugging

<分区>

Restaurant responseRestaurant = restaurant_repository.findById(1L);
List<Queue> responseQueueList = queue_repository.findByRestaurantId(responseRestaurant);

我有这段代码以列表的形式返回响应,我想检查存储在“responseQueueList”中的值

最佳答案

如果程序在初始化 responseQueueList 行之后暂停,您只需将鼠标悬停在单词 responseQueueList 上即可查看其值及其引用的对象的字段到(及其字段,以及它们引用的对象,以及它们的字段等...)。

Eclipse 不会直接显示集合的内容,但会显示字段,您可以查看这些字段(例如,ArrayList 将其内容存储在引用的数组中字段 elementData)。

如果这太不方便,您也可以尝试在表达式 View 中添加 responseQueueList.toString()(Window -> Show View -> Expressions窗口 -> 显示 View -> 其他... -> 调试 -> 表达式)

关于java - 在 Eclipse 中调试 List<Class> 对象?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27838414/

相关文章:

java - 带 jdk5 的 helios 中的 windowbuilder 不起作用

java - 如何使用 Eclipse Nebula Grid 在 Eclipse 插件中创建用户输入字段?

node.js - 运行 "Request Log.enable failed"时出现错误 "node --inspect"

java - 如何获取给定函数的调用路径?

json - 如何调试 JSON 文件

java - GregorianCalendar 上的内存泄漏

java - 使用poi在java中读取excel文件

java - 未知方法 foo 的输出

java - 如何通过将它们转换为 long 来减去两次

java - 如何在 Eclipse 中将多个 Java 练习放入一个类中?