test_class.declarator: scheduler = new SchedulerImpl()
test_class.modifier: private
test_class.original_string: private SchedulerImpl scheduler = new SchedulerImpl();
test_class.type: SchedulerImpl
test_class.var_name: scheduler
test_class.file: bundles/org.openhab.core/src/test/java/org/openhab/core/internal/scheduler/SchedulerImplTest.java
test_class.identifier: SchedulerImplTest
test_case.body: @Test
      @Timeout(value = 1, unit = TimeUnit.SECONDS)
      public void testScheduleException() throws InterruptedException {
          Semaphore s = new Semaphore(0);
          TestSchedulerTemporalAdjuster temporalAdjuster = new TestSchedulerTemporalAdjuster();
          SchedulerRunnable runnable = () -> {
              // Pass a exception not very likely thrown by the scheduler it self to avoid missing real exceptions.
              throw new FileNotFoundException("testBeforeTimeoutException");
          };
  
          ScheduledCompletableFuture<Void> schedule = scheduler.schedule(runnable, temporalAdjuster);
          schedule.getPromise().exceptionally(e -> {
              if (e instanceof FileNotFoundException) {
                  s.release();
              }
              return null;
          });
          s.acquire(1);
          Thread.sleep(300); // wait a little longer to see if not more are scheduled.
          assertEquals(0, s.availablePermits(), "Scheduler should not have released more after cancel");
          assertEquals(0, temporalAdjuster.getCount(), "Scheduler should have run 0 time");
      }
test_case.class_method_signature: SchedulerImplTest.testScheduleException()
test_case.full_signature: @Test @Timeout(value = 1, unit = TimeUnit.SECONDS) public void testScheduleException()
test_case.identifier: testScheduleException
test_case.invocations: schedule exceptionally getPromise release acquire sleep assertEquals availablePermits assertEquals getCount
test_case.modifiers: @Test @Timeout(value = 1, unit = TimeUnit.SECONDS) public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testScheduleException()
focal_class.declarator: SCHEDULER_THREAD_POOL = "scheduler"
focal_class.modifier: private static final
focal_class.original_string: private static final String SCHEDULER_THREAD_POOL = "scheduler";
focal_class.type: String
focal_class.var_name: SCHEDULER_THREAD_POOL
focal_class.declarator: logger = LoggerFactory.getLogger(SchedulerImpl.class)
focal_class.modifier: private final
focal_class.original_string: private final Logger logger = LoggerFactory.getLogger(SchedulerImpl.class);
focal_class.type: Logger
focal_class.var_name: logger
focal_class.declarator: clock = Clock.systemDefaultZone()
focal_class.modifier: private final
focal_class.original_string: private final Clock clock = Clock.systemDefaultZone();
focal_class.type: Clock
focal_class.var_name: clock
focal_class.declarator: executor = ThreadPoolManager.getScheduledPool(SCHEDULER_THREAD_POOL)
focal_class.modifier: private final
focal_class.original_string: private final ScheduledExecutorService executor = ThreadPoolManager.getScheduledPool(SCHEDULER_THREAD_POOL);
focal_class.type: ScheduledExecutorService
focal_class.var_name: executor
focal_class.file: bundles/org.openhab.core/src/main/java/org/openhab/core/internal/scheduler/SchedulerImpl.java
focal_class.identifier: SchedulerImpl
focal_class.interfaces: implements Scheduler
focal_class.class_method_signature: SchedulerImpl.after(Duration duration)
focal_class.full_signature: @Override public ScheduledCompletableFuture<Instant> after(Duration duration)
focal_class.identifier: after
focal_class.modifiers: @Override public
focal_class.parameters: (Duration duration)
focal_class.return: ScheduledCompletableFuture<Instant>
focal_class.signature: ScheduledCompletableFuture<Instant> after(Duration duration)
focal_class.class_method_signature: SchedulerImpl.after(Callable<T> callable, Duration duration)
focal_class.full_signature: @Override public ScheduledCompletableFuture<T> after(Callable<T> callable, Duration duration)
focal_class.identifier: after
focal_class.modifiers: @Override public
focal_class.parameters: (Callable<T> callable, Duration duration)
focal_class.return: ScheduledCompletableFuture<T>
focal_class.signature: ScheduledCompletableFuture<T> after(Callable<T> callable, Duration duration)
focal_class.class_method_signature: SchedulerImpl.afterInternal(ScheduledCompletableFutureOnce<T> deferred,
              Callable<T> callable, Duration duration)
focal_class.full_signature: private ScheduledCompletableFutureOnce<T> afterInternal(ScheduledCompletableFutureOnce<T> deferred,
              Callable<T> callable, Duration duration)
focal_class.identifier: afterInternal
focal_class.modifiers: private
focal_class.parameters: (ScheduledCompletableFutureOnce<T> deferred,
              Callable<T> callable, Duration duration)
focal_class.return: ScheduledCompletableFutureOnce<T>
focal_class.signature: ScheduledCompletableFutureOnce<T> afterInternal(ScheduledCompletableFutureOnce<T> deferred,
              Callable<T> callable, Duration duration)
