<commit_before>package org.n3r.quartz.glass.web.util;

import com.google.common.base.Splitter;
import org.n3r.quartz.glass.job.annotation.GlassJob;
import org.quartz.Job;
import org.quartz.Scheduler;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider;
import org.springframework.core.type.filter.AnnotationTypeFilter;
import org.springframework.core.type.filter.AssignableTypeFilter;

import javax.annotation.PostConstruct;

public class JobsScanner {
    private String basePackage;

    @Autowired
    protected Scheduler scheduler;

    @PostConstruct
    protected void scanPaths() throws Exception {
        ClassPathScanningCandidateComponentProvider provider;
        provider = new ClassPathScanningCandidateComponentProvider(false);
        provider.addIncludeFilter(new AssignableTypeFilter(Job.class));
        provider.addIncludeFilter(new AnnotationTypeFilter(GlassJob.class));

        Iterable<String> basePackages = Splitter.on(',').omitEmptyStrings().trimResults().split(basePackage);
        for (String bp : basePackages) {
            for (BeanDefinition definition : provider.findCandidateComponents(bp)) {
                JobAdder.createJobDetail(scheduler, definition.getBeanClassName());
            }
        }
    }

    public void setBasePackage(String basePackage) {
        this.basePackage = basePackage;
    }
}
<commit_msg>catch exception and log in JobScanner<commit_after>package org.n3r.quartz.glass.web.util;

import com.google.common.base.Splitter;
import org.n3r.quartz.glass.job.annotation.GlassJob;
import org.quartz.Job;
import org.quartz.Scheduler;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider;
import org.springframework.core.type.filter.AnnotationTypeFilter;
import org.springframework.core.type.filter.AssignableTypeFilter;

import javax.annotation.PostConstruct;

public class JobsScanner {
    private Logger log = LoggerFactory.getLogger(JobsScanner.class);
    private String basePackage;

    @Autowired
    protected Scheduler scheduler;

    @PostConstruct
    protected void scanPaths() {
        ClassPathScanningCandidateComponentProvider provider;
        provider = new ClassPathScanningCandidateComponentProvider(false);
        provider.addIncludeFilter(new AssignableTypeFilter(Job.class));
        provider.addIncludeFilter(new AnnotationTypeFilter(GlassJob.class));

        try {
            Iterable<String> basePackages = Splitter.on(',')
                    .omitEmptyStrings().trimResults().split(basePackage);
            for (String bp : basePackages) {
                for (BeanDefinition definition : provider.findCandidateComponents(bp)) {
                    JobAdder.createJobDetail(scheduler, definition.getBeanClassName());
                }
            }
        } catch (Exception ex) {
            log.warn("scan jobs error", ex);
        }
    }

    public void setBasePackage(String basePackage) {
        this.basePackage = basePackage;
    }
}

{'fraction_non_alphanumeric': 0.08874849578820698, 'fraction_numerical': 0.0018050541516245488, 'mean_word_length': 3.8969072164948453, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '5661832', 'n_tokens_mistral': 898, 'n_tokens_neox': 876, 'n_words': 152}