test_class.file: oak-commons/src/test/java/org/apache/jackrabbit/oak/commons/concurrent/ExecutorCloserTest.java
test_class.identifier: ExecutorCloserTest
test_case.body: @Test
      public void timeoutHandling() throws Exception{
          ExecutorService executorService = Executors.newSingleThreadExecutor();
  
          final CountDownLatch latch = new CountDownLatch(1);
          executorService.submit(new Callable<Void>() {
              @Override
              public Void call() throws Exception {
                  latch.await();
                  return null;
              }
          });
          new ExecutorCloser(executorService, 100, TimeUnit.MILLISECONDS).close();
          assertTrue(executorService.isShutdown());
      }
test_case.class_method_signature: ExecutorCloserTest.timeoutHandling()
test_case.full_signature: @Test public void timeoutHandling()
test_case.identifier: timeoutHandling
test_case.invocations: newSingleThreadExecutor submit await close assertTrue isShutdown
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void timeoutHandling()
focal_class.declarator: LOG = LoggerFactory.getLogger(ExecutorCloser.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger LOG = LoggerFactory.getLogger(ExecutorCloser.class);
focal_class.type: Logger
focal_class.var_name: LOG
focal_class.declarator: executorService
focal_class.modifier: private final
focal_class.original_string: private final ExecutorService executorService;
focal_class.type: ExecutorService
focal_class.var_name: executorService
focal_class.declarator: timeout
focal_class.modifier: private final
focal_class.original_string: private final int timeout;
focal_class.type: int
focal_class.var_name: timeout
focal_class.declarator: timeUnit
focal_class.modifier: private final
focal_class.original_string: private final TimeUnit timeUnit;
focal_class.type: TimeUnit
focal_class.var_name: timeUnit
focal_class.file: oak-commons/src/main/java/org/apache/jackrabbit/oak/commons/concurrent/ExecutorCloser.java
focal_class.identifier: ExecutorCloser
focal_class.interfaces: implements Closeable
focal_class.class_method_signature: ExecutorCloser.ExecutorCloser(@Nullable ExecutorService executorService)
focal_class.full_signature: public  ExecutorCloser(@Nullable ExecutorService executorService)
focal_class.identifier: ExecutorCloser
focal_class.modifiers: public
focal_class.parameters: (@Nullable ExecutorService executorService)
focal_class.signature:  ExecutorCloser(@Nullable ExecutorService executorService)
focal_class.class_method_signature: ExecutorCloser.ExecutorCloser(@Nullable ExecutorService executorService, int timeout, TimeUnit unit)
focal_class.full_signature: public  ExecutorCloser(@Nullable ExecutorService executorService, int timeout, TimeUnit unit)
focal_class.identifier: ExecutorCloser
focal_class.modifiers: public
focal_class.parameters: (@Nullable ExecutorService executorService, int timeout, TimeUnit unit)
focal_class.signature:  ExecutorCloser(@Nullable ExecutorService executorService, int timeout, TimeUnit unit)
focal_class.class_method_signature: ExecutorCloser.close()
focal_class.full_signature: @Override public void close()
focal_class.identifier: close
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void close()
focal_method.body: @Override
      public void close() {
          if (executorService == null) {
              return;
          }
          try {
              executorService.shutdown();
              executorService.awaitTermination(timeout, timeUnit);
          } catch (InterruptedException e) {
              LOG.error("Error while shutting down the ExecutorService", e);
              Thread.currentThread().interrupt();
          } finally {
              if (!executorService.isShutdown()) {
                  LOG.warn("ExecutorService `{}` didn't shutdown property. Will be forced now.",
                      executorService);
              }
              executorService.shutdownNow();
          }
  
      }
focal_method.class_method_signature: ExecutorCloser.close()
focal_method.full_signature: @Override public void close()
focal_method.identifier: close
focal_method.invocations: shutdown awaitTermination error interrupt currentThread isShutdown warn shutdownNow
focal_method.modifiers: @Override public
focal_method.parameters: ()
focal_method.return: void
focal_method.signature: void close()