Craig
Craig

Reputation: 3307

Java executes "if" block when condition is demonstrably false

Screen shot of my problem.

This pretty much says it all. paneNum is 0. Test for paneNum < 0 is apparently true since the instruction pointer is inside the if-block, and the function returns false.

Any ideas?

Upvotes: 1

Views: 164

Answers (2)

Grammin
Grammin

Reputation: 12215

Are you working with the most updated version of the file that you're debugging. You could think that you are in the statement and not be actually there. Also run in display mode while you're at that breakpoint something like:

System.out.println(paneNum);
System.out.println(paneNum < 0);

Upvotes: 1

dbyrne
dbyrne

Reputation: 61081

Was the conditional changed recently from something like paneNum <= 0? My guess is that there is a synchronization issue between the code being executed and the code you are debugging.

Try cleaning the project and rebuilding it. I suspect it will work fine.

Upvotes: 2

Related Questions