So I was working on a fitness app that I have been on for quite some time. We were getting this weird defect where calories weren't increasing but distance was.. so I investigated. I started de-bugging, and saw duration was coming in as whole numbers, 0, 5.0, 2.0, etc. Yet this value was a double. The code below is part of a module, that we import as an .aar dependency via maven.
Here is the actual source code:
double duration = (System.currentTimeMillis() - mPreviousTimestamp) / 1000;
The decompiled class file, which I was de-bugging from:
double duration = (double)((System.currentTimeMillis() - this.mPreviousTimestamp) / 1000L);
Any thoughts as to, why this is happening, and a possible solution? Has anyone else seen this?