test_class.file: dubbo-common/src/test/java/org/apache/dubbo/common/threadpool/support/eager/TaskQueueTest.java
test_class.identifier: TaskQueueTest
test_case.body: @Test
      public void testOffer1() throws Exception {
          Assertions.assertThrows(RejectedExecutionException.class, () -> {
              TaskQueue<Runnable> queue = new TaskQueue<Runnable>(1);
              queue.offer(mock(Runnable.class));
          });
      }
test_case.class_method_signature: TaskQueueTest.testOffer1()
test_case.full_signature: @Test public void testOffer1()
test_case.identifier: testOffer1
test_case.invocations: assertThrows offer mock
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testOffer1()
focal_class.declarator: serialVersionUID = -2635853580887179627L
focal_class.modifier: private static final
focal_class.original_string: private static final long serialVersionUID = -2635853580887179627L;
focal_class.type: long
focal_class.var_name: serialVersionUID
focal_class.declarator: executor
focal_class.modifier: private
focal_class.original_string: private EagerThreadPoolExecutor executor;
focal_class.type: EagerThreadPoolExecutor
focal_class.var_name: executor
focal_class.file: dubbo-common/src/main/java/org/apache/dubbo/common/threadpool/support/eager/TaskQueue.java
focal_class.identifier: TaskQueue
focal_class.class_method_signature: TaskQueue.TaskQueue(int capacity)
focal_class.full_signature: public  TaskQueue(int capacity)
focal_class.identifier: TaskQueue
focal_class.modifiers: public
focal_class.parameters: (int capacity)
focal_class.signature:  TaskQueue(int capacity)
focal_class.class_method_signature: TaskQueue.setExecutor(EagerThreadPoolExecutor exec)
focal_class.full_signature: public void setExecutor(EagerThreadPoolExecutor exec)
focal_class.identifier: setExecutor
focal_class.modifiers: public
focal_class.parameters: (EagerThreadPoolExecutor exec)
focal_class.return: void
focal_class.signature: void setExecutor(EagerThreadPoolExecutor exec)
focal_class.class_method_signature: TaskQueue.offer(Runnable runnable)
focal_class.full_signature: @Override public boolean offer(Runnable runnable)
focal_class.identifier: offer
focal_class.modifiers: @Override public
focal_class.parameters: (Runnable runnable)
focal_class.return: boolean
focal_class.signature: boolean offer(Runnable runnable)
focal_class.class_method_signature: TaskQueue.retryOffer(Runnable o, long timeout, TimeUnit unit)
focal_class.full_signature: public boolean retryOffer(Runnable o, long timeout, TimeUnit unit)
focal_class.identifier: retryOffer
focal_class.modifiers: public
focal_class.parameters: (Runnable o, long timeout, TimeUnit unit)
focal_class.return: boolean
focal_class.signature: boolean retryOffer(Runnable o, long timeout, TimeUnit unit)
focal_class.superclass: extends LinkedBlockingQueue<Runnable>
focal_method.body: @Override
      public boolean offer(Runnable runnable) {
          if (executor == null) {
              throw new RejectedExecutionException("The task queue does not have executor!");
          }
  
          int currentPoolThreadSize = executor.getPoolSize();
          // have free worker. put task into queue to let the worker deal with task.
          if (executor.getSubmittedTaskCount() < currentPoolThreadSize) {
              return super.offer(runnable);
          }
  
          // return false to let executor create new worker.
          if (currentPoolThreadSize < executor.getMaximumPoolSize()) {
              return false;
          }
  
          // currentPoolThreadSize >= max
          return super.offer(runnable);
      }
focal_method.class_method_signature: TaskQueue.offer(Runnable runnable)
focal_method.full_signature: @Override public boolean offer(Runnable runnable)
focal_method.identifier: offer
focal_method.invocations: getPoolSize getSubmittedTaskCount offer getMaximumPoolSize offer
focal_method.modifiers: @Override public
focal_method.parameters: (Runnable runnable)
focal_method.return: boolean
focal_method.signature: boolean offer(Runnable runnable)