<commit_before>/**
 * 
 */
package xpress;

import javax.ws.rs.Consumes;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;

import com.yammer.metrics.annotation.Timed;
import xpress.storage.Repository;
import xpress.storage.entity.VoteEntity;

/**
 * @author mcq
 *
 */
@Path("/vote")
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_JSON)
public class VoteResource {

    private Repository repository;
    
    public VoteResource(Repository repository) {
        this.repository = repository;
    }

	@POST
	@Timed
	public VoteResponse addVote(VoteEntity vote) {
	    vote.setTime(System.currentTimeMillis());
        repository.saveVote(vote);
		return new VoteResponse(1, "ok");
	}
<commit_msg>fixed save method<commit_after>/**
 * 
 */
package xpress;

import javax.ws.rs.Consumes;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;

import com.yammer.metrics.annotation.Timed;
import xpress.storage.Repository;
import xpress.storage.entity.VoteEntity;

/**
 * @author mcq
 *
 */
@Path("/vote")
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_JSON)
public class VoteResource {

    private Repository repository;
    
    public VoteResource(Repository repository) {
        this.repository = repository;
    }

	@POST
	@Timed
	public VoteResponse addVote(Vote vote) {
        VoteEntity voteEntity = new VoteEntity();
        voteEntity.setTime(System.currentTimeMillis());
        voteEntity.setTag(vote.getTag());
        voteEntity.setMood(vote.getMood());
        repository.saveVote(voteEntity);
		return new VoteResponse(1, "ok");
	}

{'fraction_non_alphanumeric': 0.12347117064647642, 'fraction_numerical': 0.0011648223645894002, 'mean_word_length': 4.038123167155425, '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': '396554', 'n_tokens_mistral': 578, 'n_tokens_neox': 563, 'n_words': 102}