Rob Spoor wrote:
Mike London wrote:
That's probably the cause. When you truncate the last modification timestamps, you lose information. Those ints may very well be negative. Use Long.compare instead:
The static compare methods have been added in Java 7 to all of the primitive wrappers (including Boolean). There is no need to box primitives anymore.
Yes, it was old code, thanks!
My issue appeared to be that in the old code, possibly due to the issue you raised, I was taking the last value in the list, which works on Windows 2003 server and earlier versions of the JDK. However, in Java 8 and Windows 2012 server (assuming Windows has nothing to actually do with any of this), I need the top value on the sorted list.
However, I get the same results with the old code and the new (your) code.
In any case, I've simplified that ugly boxing from the old code and made it much cleaner looking.
Thanks!!!
- mike