<commit_before>package to.etc.domui.server;

import java.util.*;

import javax.servlet.*;
import javax.servlet.http.*;

import org.slf4j.*;

import to.etc.domui.server.reloader.*;
import to.etc.domui.state.*;

public class ReloadingContextMaker extends AbstractContextMaker {
	static private final Logger LOG = LoggerFactory.getLogger(ReloadingContextMaker.class);

	private String m_applicationClassName;

	private ConfigParameters m_config;

	private Reloader m_reloader;

	private DomApplication m_application;

	private int m_nestCount;

	private Set<IReloadedClassesListener> m_listenerSet = new HashSet<IReloadedClassesListener>();


	public ReloadingContextMaker(String applicationClassName, ConfigParameters pp, String patterns) throws Exception {
		super(pp);
		m_applicationClassName = applicationClassName;
		m_config = pp;
		m_reloader = new Reloader(patterns);
		AppFilter.LOG.info("We are running in DEVELOPMENT mode. This will be VERY slow when used in a production environment.");

		checkReload(); // Initial: force load and init of Application object.
	}

	public Reloader getReloader() {
		return m_reloader;
	}

	@Override
	public boolean handleRequest(HttpServletRequest request, HttpServletResponse response, FilterChain chain) throws Exception {
		synchronized(this) {
			if(m_nestCount == 0)
				checkReload();
			m_nestCount++;
		}

		//-- If a reload has taken place all my session data is gone and a new appl object is instantiated.
		try {
			//-- Get sessionLink (locked on session)
			HttpSession sess = request.getSession(true);
			HttpSessionLink link;
			synchronized(sess) {<commit_msg>Remove debug<commit_after>package to.etc.domui.server;

import java.util.*;

import javax.servlet.*;
import javax.servlet.http.*;

import org.slf4j.*;

import to.etc.domui.server.reloader.*;
import to.etc.domui.state.*;

public class ReloadingContextMaker extends AbstractContextMaker {
	static private final Logger LOG = LoggerFactory.getLogger(ReloadingContextMaker.class);

	private String m_applicationClassName;

	private ConfigParameters m_config;

	private Reloader m_reloader;

	private DomApplication m_application;

	private int m_nestCount;

	private Set<IReloadedClassesListener> m_listenerSet = new HashSet<IReloadedClassesListener>();


	public ReloadingContextMaker(String applicationClassName, ConfigParameters pp, String patterns) throws Exception {
		super(pp);
		m_applicationClassName = applicationClassName;
		m_config = pp;
		m_reloader = new Reloader(patterns);
		System.out.println("DomUI: We are running in DEVELOPMENT mode. This will be VERY slow when used in a production environment.");

		checkReload(); // Initial: force load and init of Application object.
	}

	public Reloader getReloader() {
		return m_reloader;
	}

	@Override
	public boolean handleRequest(HttpServletRequest request, HttpServletResponse response, FilterChain chain) throws Exception {
		synchronized(this) {
			if(m_nestCount == 0)
				checkReload();
			m_nestCount++;
		}

		//-- If a reload has taken place all my session data is gone and a new appl object is instantiated.
		try {
			//-- Get sessionLink (locked on session)
			HttpSession sess = request.getSession(true);
			HttpSessionLink link;
			synchronized(sess) {
{'fraction_non_alphanumeric': 0.08410351201478743, 'fraction_numerical': 0.0012322858903265558, 'mean_word_length': 4.9143897996357016, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '4043649', 'n_tokens_mistral': 1020, 'n_tokens_neox': 927, 'n_words': 282}