<commit_before>package com.team254.lib.web.handlers;

import java.io.IOException;
import java.util.HashMap;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.eclipse.jetty.server.Request;
import org.eclipse.jetty.server.handler.AbstractHandler;

import com.google.gson.Gson;
import com.team254.lib.util.SystemManager;

public class GetAllStatesHandler extends AbstractHandler {

  public void handle(String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response)
      throws IOException, ServletException {

    Gson gson = new Gson();
    response.setContentType("application/json;charset=utf-8");
    response.setStatus(HttpServletResponse.SC_OK);
    baseRequest.setHandled(true);

    HashMap<String, String> states = SystemManager.get();
    String res = gson.toJson(states);
    response.getWriter().println(res);
  }

}
<commit_msg>Swaps old gson for JSONObj for states handler<commit_after>package com.team254.lib.web.handlers;

import java.io.IOException;
import java.util.HashMap;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.eclipse.jetty.server.Request;
import org.eclipse.jetty.server.handler.AbstractHandler;

import org.json.simple.JSONObject;

import com.team254.lib.util.SystemManager;

public class GetAllStatesHandler extends AbstractHandler {

  public void handle(String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response)
      throws IOException, ServletException {

    response.setContentType("application/json;charset=utf-8");
    response.setStatus(HttpServletResponse.SC_OK);
    baseRequest.setHandled(true);

    HashMap<String, String> s = SystemManager.getInstance().get();
    JSONObject json = new JSONObject(s);
    response.getWriter().println(json.toJSONString());
  }

}

{'fraction_non_alphanumeric': 0.1, 'fraction_numerical': 0.007106598984771574, 'mean_word_length': 5.591973244147157, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '2649775', 'n_tokens_mistral': 562, 'n_tokens_neox': 555, 'n_words': 110}