Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

hide non-exists variables in Eclipse java debugger

for example I have an ArrayList with 2 elements, but Eclipse Java debugger shows me 10 elements where 3-10 are just nulls. How to disable this "feature"?

details on image
http://img.skitch.com/20090326-8si53ytntwy6tjgsur32qwtmm2.png

P.S.: Mac OS 10.5.6, Java6, Eclipse 3.4.2

like image 275
Igor Avatar asked Mar 26 '09 20:03

Igor


People also ask

How do I show variables in Eclipse debugger?

Variables/Expression view – Shows the declared variables and their values. Press Ctrl+Shift+d or Ctrl+Shift+i on a selected variable or expression to show its value. You can also add a permanent watch on an expression/variable that will then be shown in the Expressions view when debugging is on.

What is debug shell in Eclipse?

When we start the program in debug mode, Eclipse will prompt with an option to switch to the Debug perspective. The Debug perspective is a collection of some useful views that help us visualize and interact with the debugger. We can also switch to the Debug perspective manually at any time.


1 Answers

In the "Variables" view (as seen in your screenshot) click on the small downward triangle (=menu) in the top-right corner, select the "Java" sub-menu and then remove the tick in front of "Show null array entries".

(This sometimes does not work the first time. Probably a bug. Just try it until the null-values are gone in the view.)

like image 54
Tobias Müller Avatar answered Sep 21 '22 22:09

Tobias Müller