<commit_before>package com.otogami.web;

import java.io.IOException;

import javax.inject.Inject;
import javax.inject.Singleton;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;

import com.otogami.web.controller.ClassControllerExecutor;
import com.otogami.web.controller.ControllerHolder;
import com.otogami.web.funfilter.FilterChainElement;
import com.otogami.web.results.Result;
import com.otogami.web.results.ResultDispatcher;

@Singleton
public class ChainFilterExecutor {
	
	@Inject 
	private ClassControllerExecutor classControllerExecutor;
	
	@Inject
	private InstanceFactory injector;
	
	public void execute(FilterChainElement chainFilter, ControllerHolder classController, ServletRequest request, ServletResponse response) throws IOException{
		if (chainFilter!=null){
			chainFilter.append(new FinalChainElement());
		}else{
			chainFilter=new FinalChainElement();
		}
		System.out.println("Executing "+chainFilter);
		Result res=chainFilter.doFilter(classController, request, response);
		res.accept(new ResultDispatcher(injector,response));
	}
	
	public FilterChainElement getFinalChainElement(){
		return new FinalChainElement();
	}
	
	private class FinalChainElement extends FilterChainElement{

		public FinalChainElement() {
			super(null, null);
		}
		
		public Result doFilter(ControllerHolder classController, ServletRequest request, ServletResponse response){
			return classControllerExecutor.execute(classController, request, response);
		}
		
	}
}<commit_msg>Removed sysout trace<commit_after>package com.otogami.web;

import java.io.IOException;

import javax.inject.Inject;
import javax.inject.Singleton;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;

import com.otogami.web.controller.ClassControllerExecutor;
import com.otogami.web.controller.ControllerHolder;
import com.otogami.web.funfilter.FilterChainElement;
import com.otogami.web.results.Result;
import com.otogami.web.results.ResultDispatcher;

@Singleton
public class ChainFilterExecutor {
	
	@Inject 
	private ClassControllerExecutor classControllerExecutor;
	
	@Inject
	private InstanceFactory injector;
	
	public void execute(FilterChainElement chainFilter, ControllerHolder classController, ServletRequest request, ServletResponse response) throws IOException{
		if (chainFilter!=null){
			chainFilter.append(new FinalChainElement());
		}else{
			chainFilter=new FinalChainElement();
		}
		Result res=chainFilter.doFilter(classController, request, response);
		res.accept(new ResultDispatcher(injector,response));
	}
	
	public FilterChainElement getFinalChainElement(){
		return new FinalChainElement();
	}
	
	private class FinalChainElement extends FilterChainElement{

		public FinalChainElement() {
			super(null, null);
		}
		
		public Result doFilter(ControllerHolder classController, ServletRequest request, ServletResponse response){
			return classControllerExecutor.execute(classController, request, response);
		}
		
	}
}
{'fraction_non_alphanumeric': 0.08397715821296607, 'fraction_numerical': 0.0, 'mean_word_length': 6.501259445843829, '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': '4231101', 'n_tokens_mistral': 860, 'n_tokens_neox': 791, 'n_words': 176}