Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Debugging List<Class> object in eclipse? [closed]

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

I have this code which returns the response in the form of a list , i want to check the value stored in "responseQueueList"

like image 353
Akshay Shah Avatar asked Aug 11 '26 05:08

Akshay Shah


1 Answers

If the program is paused after the line that initializes responseQueueList, you can just mouse-over the word responseQueueList to see its value and the fields of the object it refers to (and its fields, and the objects they refer to, and their fields, etc...).

Eclipse won't show you the contents of the collection directly, but it will show you the fields, which you can look through (for example, ArrayLists store their contents in an array referenced by the field elementData).

If this is too inconvenient, you could also try adding responseQueueList.toString() in the Expressions view (either Window -> Show View -> Expressions or Window -> Show View -> Other... -> Debug -> Expressions)

like image 50
user253751 Avatar answered Aug 12 '26 19:08

user253751