<commit_before>
package es.jaranda.quick.node.api.controller;

import static es.jaranda.quick.node.api.constants.UrlMappingConstants.*;
import es.jaranda.quick.node.batch.job.GreetingJobContext;
import java.util.Date;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.batch.core.ExitStatus;
import org.springframework.batch.core.Job;
import org.springframework.batch.core.JobExecution;
import org.springframework.batch.core.JobParameters;
import org.springframework.batch.core.JobParametersInvalidException;
import org.springframework.batch.core.job.builder.SimpleJobBuilder;
import org.springframework.batch.core.launch.JobLauncher;
import org.springframework.batch.core.launch.support.SimpleJobLauncher;
import org.springframework.batch.core.repository.JobExecutionAlreadyRunningException;
import org.springframework.batch.core.repository.JobInstanceAlreadyCompleteException;
import org.springframework.batch.core.repository.JobRestartException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

// XXX In a future, this controller will be disappear. To launch job you will do POST to /job {'jobName':'greet'}

@Controller
@RequestMapping(GREETING_URL_MAPPING)
public class GreetingController {
    
    private static final Logger LOG = 
            LoggerFactory.getLogger(GreetingController.class);

    @Autowired
    private JobLauncher jobLauncher;
    
    @Autowired
    @Qualifier(GreetingJobContext.GREETING_JOB)
    private Job greetingJob;
    
    @RequestMapping(method=RequestMethod.POST)
    public @ResponseBody ExitStatus greet() throws 
            JobExecutionAlreadyRunningException, 
            JobRestartException, 
            JobInstanceAlreadyCompleteException, 
            JobParametersInvalidException {
        
        return jobLauncher.run(greetingJob, new JobParameters())
                .getExitStatus();
    }
}
<commit_msg>Code clean<commit_after>
package es.jaranda.quick.node.api.controller;

import static es.jaranda.quick.node.api.constants.UrlMappingConstants.*;
import es.jaranda.quick.node.batch.job.GreetingJobContext;
import org.springframework.batch.core.ExitStatus;
import org.springframework.batch.core.Job;
import org.springframework.batch.core.JobParameters;
import org.springframework.batch.core.JobParametersInvalidException;
import org.springframework.batch.core.launch.JobLauncher;
import org.springframework.batch.core.repository.JobExecutionAlreadyRunningException;
import org.springframework.batch.core.repository.JobInstanceAlreadyCompleteException;
import org.springframework.batch.core.repository.JobRestartException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

// XXX In a future, this controller will be disappear. To launch job you will do POST to /job {'jobName':'greet', 'jobParameters':{}}

@Controller
@RequestMapping(GREETING_URL_MAPPING)
public class GreetingController {

    @Autowired
    private JobLauncher jobLauncher;
    
    @Autowired
    @Qualifier(GreetingJobContext.GREETING_JOB)
    private Job greetingJob;
    
    @RequestMapping(method=RequestMethod.POST)
    public @ResponseBody ExitStatus greet() throws 
            JobExecutionAlreadyRunningException, 
            JobRestartException, 
            JobInstanceAlreadyCompleteException, 
            JobParametersInvalidException {
        
        return jobLauncher.run(greetingJob, new JobParameters())
                .getExitStatus();
    }
}

{'fraction_non_alphanumeric': 0.08275198460428193, 'fraction_numerical': 0.0004811161895597787, 'mean_word_length': 4.296815286624204, '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': '3230472', 'n_tokens_mistral': 1102, 'n_tokens_neox': 1111, 'n_words': 188}