I am trying to view the instance variables values of the Arraylist in eclipse in debug mode but apart from the values in the list am unable to view variables like elementData or modCount that are part of the arraylist. I have tried using Watch, Display option as well but to no avail. Below is my screenshot after setting the breakpoint and triggering the program run:

Below is the screenshot that I found in one of the websites where the instance variables like elementData,modCount and size are visible:

In the current version (Oxygen.3) the default formatter for Collection shows only the members of the collection as an array. I'm not sure when the more detailed formatter was removed, but you can easily create a logical structure formatter.
Right click on the variable in the Variables tab and select Show Logical Structure/Edit Logical Structure

Your view will have the Collection entry hilighted, and won't contain the ArrayList entry I just created.
Add a new entry:

Provide the class name you want to format, and a description. Select List of Variables and then add the variables you want to display, providing a code snippet for each one. The code snippet executes as a method of the class.

End result:

In oxygen, "Show Logical Structure" is enabled by default. All you have to do is click on it to disable it.

[Image taken from eclipse.org]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With