In the JavaDoc of org.cache2k.expiry.Expiry.toSharpTime(long millis) method says the method throws IllegalArgumentException - if the time value is negative. However, in the code, it returns the already negative value as negative and does not throw an exception.
From line 35 to 51 as follows:
/**
* Convert the time value to a time representing a sharp expiry.
* This essentially negates the time value and is provided for a more speaking coding style.
*
* @param millis expiry time since the milliseconds since epoch or {@link #ETERNAL} if no
* expiry is requested.
* @throws IllegalArgumentException if the time value is negative
*/
public static long toSharpTime(long millis) {
if (millis == ETERNAL) {
return ETERNAL;
}
if (millis < 0) {
return millis;
}
return -millis;
}
In the JavaDoc of org.cache2k.expiry.Expiry.toSharpTime(long millis) method says the method throws IllegalArgumentException - if the time value is negative. However, in the code, it returns the already negative value as negative and does not throw an exception. From line 35 to 51 as follows: