Returns unit.toNanos(time), additionally ensuring the returned value is not at risk of overflowing or underflowing, by bounding the value between 0 and (Long.MAX_VALUE / 4) 3. Actually waiting for more than 219 years is not supported!
(long time, TimeUnit unit)
| 972 | */ |
| 973 | |
| 974 | private static long toSafeNanos(long time, TimeUnit unit) { |
| 975 | long timeoutNanos = unit.toNanos(time); |
| 976 | return (timeoutNanos <= 0L) ? 0L : (timeoutNanos > (Long.MAX_VALUE / 4) * 3) ? (Long.MAX_VALUE / 4) * 3 : timeoutNanos; |
| 977 | } |
| 978 | |
| 979 | /** |
| 980 | * Returns System.nanoTime() unless the timeout has already elapsed. Returns 0L if and only if the |
no outgoing calls
no test coverage detected