test_class.file: rxjava/src/test/java/io/reactivex/internal/util/QueueDrainHelperTest.java
test_class.identifier: QueueDrainHelperTest
test_case.body: @Test
      public void checkTerminatedDelayErrorEmpty() {
          TestSubscriber<Integer> ts = new TestSubscriber<Integer>();
          ts.onSubscribe(new BooleanSubscription());
  
          QueueDrain<Integer, Integer> qd = new QueueDrain<Integer, Integer>() {
              @Override
              public boolean cancelled() {
                  return false;
              }
  
              @Override
              public boolean done() {
                  return false;
              }
  
              @Override
              public Throwable error() {
                  return null;
              }
  
              @Override
              public boolean enter() {
                  return true;
              }
  
              @Override
              public long requested() {
                  return 0;
              }
  
              @Override
              public long produced(long n) {
                  return 0;
              }
  
              @Override
              public int leave(int m) {
                  return 0;
              }
  
              @Override
              public boolean accept(Subscriber<? super Integer> a, Integer v) {
                  return false;
              }
          };
  
          SpscArrayQueue<Integer> q = new SpscArrayQueue<Integer>(32);
  
          QueueDrainHelper.checkTerminated(true, true, ts, true, q, qd);
  
          ts.assertResult();
      }
test_case.class_method_signature: QueueDrainHelperTest.checkTerminatedDelayErrorEmpty()
test_case.full_signature: @Test public void checkTerminatedDelayErrorEmpty()
test_case.identifier: checkTerminatedDelayErrorEmpty
test_case.invocations: onSubscribe checkTerminated assertResult
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void checkTerminatedDelayErrorEmpty()
focal_class.declarator: COMPLETED_MASK = 0x8000000000000000L
focal_class.modifier: static final
focal_class.original_string: static final long COMPLETED_MASK = 0x8000000000000000L;
focal_class.type: long
focal_class.var_name: COMPLETED_MASK
focal_class.declarator: REQUESTED_MASK = 0x7FFFFFFFFFFFFFFFL
focal_class.modifier: static final
focal_class.original_string: static final long REQUESTED_MASK = 0x7FFFFFFFFFFFFFFFL;
focal_class.type: long
focal_class.var_name: REQUESTED_MASK
focal_class.file: rxjava/src/main/java/io/reactivex/internal/util/QueueDrainHelper.java
focal_class.identifier: QueueDrainHelper
focal_class.class_method_signature: QueueDrainHelper.QueueDrainHelper()
focal_class.full_signature: private  QueueDrainHelper()
focal_class.identifier: QueueDrainHelper
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.signature:  QueueDrainHelper()
focal_class.class_method_signature: QueueDrainHelper.drainMaxLoop(SimplePlainQueue<T> q, Subscriber<? super U> a, boolean delayError,
              Disposable dispose, QueueDrain<T, U> qd)
focal_class.full_signature: public static void drainMaxLoop(SimplePlainQueue<T> q, Subscriber<? super U> a, boolean delayError,
              Disposable dispose, QueueDrain<T, U> qd)
focal_class.identifier: drainMaxLoop
focal_class.modifiers: public static
focal_class.parameters: (SimplePlainQueue<T> q, Subscriber<? super U> a, boolean delayError,
              Disposable dispose, QueueDrain<T, U> qd)
focal_class.return: void
focal_class.signature: void drainMaxLoop(SimplePlainQueue<T> q, Subscriber<? super U> a, boolean delayError,
              Disposable dispose, QueueDrain<T, U> qd)
focal_class.class_method_signature: QueueDrainHelper.checkTerminated(boolean d, boolean empty,
              Subscriber<?> s, boolean delayError, SimpleQueue<?> q, QueueDrain<T, U> qd)
focal_class.full_signature: public static boolean checkTerminated(boolean d, boolean empty,
              Subscriber<?> s, boolean delayError, SimpleQueue<?> q, QueueDrain<T, U> qd)
