8285519: Change usages of TimeUnit.convert to TimeUnit.toXXX

Reviewed-by: rriggs
This commit is contained in:
Andrey Turbanov 2022-06-16 17:29:49 +00:00
parent e7d52e25a2
commit e833c1d179
4 changed files with 24 additions and 22 deletions

View file

@ -1230,7 +1230,7 @@ public final class NioSocketImpl extends SocketImpl implements PlatformSocketImp
private static long tryLock(ReentrantLock lock, long timeout, TimeUnit unit) {
assert timeout > 0;
boolean interrupted = false;
long nanos = NANOSECONDS.convert(timeout, unit);
long nanos = unit.toNanos(timeout);
long remainingNanos = nanos;
long startNanos = System.nanoTime();
boolean acquired = false;