https://bugs.openjdk.java.net/browse/JDK-8088918 I cannot reproduce this but I can change the code so that I fix the theoretical reasons it can occur with the provided code snippet. Basically eliminate that Math.abs() part of the check .. -phil.