Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

eclipse - search variable name by it's value in debugger

I'm debugging web app, which produces very complex bean as result of form, and I'd like to know if value that I entered on some form field is present somewhere or not.

Is there any way to find if some of my variables (on debug list) has given value?

PS:

There isn't any way to search thou all variables (I have hundreds of them...) shown in debug list? Problem is that this bean is made of tens of hashmaps and lists, on different levels. And real problem is that I don't really know which variable holds this value or if it wasn't saved to any variable. And I can't write such big expression cover all of variables, structure is too complex.

like image 628
dantuch Avatar asked Jan 19 '26 00:01

dantuch


1 Answers

Add a breakpoint at a location where you can access the variables you want, then add a watch for each variable and you can see the list of the values of the variables in the watch list

PS: In a watch you can write whatever Java code you want such as x.equals("value") and it will output true if equals or false if otherwise. Or you can just visualize the variable's value directly

like image 196
Adel Boutros Avatar answered Jan 21 '26 14:01

Adel Boutros