ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/main/java/util/concurrent/ScheduledThreadPoolExecutor.java
(Generate patch)

Comparing jsr166/src/main/java/util/concurrent/ScheduledThreadPoolExecutor.java (file contents):
Revision 1.8 by dl, Sun Dec 21 15:14:36 2003 UTC vs.
Revision 1.9 by dl, Mon Dec 22 00:48:14 2003 UTC

# Line 288 | Line 288 | public class ScheduledThreadPoolExecutor
288      }
289  
290      public ScheduledFuture<?> schedule(Runnable command, long delay,  TimeUnit unit) {
291 <        if (command == null)
291 >        if (command == null || unit == null)
292              throw new NullPointerException();
293          long triggerTime = System.nanoTime() + unit.toNanos(delay);
294          ScheduledFutureTask<?> t = new ScheduledFutureTask<Boolean>(command, null, triggerTime);
# Line 297 | Line 297 | public class ScheduledThreadPoolExecutor
297      }
298  
299      public <V> ScheduledFuture<V> schedule(Callable<V> callable, long delay, TimeUnit unit) {
300 <        if (callable == null)
300 >        if (callable == null || unit == null)
301              throw new NullPointerException();
302          long triggerTime = System.nanoTime() + unit.toNanos(delay);
303          ScheduledFutureTask<V> t = new ScheduledFutureTask<V>(callable, triggerTime);
# Line 306 | Line 306 | public class ScheduledThreadPoolExecutor
306      }
307  
308      public ScheduledFuture<?> scheduleAtFixedRate(Runnable command, long initialDelay,  long period, TimeUnit unit) {
309 <        if (command == null)
309 >        if (command == null || unit == null)
310              throw new NullPointerException();
311          if (period <= 0)
312              throw new IllegalArgumentException();
# Line 321 | Line 321 | public class ScheduledThreadPoolExecutor
321      }
322      
323      public ScheduledFuture<?> scheduleWithFixedDelay(Runnable command, long initialDelay,  long delay, TimeUnit unit) {
324 <        if (command == null)
324 >        if (command == null || unit == null)
325              throw new NullPointerException();
326          if (delay <= 0)
327              throw new IllegalArgumentException();

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines