<commit_before>package co.timecrypt.api.v2.servlets;

import co.timecrypt.api.v2.definitions.ErrorCode;
import co.timecrypt.api.v2.definitions.JsonResponses;
import co.timecrypt.api.v2.definitions.Parameter;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * This servlet checks whether a Timecrypt message is locked with a password or not.
 */
@WebServlet(name = "CreateServlet", description = "Creates a new Timecrypt message", urlPatterns = {
        "/v2/create"
})
public class CreateServlet extends TimecryptApiServlet {

    @Override
    protected void handleRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        String text = sanitize(request.getParameter(Parameter.CREATE_TEXT));

        if (text == null) {
            JsonResponses.TimecryptResponse message = new JsonResponses.Error(ErrorCode.MISSING_TEXT);
            writeToOutput(message, response);
        }

        String viewCount = sanitize(request.getParameter(Parameter.CREATE_VIEW_COUNT));
        String destructDate = sanitize(request.getParameter(Parameter.CREATE_DESTRUCT_DATE));<commit_msg>Forgot to return after detecting errors...<commit_after>package co.timecrypt.api.v2.servlets;

import co.timecrypt.api.v2.definitions.ErrorCode;
import co.timecrypt.api.v2.definitions.JsonResponses;
import co.timecrypt.api.v2.definitions.Parameter;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * This servlet checks whether a Timecrypt message is locked with a password or not.
 */
@WebServlet(name = "CreateServlet", description = "Creates a new Timecrypt message", urlPatterns = {
        "/v2/create"
})
public class CreateServlet extends TimecryptApiServlet {

    @Override
    protected void handleRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        String text = sanitize(request.getParameter(Parameter.CREATE_TEXT));

        if (text == null) {
            JsonResponses.TimecryptResponse message = new JsonResponses.Error(ErrorCode.MISSING_TEXT);
            writeToOutput(message, response);
            return;
        }

        String viewCount = sanitize(request.getParameter(Parameter.CREATE_VIEW_COUNT));
        String destructDate = sanitize(request.getParameter(Parameter.CREATE_DESTRUCT_DATE));
{'fraction_non_alphanumeric': 0.09032258064516129, 'fraction_numerical': 0.003795066413662239, 'mean_word_length': 4.584745762711864, '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': '3107733', 'n_tokens_mistral': 718, 'n_tokens_neox': 703, 'n_words': 155}