<commit_before>package org.motechproject.scheduler;

import org.apache.commons.lang.StringUtils;
import org.motechproject.MotechObject;
import org.motechproject.model.CronSchedulableJob;
import org.motechproject.model.MotechEvent;
import org.motechproject.model.RepeatingSchedulableJob;
import org.motechproject.model.RunOnceSchedulableJob;
import org.motechproject.scheduler.domain.JobId;
import org.quartz.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.quartz.SchedulerFactoryBean;

import java.text.ParseException;
import java.util.Date;

/**
 * Motech Scheduler Service implementation
 *
 * @see MotechSchedulerService
 */
public class MotechSchedulerServiceImpl extends MotechObject implements MotechSchedulerService {
    public static final String JOB_GROUP_NAME = "default";
    final int MAX_REPEAT_COUNT = 999999;
    private SchedulerFactoryBean schedulerFactoryBean;

    @Autowired
    public MotechSchedulerServiceImpl(SchedulerFactoryBean schedulerFactoryBean) {
        this.schedulerFactoryBean = schedulerFactoryBean;
    }

    @Override
    public void scheduleJob(CronSchedulableJob cronSchedulableJob) {
        MotechEvent motechEvent = assertCronJob(cronSchedulableJob);

        JobId jobId = new JobId(motechEvent);
        JobDetail jobDetail = new JobDetail(jobId.value(), JOB_GROUP_NAME, MotechScheduledJob.class);
        putMotechEventDataToJobDataMap(jobDetail.getJobDataMap(), motechEvent);

        Trigger trigger;

        try {
            trigger = new CronTrigger(jobId.value(), JOB_GROUP_NAME, cronSchedulableJob.getCronExpression());
            Date startTime = cronSchedulableJob.getStartTime();
            Date endTime = cronSchedulableJob.getEndTime();
            if (startTime != null) {<commit_msg>Sanchit | #000 | Added the default constructor to MotechSchedulerServiceImpl for autowiring.<commit_after>package org.motechproject.scheduler;

import org.apache.commons.lang.StringUtils;
import org.motechproject.MotechObject;
import org.motechproject.model.CronSchedulableJob;
import org.motechproject.model.MotechEvent;
import org.motechproject.model.RepeatingSchedulableJob;
import org.motechproject.model.RunOnceSchedulableJob;
import org.motechproject.scheduler.domain.JobId;
import org.quartz.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.quartz.SchedulerFactoryBean;

import java.text.ParseException;
import java.util.Date;

/**
 * Motech Scheduler Service implementation
 *
 * @see MotechSchedulerService
 */
public class MotechSchedulerServiceImpl extends MotechObject implements MotechSchedulerService {
    public static final String JOB_GROUP_NAME = "default";
    final int MAX_REPEAT_COUNT = 999999;
    private SchedulerFactoryBean schedulerFactoryBean;

    private MotechSchedulerServiceImpl() {
    }

    @Autowired
    public MotechSchedulerServiceImpl(SchedulerFactoryBean schedulerFactoryBean) {
        this.schedulerFactoryBean = schedulerFactoryBean;
    }

    @Override
    public void scheduleJob(CronSchedulableJob cronSchedulableJob) {
        MotechEvent motechEvent = assertCronJob(cronSchedulableJob);

        JobId jobId = new JobId(motechEvent);
        JobDetail jobDetail = new JobDetail(jobId.value(), JOB_GROUP_NAME, MotechScheduledJob.class);
        putMotechEventDataToJobDataMap(jobDetail.getJobDataMap(), motechEvent);

        Trigger trigger;

        try {
            trigger = new CronTrigger(jobId.value(), JOB_GROUP_NAME, cronSchedulableJob.getCronExpression());
            Date startTime = cronSchedulableJob.getStartTime();
            Date endTime = cronSchedulableJob.getEndTime();
            if (startTime != null) {
{'fraction_non_alphanumeric': 0.07653197752207654, 'fraction_numerical': 0.004013914905004014, 'mean_word_length': 4.75076923076923, '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': '7493013', 'n_tokens_mistral': 1134, 'n_tokens_neox': 1059, 'n_words': 201}