Fixed accidental use of JDK 1.7+ Integer/Long.compare methods

Issue: SPR-11319
Polishing