<commit_before>package controller;

import model.Voter;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import service.PersistenceServiceImpl;

/**
 * Controller for the Voter
 */
@RestController
public class VoterController {

    /**
     * Process a request to /voter. Checks that the given password matches a voter, and, if it does, respond with
     * data about the voter
     * @param email Email of the voter
     * @param password Password of the voter
     * @return Voter
     */
    @RequestMapping(path = "/voter", method = RequestMethod.POST)
    public Voter voter(@RequestParam("email") String email, @RequestParam("password") String password) {
        Voter voter = PersistenceServiceImpl.getInstance().getVoterDao().getByEmail(email);

        if (voter == null)
            return null; // TODO respond with 404
        if (!voter.getPassword().equals(password))
            return null; // TODO respond with 404

        return voter;
    }

}<commit_msg>Changed 'email' to 'login' in request<commit_after>package controller;

import model.Voter;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import service.PersistenceServiceImpl;

/**
 * Controller for the Voter
 */
@RestController
public class VoterController {

    /**
     * Process a request to /voter. Checks that the given password matches a voter, and, if it does, respond with
     * data about the voter
     * @param login Email of the voter
     * @param password <PASSWORD>
     * @return Voter
     */
    @RequestMapping(path = "/voter", method = RequestMethod.POST)
    public Voter voter(@RequestParam("login") String login, @RequestParam("password") String password) {
        Voter voter = PersistenceServiceImpl.getInstance().getVoterDao().getByEmail(login);

        if (voter == null)
            return null; // TODO respond with 404
        if (!voter.getPassword().equals(password))
            return null; // TODO respond with 404

        return voter;
    }

}
{'fraction_non_alphanumeric': 0.09970426700464723, 'fraction_numerical': 0.005069708491761723, 'mean_word_length': 3.5104761904761905, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, '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': '4323791', 'n_tokens_mistral': 646, 'n_tokens_neox': 614, 'n_words': 188}