focal_class.identifier: checkTerminated
focal_class.modifiers: public static
focal_class.parameters: (boolean d, boolean empty,
              Subscriber<?> s, boolean delayError, SimpleQueue<?> q, QueueDrain<T, U> qd)
focal_class.return: boolean
focal_class.signature: boolean checkTerminated(boolean d, boolean empty,
              Subscriber<?> s, boolean delayError, SimpleQueue<?> q, QueueDrain<T, U> qd)
focal_class.class_method_signature: QueueDrainHelper.drainLoop(SimplePlainQueue<T> q, Observer<? super U> a, boolean delayError, Disposable dispose, ObservableQueueDrain<T, U> qd)
focal_class.full_signature: public static void drainLoop(SimplePlainQueue<T> q, Observer<? super U> a, boolean delayError, Disposable dispose, ObservableQueueDrain<T, U> qd)
focal_class.identifier: drainLoop
focal_class.modifiers: public static
focal_class.parameters: (SimplePlainQueue<T> q, Observer<? super U> a, boolean delayError, Disposable dispose, ObservableQueueDrain<T, U> qd)
focal_class.return: void
focal_class.signature: void drainLoop(SimplePlainQueue<T> q, Observer<? super U> a, boolean delayError, Disposable dispose, ObservableQueueDrain<T, U> qd)
focal_class.class_method_signature: QueueDrainHelper.checkTerminated(boolean d, boolean empty,
              Observer<?> s, boolean delayError, SimpleQueue<?> q, Disposable disposable, ObservableQueueDrain<T, U> qd)
focal_class.full_signature: public static boolean checkTerminated(boolean d, boolean empty,
              Observer<?> s, boolean delayError, SimpleQueue<?> q, Disposable disposable, ObservableQueueDrain<T, U> qd)
focal_class.identifier: checkTerminated
focal_class.modifiers: public static
focal_class.parameters: (boolean d, boolean empty,
              Observer<?> s, boolean delayError, SimpleQueue<?> q, Disposable disposable, ObservableQueueDrain<T, U> qd)
focal_class.return: boolean
focal_class.signature: boolean checkTerminated(boolean d, boolean empty,
              Observer<?> s, boolean delayError, SimpleQueue<?> q, Disposable disposable, ObservableQueueDrain<T, U> qd)
focal_class.class_method_signature: QueueDrainHelper.createQueue(int capacityHint)
focal_class.full_signature: public static SimpleQueue<T> createQueue(int capacityHint)
focal_class.identifier: createQueue
focal_class.modifiers: public static
focal_class.parameters: (int capacityHint)
focal_class.return: SimpleQueue<T>
focal_class.signature: SimpleQueue<T> createQueue(int capacityHint)
focal_class.class_method_signature: QueueDrainHelper.request(Subscription s, int prefetch)
focal_class.full_signature: public static void request(Subscription s, int prefetch)
focal_class.identifier: request
focal_class.modifiers: public static
focal_class.parameters: (Subscription s, int prefetch)
focal_class.return: void
focal_class.signature: void request(Subscription s, int prefetch)
focal_class.class_method_signature: QueueDrainHelper.postCompleteRequest(long n,
                                                    Subscriber<? super T> actual,
                                                    Queue<T> queue,
                                                    AtomicLong state,
                                                    BooleanSupplier isCancelled)
focal_class.full_signature: public static boolean postCompleteRequest(long n,
                                                    Subscriber<? super T> actual,
                                                    Queue<T> queue,
                                                    AtomicLong state,
                                                    BooleanSupplier isCancelled)
focal_class.identifier: postCompleteRequest
focal_class.modifiers: public static
focal_class.parameters: (long n,
                                                    Subscriber<? super T> actual,
                                                    Queue<T> queue,
                                                    AtomicLong state,
                                                    BooleanSupplier isCancelled)
focal_class.return: boolean
focal_class.signature: boolean postCompleteRequest(long n,
                                                    Subscriber<? super T> actual,
                                                    Queue<T> queue,
                                                    AtomicLong state,
                                                    BooleanSupplier isCancelled)
