Closed JasonFengJ9 closed 2 years ago
Do we have a test for this
There are internal tests covering two cases:
task = null
- NPE is expectedtask = null
&& time < 0
- IllegalArgumentException
is expectedI meant a criu test
Also, if task = null - NPE is expected
do we need to do anything? the task.criuAdjustRequired = true;
will thrown the NPE
Also, if task = null - NPE is expected do we need to do anything? the task.criuAdjustRequired = true; will thrown the NPE
There is no problem for NPE test, just for test reference that the task
is null
.
This fix is for IllegalArgumentException
when time < 0
.
isnt the (delay < 0)
check always done first?
Yes, the test in question escaped first check, and the delay
was set to 10000 + Long.MAX_VALUE - System.currentTimeMillis()
, and time
becomes negative after System.currentTimeMillis()+delay
.
As per javadoc - java/util/Timer.html#schedule(java.util.TimerTask,long)
IllegalArgumentException - if delay is negative, or delay + System.currentTimeMillis() is negative.
The later checking time < 0
is required for the actual time
within sched(TimerTask task, long time, long period)
, however task.criuAdjustRequired
can't be moved there due to other fixed date schedule
methods.
Okay, I understand now. Thanks
Jenkins test sanity xlinuxcriu jdk17
is there a jdk17 and jdknext version of this?
The
task
could be null.An internal test expects
IllegalArgumentException
whentask
isnull
andtime < 0
[1].[1] https://github.com/ibmruntimes/openj9-openjdk-jdk11/blob/20d13352ee5c9569416880e340d5c589161082f9/src/java.base/share/classes/java/util/Timer.java#L415-L417
Signed-off-by: Jason Feng fengj@ca.ibm.com