john2994
john2994

Reputation: 433

make debugger stop when a value occurs Intelij Idea

I am wondering if there is a way to search a specific value in variables while debugging.

For example, I have this code:

public void init(){
    int a=5;
    String s="Hello world";
    boolean enable = true;
}

I want to search for value "Hello world" in all variables. So is there a way to put this value somewhere and debugger stops at point when it finds it?

Upvotes: 0

Views: 1522

Answers (2)

ZA1NZAFAR
ZA1NZAFAR

Reputation: 165

Add a condition in your code like:

if(eventOccurs){
 //put anything here
}

and then add the breakpoint inside the condition

Upvotes: 2

Allen
Allen

Reputation: 88

You can be following like below:

if(value==you want){

 //Then debug and lookup objects values that you want to check.

 System.out.println("Seting debug point of this line!")

}

Upvotes: 1

Related Questions