Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

java why is long value in if statement validated wrong

In the below code the if statement evaluates to true but i can see its false.
Clearly there is a logic here to explain this but i cannot remember it.
2 movies showing the phenomenology:
http://www.youtube.com/watch?v=DFcRfPErfik
http://www.youtube.com/watch?v=NEC04-kLQBE

The line "holderCompleated.textInfo.setT..." will run even do diffHours==1
look at the picture, diffHours=1 and Expression windows show false

enter image description here

a summery for this question could be:
(dont be affraid to ask even the the silliest question :))

here's a picture when i enter the if statment

enter image description here

like image 372
Erik Avatar asked Oct 24 '22 19:10

Erik


1 Answers

something strange going on. im adding the Log.d(TAG,... inside the if statement and the debugger is stepping over it. Also have a Log.d(TAG,.. just before the if statement and that one is ok.

Maybe the clean-up didn't work and you're running some old code. Did you try to restart Eclipse? And then maybe delete and re-import some projects?

This would also explain why you see the debugger entering the if statement: it isn't! The running code is just not synchronized with the source code.

like image 186
Puce Avatar answered Oct 31 '22 12:10

Puce