focal_class.class_method_signature: QueueDrainHelper.isCancelled(BooleanSupplier cancelled)
focal_class.full_signature: static boolean isCancelled(BooleanSupplier cancelled)
focal_class.identifier: isCancelled
focal_class.modifiers: static
focal_class.parameters: (BooleanSupplier cancelled)
focal_class.return: boolean
focal_class.signature: boolean isCancelled(BooleanSupplier cancelled)
focal_class.class_method_signature: QueueDrainHelper.postCompleteDrain(long n,
                                           Subscriber<? super T> actual,
                                           Queue<T> queue,
                                           AtomicLong state,
                                           BooleanSupplier isCancelled)
focal_class.full_signature: static boolean postCompleteDrain(long n,
                                           Subscriber<? super T> actual,
                                           Queue<T> queue,
                                           AtomicLong state,
                                           BooleanSupplier isCancelled)
focal_class.identifier: postCompleteDrain
focal_class.modifiers: static
focal_class.parameters: (long n,
                                           Subscriber<? super T> actual,
                                           Queue<T> queue,
                                           AtomicLong state,
                                           BooleanSupplier isCancelled)
focal_class.return: boolean
focal_class.signature: boolean postCompleteDrain(long n,
                                           Subscriber<? super T> actual,
                                           Queue<T> queue,
                                           AtomicLong state,
                                           BooleanSupplier isCancelled)
focal_class.class_method_signature: QueueDrainHelper.postComplete(Subscriber<? super T> actual,
                                          Queue<T> queue,
                                          AtomicLong state,
                                          BooleanSupplier isCancelled)
focal_class.full_signature: public static void postComplete(Subscriber<? super T> actual,
                                          Queue<T> queue,
                                          AtomicLong state,
                                          BooleanSupplier isCancelled)
focal_class.identifier: postComplete
focal_class.modifiers: public static
focal_class.parameters: (Subscriber<? super T> actual,
                                          Queue<T> queue,
                                          AtomicLong state,
                                          BooleanSupplier isCancelled)
focal_class.return: void
focal_class.signature: void postComplete(Subscriber<? super T> actual,
                                          Queue<T> queue,
                                          AtomicLong state,
                                          BooleanSupplier isCancelled)
focal_method.body: public static <T, U> boolean checkTerminated(boolean d, boolean empty,
              Subscriber<?> s, boolean delayError, SimpleQueue<?> q, QueueDrain<T, U> qd) {
          if (qd.cancelled()) {
              q.clear();
              return true;
          }
  
          if (d) {
              if (delayError) {
                  if (empty) {
                      Throwable err = qd.error();
                      if (err != null) {
                          s.onError(err);
                      } else {
                          s.onComplete();
                      }
                      return true;
                  }
              } else {
                  Throwable err = qd.error();
                  if (err != null) {
                      q.clear();
                      s.onError(err);
                      return true;
                  } else
                  if (empty) {
                      s.onComplete();
                      return true;
                  }
              }
          }
  
          return false;
      }
focal_method.class_method_signature: QueueDrainHelper.checkTerminated(boolean d, boolean empty,
              Subscriber<?> s, boolean delayError, SimpleQueue<?> q, QueueDrain<T, U> qd)
focal_method.full_signature: public static boolean checkTerminated(boolean d, boolean empty,
              Subscriber<?> s, boolean delayError, SimpleQueue<?> q, QueueDrain<T, U> qd)
focal_method.identifier: checkTerminated
focal_method.invocations: cancelled clear error onError onComplete error clear onError onComplete
focal_method.modifiers: public static
focal_method.parameters: (boolean d, boolean empty,
              Subscriber<?> s, boolean delayError, SimpleQueue<?> q, QueueDrain<T, U> qd)
focal_method.return: boolean
focal_method.signature: boolean checkTerminated(boolean d, boolean empty,
              Subscriber<?> s, boolean delayError, SimpleQueue<?> q, QueueDrain<T, U> qd)