File tree 5 files changed +11
-8
lines changed
main/java/org/springframework/scheduling/concurrent
test/java/org/springframework/scheduling/concurrent
5 files changed +11
-8
lines changed Original file line number Diff line number Diff line change 1
1
/*
2
- * Copyright 2002-2023 the original author or authors.
2
+ * Copyright 2002-2024 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
@@ -191,6 +191,7 @@ public void setErrorHandler(ErrorHandler errorHandler) {
191
191
* @see Clock#systemDefaultZone()
192
192
*/
193
193
public void setClock (Clock clock ) {
194
+ Assert .notNull (clock , "Clock must not be null" );
194
195
this .clock = clock ;
195
196
}
196
197
Original file line number Diff line number Diff line change 41
41
import org .springframework .scheduling .Trigger ;
42
42
import org .springframework .scheduling .support .DelegatingErrorHandlingRunnable ;
43
43
import org .springframework .scheduling .support .TaskUtils ;
44
+ import org .springframework .util .Assert ;
44
45
import org .springframework .util .ErrorHandler ;
45
46
46
47
/**
@@ -114,10 +115,10 @@ public class SimpleAsyncTaskScheduler extends SimpleAsyncTaskExecutor implements
114
115
/**
115
116
* Set the clock to use for scheduling purposes.
116
117
* <p>The default clock is the system clock for the default time zone.
117
- * @since 5.3
118
118
* @see Clock#systemDefaultZone()
119
119
*/
120
120
public void setClock (Clock clock ) {
121
+ Assert .notNull (clock , "Clock must not be null" );
121
122
this .clock = clock ;
122
123
}
123
124
Original file line number Diff line number Diff line change 1
1
/*
2
- * Copyright 2002-2023 the original author or authors.
2
+ * Copyright 2002-2024 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
@@ -159,6 +159,7 @@ public void setErrorHandler(ErrorHandler errorHandler) {
159
159
* @see Clock#systemDefaultZone()
160
160
*/
161
161
public void setClock (Clock clock ) {
162
+ Assert .notNull (clock , "Clock must not be null" );
162
163
this .clock = clock ;
163
164
}
164
165
Original file line number Diff line number Diff line change 1
1
/*
2
- * Copyright 2002-2023 the original author or authors.
2
+ * Copyright 2002-2024 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
17
17
package org .springframework .scheduling .concurrent ;
18
18
19
19
import java .util .concurrent .Executor ;
20
+ import java .util .concurrent .Future ;
20
21
import java .util .concurrent .LinkedBlockingQueue ;
21
- import java .util .concurrent .RunnableFuture ;
22
22
import java .util .concurrent .ThreadPoolExecutor ;
23
23
import java .util .concurrent .TimeUnit ;
24
24
@@ -52,8 +52,8 @@ protected org.springframework.core.task.AsyncListenableTaskExecutor buildExecuto
52
52
@ AfterEach
53
53
void shutdownExecutor () {
54
54
for (Runnable task : concurrentExecutor .shutdownNow ()) {
55
- if (task instanceof RunnableFuture ) {
56
- ((RunnableFuture <?>) task ).cancel (true );
55
+ if (task instanceof Future ) {
56
+ ((Future <?>) task ).cancel (true );
57
57
}
58
58
}
59
59
}
Original file line number Diff line number Diff line change @@ -147,7 +147,7 @@ private void await(CountDownLatch latch) {
147
147
catch (InterruptedException ex ) {
148
148
throw new IllegalStateException (ex );
149
149
}
150
- assertThat (latch .getCount ()).as ("latch did not count down, " ).isEqualTo (0 );
150
+ assertThat (latch .getCount ()).as ("latch did not count down" ).isEqualTo (0 );
151
151
}
152
152
153
153
You can’t perform that action at this time.
0 commit comments