<commit_before>package com.stanfy.enroscar.goro;

import android.os.IBinder;

import java.lang.ref.WeakReference;
import java.util.concurrent.Callable;
import java.util.concurrent.CancellationException;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.Executor;
import java.util.concurrent.Future;
import java.util.concurrent.FutureTask;

/**
 * Service that handles tasks in multiple queues.
 */
public class Goro {

  /** Default queue name. */
  public static final String DEFAULT_QUEUE = "default";

  /** Listeners handler. */
  final ListenersHandler listenersHandler = new ListenersHandler();

  /** Queues. */
  private final Queues queues;

  public Goro(final Executor delegateExecutor) {
    this();
    this.queues.setDelegateExecutor(delegateExecutor);
  }

  public Goro() {
    this(new Queues.Impl());
  }

  Goro(final Queues queues) {
    this.queues = queues;
  }

  public static Goro from(final IBinder binder) {
    if (binder instanceof GoroService.GoroBinder) {
      return ((GoroService.GoroBinder) binder).goro;
    }
    throw new IllegalArgumentException("Cannot get Goro from " + binder);
  }

  /**
   * Adds a task execution listener.
   * @param listener listener instance
   */
  public void addTaskListener(final GoroListener listener) {
    listenersHandler.addTaskListener(listener);
  }

  /**
   * Removes a task execution listener.
   * @param listener listener instance
   */
  public void removeTaskListener(final GoroListener listener) {
    listenersHandler.removeTaskListener(listener);
  }<commit_msg>deprecate Goro public constructors<commit_after>package com.stanfy.enroscar.goro;

import android.os.IBinder;

import java.lang.ref.WeakReference;
import java.util.concurrent.Callable;
import java.util.concurrent.CancellationException;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.Executor;
import java.util.concurrent.Future;
import java.util.concurrent.FutureTask;

/**
 * Service that handles tasks in multiple queues.
 */
public class Goro {

  /** Default queue name. */
  public static final String DEFAULT_QUEUE = "default";

  /** Listeners handler. */
  final ListenersHandler listenersHandler = new ListenersHandler();

  /** Queues. */
  private final Queues queues;

  /**
   * This constructor will be removed in 2.0 version.
   * @param delegateExecutor executor Goro delegates tasks to
   * @deprecated use {@link #createWithDelegate(Executor)} factory method instead
   */
  @Deprecated
  public Goro(final Executor delegateExecutor) {
    this();
    this.queues.setDelegateExecutor(delegateExecutor);
  }

  /**
   * This constructor will be removed in 2.0 version.
   * @deprecated use {@link #create()} factory method instead
   */
  @Deprecated
  public Goro() {
    this(new Queues.Impl());
  }

  Goro(final Queues queues) {
    this.queues = queues;
  }

  public static Goro from(final IBinder binder) {
    if (binder instanceof GoroService.GoroBinder) {
      return ((GoroService.GoroBinder) binder).goro;
    }
    throw new IllegalArgumentException("Cannot get Goro from " + binder);
  }

  /**
   * Creates a new Goro instance which uses {@link android.os.AsyncTask#THREAD_POOL_EXECUTOR}
   * to delegate tasks on Post-Honeycomb devices or create a separate thread pool on earlier
   * Android versions.
   * @return instance of Goro
   */
  public static Goro create() {
    return new Goro();
  }

  /**
   * Creates a new Goro instance which uses the specified executor to delegate tasks.
   * @param delegateExecutor executor Goro delegates tasks to
   * @return instance of Goro
   */
  public static Goro createWithDelegate(final Executor delegateExecutor) {
    return new Goro(delegateExecutor);
  }

  /**
   * Adds a task execution listener.
   * @param listener listener instance
   */
  public void addTaskListener(final GoroListener listener) {
    listenersHandler.addTaskListener(listener);
  }

  /**
   * Removes a task execution listener.
   * @param listener listener instance
   */
  public void removeTaskListener(final GoroListener listener) {
    listenersHandler.removeTaskListener(listener);
  }
{'fraction_non_alphanumeric': 0.09504331087584215, 'fraction_numerical': 0.0009624639076034649, 'mean_word_length': 3.8057803468208093, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6435177', 'n_tokens_mistral': 1200, 'n_tokens_neox': 1168, 'n_words': 339}