Pawan
Pawan

Reputation: 32321

Eclipse : Conditional Break Points inside Eclipse

I have written a small Sample program to see about Eclipse Conditional Break Points

public class Test {
    public static void main(String args[]) {
        System.out.println("One3");
        String str = null;
        String name = str;
    }
}

And inside the Eclipse Debugger Perspective , under BreakPoints , i have set condition as shown str!=null

Please see the image here of it . http://tinypic.com/view.php?pic=kdrc0g&s=5

From this what i understood is that , the condition (str!=null) doesn't meet the code , so the debugger will give a warning .

Please tell me if my understanding is correct ??

Upvotes: 0

Views: 432

Answers (3)

nimcap
nimcap

Reputation: 10493

In Debug mode, when the condition is satisfied, the code execution will pause at that point, allowing you to observe variable values, continue execution step by step and such.

Upvotes: 0

Cedric
Cedric

Reputation: 684

Is the break point defined before the str declaration ? If it's the case, it's normal this break point doesn't work because the str string is unknow.

Upvotes: 0

JB Nizet
JB Nizet

Reputation: 691715

You're putting a breakpoint with a condition on the variable str at a location where there is no variable str. So obviously, the condition is impossible to evaluate.

If the breakpoint was on the last line, then it would be valid.

Upvotes: 1

Related Questions