float (float value) { if (value < 0 || Double.isNaN(value)) { LOG.debug("unexpected animation value: ", value); return 0; } if (value > 1) { LOG.debug("animation value is too big: ", value); return 1; } return value; }