focal_class.class_method_signature: SchedulerImpl.before(CompletableFuture<T> promise, Duration timeout)
focal_class.full_signature: @Override public ScheduledCompletableFuture<T> before(CompletableFuture<T> promise, Duration timeout)
focal_class.identifier: before
focal_class.modifiers: @Override public
focal_class.parameters: (CompletableFuture<T> promise, Duration timeout)
focal_class.return: ScheduledCompletableFuture<T>
focal_class.signature: ScheduledCompletableFuture<T> before(CompletableFuture<T> promise, Duration timeout)
focal_class.class_method_signature: SchedulerImpl.at(Instant instant)
focal_class.full_signature: @Override public ScheduledCompletableFuture<Instant> at(Instant instant)
focal_class.identifier: at
focal_class.modifiers: @Override public
focal_class.parameters: (Instant instant)
focal_class.return: ScheduledCompletableFuture<Instant>
focal_class.signature: ScheduledCompletableFuture<Instant> at(Instant instant)
focal_class.class_method_signature: SchedulerImpl.at(Callable<T> callable, Instant instant)
focal_class.full_signature: @Override public ScheduledCompletableFuture<T> at(Callable<T> callable, Instant instant)
focal_class.identifier: at
focal_class.modifiers: @Override public
focal_class.parameters: (Callable<T> callable, Instant instant)
focal_class.return: ScheduledCompletableFuture<T>
focal_class.signature: ScheduledCompletableFuture<T> at(Callable<T> callable, Instant instant)
focal_class.class_method_signature: SchedulerImpl.atInternal(ScheduledCompletableFutureOnce<T> deferred,
              Callable<T> callable, Instant instant)
focal_class.full_signature: private ScheduledCompletableFuture<T> atInternal(ScheduledCompletableFutureOnce<T> deferred,
              Callable<T> callable, Instant instant)
focal_class.identifier: atInternal
focal_class.modifiers: private
focal_class.parameters: (ScheduledCompletableFutureOnce<T> deferred,
              Callable<T> callable, Instant instant)
focal_class.return: ScheduledCompletableFuture<T>
focal_class.signature: ScheduledCompletableFuture<T> atInternal(ScheduledCompletableFutureOnce<T> deferred,
              Callable<T> callable, Instant instant)
focal_class.class_method_signature: SchedulerImpl.schedule(SchedulerRunnable runnable, TemporalAdjuster temporalAdjuster)
focal_class.full_signature: @Override public ScheduledCompletableFuture<T> schedule(SchedulerRunnable runnable, TemporalAdjuster temporalAdjuster)
focal_class.identifier: schedule
focal_class.modifiers: @Override public
focal_class.parameters: (SchedulerRunnable runnable, TemporalAdjuster temporalAdjuster)
focal_class.return: ScheduledCompletableFuture<T>
focal_class.signature: ScheduledCompletableFuture<T> schedule(SchedulerRunnable runnable, TemporalAdjuster temporalAdjuster)
focal_class.class_method_signature: SchedulerImpl.schedule(ScheduledCompletableFutureRecurring<T> schedule, SchedulerRunnable runnable,
              TemporalAdjuster temporalAdjuster)
focal_class.full_signature: private void schedule(ScheduledCompletableFutureRecurring<T> schedule, SchedulerRunnable runnable,
              TemporalAdjuster temporalAdjuster)
focal_class.identifier: schedule
focal_class.modifiers: private
focal_class.parameters: (ScheduledCompletableFutureRecurring<T> schedule, SchedulerRunnable runnable,
              TemporalAdjuster temporalAdjuster)
focal_class.return: void
focal_class.signature: void schedule(ScheduledCompletableFutureRecurring<T> schedule, SchedulerRunnable runnable,
              TemporalAdjuster temporalAdjuster)
focal_method.body: @Override
      public <T> ScheduledCompletableFuture<T> schedule(SchedulerRunnable runnable, TemporalAdjuster temporalAdjuster) {
          final ScheduledCompletableFutureRecurring<T> schedule = new ScheduledCompletableFutureRecurring<>();
  
          schedule(schedule, runnable, temporalAdjuster);
          return schedule;
      }
focal_method.class_method_signature: SchedulerImpl.schedule(SchedulerRunnable runnable, TemporalAdjuster temporalAdjuster)
focal_method.full_signature: @Override public ScheduledCompletableFuture<T> schedule(SchedulerRunnable runnable, TemporalAdjuster temporalAdjuster)
focal_method.identifier: schedule
focal_method.invocations: schedule
focal_method.modifiers: @Override public
focal_method.parameters: (SchedulerRunnable runnable, TemporalAdjuster temporalAdjuster)
focal_method.return: ScheduledCompletableFuture<T>
focal_method.signature: ScheduledCompletableFuture<T> schedule(SchedulerRunnable runnable, TemporalAdjuster temporalAdjuster)