<commit_before>package io.vertx.ext.asyncsql.impl;

import io.vertx.core.Context;
import io.vertx.core.Handler;
import io.vertx.core.Vertx;
import io.vertx.core.logging.Logger;
import io.vertx.core.logging.LoggerFactory;
import scala.concurrent.ExecutionContext;

import java.util.Objects;

/**
 * Execution environment for Scala Future. By default, Scala uses a <em>reasonable default thread pool.</em>. In the
 * vert.x context, we use the Worker thread pool. If the task is submitted using a Worket thread, the same thread is
 * used. If not, the task is delegated to a worker thread.
 *
 * @author <a href="http://escoffier.me"><NAME></a>
 */
public class VertxExecutionContext implements ExecutionContext {

  public static ExecutionContext create(Vertx vertx) {
    return new VertxExecutionContext(vertx, (ex) -> LOGGER.error("An exception occurred", ex));
  }

  public static ExecutionContext create(Vertx vertx,
                                        Handler<Throwable> handler) {
    return new VertxExecutionContext(vertx, handler);
  }

  private static final Logger LOGGER = LoggerFactory.getLogger(VertxExecutionContext.class);

  private final Vertx vertx;
  private final Handler<Throwable> errorHandler;

  private VertxExecutionContext(Vertx vertx, Handler<Throwable> errorHandler) {<commit_msg>Fix typo<commit_after>package io.vertx.ext.asyncsql.impl;

import io.vertx.core.Context;
import io.vertx.core.Handler;
import io.vertx.core.Vertx;
import io.vertx.core.logging.Logger;
import io.vertx.core.logging.LoggerFactory;
import scala.concurrent.ExecutionContext;

import java.util.Objects;

/**
 * Execution environment for Scala Future. By default, Scala uses a <em>reasonable default thread pool.</em>. In the
 * vert.x context, we use the Worker thread pool. If the task is submitted using a Worker thread, the same thread is
 * used. If not, the task is delegated to a worker thread.
 *
 * @author <a href="http://escoffier.me"><NAME></a>
 */
public class VertxExecutionContext implements ExecutionContext {

  public static ExecutionContext create(Vertx vertx) {
    return new VertxExecutionContext(vertx, (ex) -> LOGGER.error("An exception occurred", ex));
  }

  public static ExecutionContext create(Vertx vertx,
                                        Handler<Throwable> handler) {
    return new VertxExecutionContext(vertx, handler);
  }

  private static final Logger LOGGER = LoggerFactory.getLogger(VertxExecutionContext.class);

  private final Vertx vertx;
  private final Handler<Throwable> errorHandler;

  private VertxExecutionContext(Vertx vertx, Handler<Throwable> errorHandler) {
{'fraction_non_alphanumeric': 0.09371428571428571, 'fraction_numerical': 0.0, 'mean_word_length': 4.231075697211155, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5396523', 'n_tokens_mistral': 745, 'n_tokens_neox': 746, 'n_words': 231}