<commit_before>package me.alb_i986.selenium.forbes.lib.gui;

import java.util.concurrent.TimeUnit;

import me.alb_i986.selenium.forbes.lib.gui.domain.SupportedBrowser;

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.safari.SafariDriver;

public class WebDriverFactory {

	public static final int IMPLICIT_WAIT_SECONDS = 10;
	
	public static SupportedBrowser browserType = SupportedBrowser.CHROME;

	/**
	 * Create and return a WebDriver instance of the given type.
	 * Also, set an implicit wait of {@value WebDriverFactory#IMPLICIT_WAIT_SECONDS}s.
	 * 
	 * @param browserType the supported browser to be created
	 * @throws IllegalArgumentException if the browser specified is not supported
	 */
	public static WebDriver getWebDriver(SupportedBrowser browserType) {
		WebDriver driver;
		switch (browserType) {
			case CHROME:
				driver = new ChromeDriver();
				break;
			case FIREFOX:
				driver = new FirefoxDriver();
				break;
			case SAFARI:
				driver = new SafariDriver();
				break;
			default:
				throw new IllegalArgumentException("The specified Browser type (" + browserType + ")"
							+ " is not supported at the moment");
		}
		driver.manage().timeouts().implicitlyWait(IMPLICIT_WAIT_SECONDS, TimeUnit.SECONDS);
		return driver;
	}

	public static WebDriver getWebDriver() {
		return getWebDriver(browserType);
	}

}<commit_msg>Tiny refactorings to WebDriverFactory.<commit_after>package me.alb_i986.selenium.forbes.lib.gui;

import java.util.concurrent.TimeUnit;

import me.alb_i986.selenium.forbes.lib.gui.domain.SupportedBrowser;

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.safari.SafariDriver;

public class WebDriverFactory {

	public static final int IMPLICIT_WAIT_SECONDS = 10;
	
	public static SupportedBrowser BROWSER_TYPE = SupportedBrowser.CHROME;

	/**
	 * Create and return a WebDriver instance of the given type.
	 * Also, set an implicit wait of {@value WebDriverFactory#IMPLICIT_WAIT_SECONDS}s.
	 * 
	 * @param browserType the supported browser to be created
	 * @throws IllegalArgumentException if the browser specified is not supported
	 */
	public static WebDriver getWebDriver(SupportedBrowser browserType) {
		WebDriver driver;
		switch (browserType) {
			case CHROME:
				driver = new ChromeDriver();
				break;
			case FIREFOX:
				driver = new FirefoxDriver();
				break;
			case SAFARI:
				driver = new SafariDriver();
				break;
			default:
				throw new IllegalArgumentException("The specified Browser type (" + browserType + ")"
							+ " is not supported at the moment");
		}
		driver.manage().timeouts().implicitlyWait(IMPLICIT_WAIT_SECONDS, TimeUnit.SECONDS);
		return driver;
	}

	/**
	 * @return a {@link WebDriver} according to {@link #BROWSER_TYPE}
	 * 
	 * @see #getWebDriver(SupportedBrowser)
	 */
	public static WebDriver getWebDriver() {
		return getWebDriver(BROWSER_TYPE);
	}

}
{'fraction_non_alphanumeric': 0.0900520156046814, 'fraction_numerical': 0.005201560468140442, 'mean_word_length': 4.436395759717315, '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': '5456791', 'n_tokens_mistral': 1079, 'n_tokens_neox': 941, 'n_words': 241}