<commit_before>package com.wiwit.eplweb.controller;

import java.io.IOException;
import java.util.List;

import javax.servlet.http.HttpServletRequest;

import org.codehaus.jackson.JsonGenerationException;
import org.codehaus.jackson.map.JsonMappingException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.wiwit.eplweb.model.Rank;
import com.wiwit.eplweb.model.view.RankModelView;
import com.wiwit.eplweb.service.RankService;

@Controller
public class RankController extends BaseController {

	private static final Logger logger = LoggerFactory
			.getLogger(RankController.class);

	private RankService rankService;

	@RequestMapping(value = "/ranks", method = RequestMethod.GET)
	public @ResponseBody
	String getLatestRank(Model model) throws JsonGenerationException,
			JsonMappingException, IOException {
		logger.info("GET /ranks");

		List<Rank> ranks = rankService.getLatestRank();

		return generateJson(RankModelView.getModelView(ranks));
	}

	@RequestMapping(value = "/ranks/{weekNumber}", method = RequestMethod.GET)
	public @ResponseBody
	String getSelectedRank(Model model,
			@PathVariable("weekNumber") String weekNumber)
			throws JsonGenerationException, JsonMappingException, IOException {
		logger.info("GET /ranks/" + weekNumber);

		List<Rank> ranks = rankService.getRankByWeekNumber(weekNumber);

		return generateJson(RankModelView.getModelView(ranks));
	}

	@Autowired(required = true)
	public void setRankService(RankService rankService) {
		this.rankService = rankService;
	}
}
<commit_msg>clean up code<commit_after>package com.wiwit.eplweb.controller;

import java.io.IOException;
import java.util.List;

import org.codehaus.jackson.JsonGenerationException;
import org.codehaus.jackson.map.JsonMappingException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.wiwit.eplweb.model.Rank;
import com.wiwit.eplweb.model.view.RankModelView;
import com.wiwit.eplweb.service.RankService;

@Controller
public class RankController extends BaseController {

	private static final Logger logger = LoggerFactory
			.getLogger(RankController.class);

	private RankService rankService;

	@RequestMapping(value = "/ranks", method = RequestMethod.GET)
	public @ResponseBody
	String getLatestRank(Model model) throws JsonGenerationException,
			JsonMappingException, IOException {
		logger.info("GET /ranks");

		List<Rank> ranks = rankService.getLatestRank();

		return generateJson(RankModelView.getModelView(ranks));
	}

	@RequestMapping(value = "/ranks/{weekNumber}", method = RequestMethod.GET)
	public @ResponseBody
	String getSelectedRank(Model model,
			@PathVariable("weekNumber") String weekNumber)
			throws JsonGenerationException, JsonMappingException, IOException {
		logger.info("GET /ranks/" + weekNumber);

		List<Rank> ranks = rankService.getRankByWeekNumber(weekNumber);

		return generateJson(RankModelView.getModelView(ranks));
	}

	@Autowired(required = true)
	public void setRankService(RankService rankService) {
		this.rankService = rankService;
	}
}

{'fraction_non_alphanumeric': 0.09939837823698666, 'fraction_numerical': 0.00104629871828407, 'mean_word_length': 6.483365949119373, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '4938639', 'n_tokens_mistral': 1139, 'n_tokens_neox': 1095, 'n_words': 208}