<commit_before>package com.google.sitebricks.acceptance.util;

import org.mortbay.jetty.Server;
import org.mortbay.jetty.webapp.WebAppContext;

/**
 * @author <NAME> (<EMAIL>)
 */
public class Jetty {
  private static final String APP_NAME = "/sitebricks";

  private final Server server;

  public Jetty(String path, int port) {
    this(new WebAppContext(path, APP_NAME), port);
  }  
  
  public Jetty(WebAppContext webAppContext, int port) {
    server = new Server(port);
    server.addHandler(webAppContext);
  }

  public void start() throws Exception {
    server.start();
  }

  public void join() throws Exception {
    server.join();
  }

  public void stop() throws Exception {
    server.stop();
  }
}
<commit_msg>o allow the Injector and classloader to be passed into the Jetty instance so that it can be used by the WebAppContext<commit_after>package com.google.sitebricks.acceptance.util;

import org.mortbay.jetty.Server;
import org.mortbay.jetty.webapp.WebAppContext;

import com.google.inject.Injector;

/**
 * @author <NAME> (<EMAIL>)
 * @author <NAME>
 */
public class Jetty {
  
  public static final String INJECTOR_KEY = "@_INJECTOR_@";
  private static final String APP_NAME = "/sitebricks";
  private final Server server;

  public Jetty(String path, int port, ClassLoader classLoader, Injector injector) {
    WebAppContext webAppContext = new WebAppContext(path, APP_NAME);
    webAppContext.setClassLoader(classLoader);
    webAppContext.getServletContext().setAttribute(INJECTOR_KEY, injector);
    server = new Server(port);
    server.addHandler(webAppContext);
  }  

  public Jetty(String path, int port) {
    this(new WebAppContext(path, APP_NAME), port);
  }  
    
  public Jetty(WebAppContext webAppContext, int port) {
    server = new Server(port);
    server.addHandler(webAppContext);
  }

  public void start() throws Exception {
    server.start();
  }

  public void join() throws Exception {
    server.join();
  }

  public void stop() throws Exception {
    server.stop();
  }
}

{'fraction_non_alphanumeric': 0.10848126232741617, 'fraction_numerical': 0.0, 'mean_word_length': 3.9367396593673964, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 8, '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': '7594073', 'n_tokens_mistral': 654, 'n_tokens_neox': 630, 'n_words': 168}