<commit_before>package org.lightmare.jpa.datasource;

import java.util.Properties;

import javax.sql.DataSource;

import org.lightmare.config.Configuration;
import org.lightmare.jpa.datasource.PoolConfig.PoolProviderType;
import org.lightmare.jpa.datasource.c3p0.InitC3p0;
import org.lightmare.jpa.datasource.dbcp.InitDBCP;
import org.lightmare.jpa.datasource.tomcat.InitTomcat;

/**
 * Factory class to get {@link InitDataSource} instance
 * 
 * @author Levan
 * 
 */
public class InitDataSourceFactory {

    /**
     * Constructs appropriate {@link InitDataSource} instance
     * 
     * @return {@link InitDataSource}
     */
    public static InitDataSource get(Properties properties) {

	InitDataSource initDataSource;

	PoolConfig poolConfig = Configuration.getPoolConfig();

	if (poolConfig.getPoolProviderType().equals(PoolProviderType.C3P0)) {
	    initDataSource = new InitC3p0(properties);
	} else if (poolConfig.getPoolProviderType().equals(
		PoolProviderType.TOMCAT)) {<commit_msg>improved utility classes<commit_after>package org.lightmare.jpa.datasource;

import java.util.Properties;

import javax.sql.DataSource;

import org.lightmare.config.Configuration;
import org.lightmare.jpa.datasource.PoolConfig.PoolProviderType;
import org.lightmare.jpa.datasource.c3p0.InitC3p0;
import org.lightmare.jpa.datasource.dbcp.InitDBCP;
import org.lightmare.jpa.datasource.tomcat.InitTomcat;

/**
 * Factory class to get {@link InitDataSource} instance
 * 
 * @author Levan
 * 
 */
public abstract class InitDataSourceFactory {

    /**
     * Constructs appropriate {@link InitDataSource} instance
     * 
     * @return {@link InitDataSource}
     */
    public static InitDataSource get(Properties properties) {

	InitDataSource initDataSource;

	PoolConfig poolConfig = Configuration.getPoolConfig();

	if (poolConfig.getPoolProviderType().equals(PoolProviderType.C3P0)) {
	    initDataSource = new InitC3p0(properties);
	} else if (poolConfig.getPoolProviderType().equals(
		PoolProviderType.TOMCAT)) {
{'fraction_non_alphanumeric': 0.10327706057596822, 'fraction_numerical': 0.007944389275074478, 'mean_word_length': 4.926470588235294, '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': '2016185', 'n_tokens_mistral': 626, 'n_tokens_neox': 598, 'n_words': 113}