-
Enhancement
-
Resolution: Fixed
-
P4
-
5.0
-
b47
-
x86
-
windows_xp
Name: jl125535 Date: 06/03/2004
A DESCRIPTION OF THE REQUEST :
The largest unit in TimeUnit is seconds. This needs to also include MINUTES and HOURS so that long duration intervals can be used without resorting to wrapping TimeUnit.
JUSTIFICATION :
When specifying an interval (checking whether a file changed, timeouts, etc), it is sometimes necessary to use a larger time than SECONDS. Though MINUTES could be done by multiplying *60, it makes use of TimeUnit inconsistent.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
import static java.util.concurrent.TimeUnit.*;
long timeout = MINUTES.convertTo(5, MILLISECONDS);
ACTUAL -
import static java.util.concurrent.TimeUnit.*;
long timeout = SECONDS.convertTo(5, MILLISECONDS) * 60;
---------- BEGIN SOURCE ----------
no compilable TimeUnit.MINUTES available.
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
import static java.util.concurrent.TimeUnit.*;
long timeout = SECONDS.convertTo(5, MILLISECONDS) * 60;
(Incident Review ID: 276148)
======================================================================