<commit_before>package cict.gama.tomcat;

import javax.servlet.ServletException;

import org.apache.catalina.LifecycleException;
import org.apache.catalina.startup.Tomcat;

public class RunWarExample {
	public static int port=8080;
	public static void main(String[] args) throws ServletException, LifecycleException {
		String contextPath = "/GamaWeb";
		String warFilePath = "GamaWeb.war";
//		if(args.length==1) port=stringToInt(args[0]);
		if(args.length==3) {
			contextPath=args[0];
			warFilePath=args[1];
			port=stringToInt(args[2]);
		}
		Tomcat tomcat = new Tomcat();
		tomcat.setPort(port);
		tomcat.setBaseDir(".");

		tomcat.getHost().setAppBase(".");

		tomcat.addWebapp(contextPath, warFilePath);

		tomcat.start();
		if(args.length==4) {			
			tomcat.getServer().await();
		}
	}

	public static boolean stringToBool(String param)  {		
			return Boolean.valueOf(param);
	}

	public static int stringToInt(String param) throws NumberFormatException {
		try {
			return Integer.valueOf(param);
		} catch (NumberFormatException e) {
			// return -1;
			port=8080;
			throw e;<commit_msg>tomcat<commit_after>package cict.gama.tomcat;

import javax.servlet.ServletException;

import org.apache.catalina.LifecycleException;
import org.apache.catalina.startup.Tomcat;

public class RunWarExample {
	public static int port=8080;
	public static void main(String[] args) throws ServletException, LifecycleException {
		String contextPath = "/GamaWeb";
		String warFilePath = "GamaWeb.war";
//		if(args.length==1) port=stringToInt(args[0]);
		if(args.length==3) {
			contextPath=args[0];
			warFilePath=args[1];
			port=stringToInt(args[2]);
		}
		Tomcat tomcat = new Tomcat();
		tomcat.setPort(port);
		tomcat.setBaseDir(".");

		tomcat.getHost().setAppBase(".");

		tomcat.addWebapp(contextPath, warFilePath);

		tomcat.start();
		if(args.length==4 || args.length==0) {			
			tomcat.getServer().await();
		}
	}

	public static boolean stringToBool(String param)  {		
			return Boolean.valueOf(param);
	}

	public static int stringToInt(String param) throws NumberFormatException {
		try {
			return Integer.valueOf(param);
		} catch (NumberFormatException e) {
			// return -1;
			port=8080;
			throw e;
{'fraction_non_alphanumeric': 0.13535536441828883, 'fraction_numerical': 0.014938886373924853, 'mean_word_length': 4.525, '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': '4226563', 'n_tokens_mistral': 834, 'n_tokens_neox': 732, 'n_words': 144}