<commit_before>package com.github.sbugat.ec2tools.service;

import java.util.List;

import javax.inject.Inject;

import org.apache.commons.configuration.ConfigurationException;
import org.slf4j.ext.XLogger;
import org.slf4j.ext.XLoggerFactory;

import com.amazonaws.services.ec2.model.InstanceStateName;
import com.github.sbugat.ec2tools.model.instance.InstanceOrder;
import com.github.sbugat.ec2tools.model.instance.OrderType;
import com.github.sbugat.ec2tools.service.configuration.ConfigurationService;
import com.github.sbugat.ec2tools.service.options.ProgramOptions;
import com.github.sbugat.ec2tools.service.options.ProgramOptionsService;

public class MainService {

	/** SLF4J XLogger. */
	private static final XLogger log = XLoggerFactory.getXLogger(MainService.class);

	@Inject
	private AmazonEC2Service amazonEC2Service;

	@Inject
	private ConfigurationService configurationService;

	@Inject
	private ProgramOptionsService programOptionsService;

	public void main(final String programArgs[]) throws Exception {

		if (0 == programArgs.length) {
			System.err.println(programOptionsService.getUsage());
			log.exit();
			return;
		}

		// Arguments checking
		final ProgramOptions programOptions = programOptionsService.processProgramArgs(programArgs);

		// Configuration loading
		try {
			configurationService.loadConfiguration();
		}
		catch (final ConfigurationException e) {

			log.error("Error during configuration loading ", e);
			log.exit(e);
			throw e;
		}

		// Configuration printing option
		if (programOptions.hasListOption()) {<commit_msg>Minor no program arguments check<commit_after>package com.github.sbugat.ec2tools.service;

import java.util.List;

import javax.inject.Inject;

import org.apache.commons.configuration.ConfigurationException;
import org.slf4j.ext.XLogger;
import org.slf4j.ext.XLoggerFactory;

import com.amazonaws.services.ec2.model.InstanceStateName;
import com.github.sbugat.ec2tools.model.instance.InstanceOrder;
import com.github.sbugat.ec2tools.model.instance.OrderType;
import com.github.sbugat.ec2tools.service.configuration.ConfigurationService;
import com.github.sbugat.ec2tools.service.options.ProgramOptions;
import com.github.sbugat.ec2tools.service.options.ProgramOptionsService;

public class MainService {

	/** SLF4J XLogger. */
	private static final XLogger log = XLoggerFactory.getXLogger(MainService.class);

	@Inject
	private AmazonEC2Service amazonEC2Service;

	@Inject
	private ConfigurationService configurationService;

	@Inject
	private ProgramOptionsService programOptionsService;

	public void main(final String programArgs[]) throws Exception {

		// Arguments checking
		final ProgramOptions programOptions;
		try {
			programOptions = programOptionsService.processProgramArgs(programArgs);
		}
		catch (final Exception e) {

			log.error("Error during argument checking", e);
			log.exit(e);
			throw e;
		}

		// Configuration loading
		try {
			configurationService.loadConfiguration();
		}
		catch (final ConfigurationException e) {

			log.error("Error during configuration loading", e);
			log.exit(e);
			throw e;
		}

		// Configuration printing option
		if (programOptions.hasListOption()) {
{'fraction_non_alphanumeric': 0.0945945945945946, 'fraction_numerical': 0.00785669390320553, 'mean_word_length': 5.27810650887574, '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': '6614570', 'n_tokens_mistral': 984, 'n_tokens_neox': 917, 'n_words': 186}