<commit_before>package org.springframework.web.servlet;

import java.io.IOException;
import java.util.LinkedList;
import java.util.List;
import java.util.Locale;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.View;
import org.springframework.web.servlet.ViewResolver;

import com.nominanuda.code.Nullable;
import com.nominanuda.dataobject.DataObject;
import com.nominanuda.dataobject.MapsAndListsObjectDecorator;
import com.nominanuda.springmvc.HttpEntityView;
import com.nominanuda.web.http.ServletHelper;
import com.nominanuda.web.mvc.PathAndJsonViewSpec;

public class DispatcherServletHelper implements ApplicationContextAware {
	private List<ViewResolver> resolvers = null;
	private ApplicationContext applicationContext;
	private static final ServletHelper servletHelper = new ServletHelper();
	private LocaleResolver localeResolver;
	public void init() {
		resolvers = new LinkedList<ViewResolver>();
		resolvers.addAll(applicationContext.getBeansOfType(ViewResolver.class)
				.values());
		localeResolver = applicationContext.getBean(DispatcherServlet.LOCALE_RESOLVER_BEAN_NAME, LocaleResolver.class);

	}

	// String viewName = null;
	// Locale locale;
	// View mav = null;
	// Check.illegalargument.assertNotNull(mav,
	// "cannot resolve view named:"+viewName);
	private @Nullable
	View resolveViewName(String viewName, Locale locale) throws Exception {
		for (ViewResolver r : resolvers) {
			View view = r.resolveViewName(viewName, locale);
			if (view != null) {
				return view;
			}
		}
		return null;
	}

	public void renderHandlerOutput(HttpServletRequest request,
			HttpServletResponse response, Object result) throws Exception {<commit_msg>relaxed bean lookup failure<commit_after>package org.springframework.web.servlet;

import java.io.IOException;
import java.util.LinkedList;
import java.util.List;
import java.util.Locale;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.springframework.beans.BeansException;
import org.springframework.beans.factory.NoSuchBeanDefinitionException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.View;
import org.springframework.web.servlet.ViewResolver;

import com.nominanuda.code.Nullable;
import com.nominanuda.dataobject.DataObject;
import com.nominanuda.dataobject.MapsAndListsObjectDecorator;
import com.nominanuda.springmvc.HttpEntityView;
import com.nominanuda.web.http.ServletHelper;
import com.nominanuda.web.mvc.PathAndJsonViewSpec;

public class DispatcherServletHelper implements ApplicationContextAware {
	private List<ViewResolver> resolvers = null;
	private ApplicationContext applicationContext;
	private static final ServletHelper servletHelper = new ServletHelper();
	private LocaleResolver localeResolver;
	public void init() {
		resolvers = new LinkedList<ViewResolver>();
		resolvers.addAll(applicationContext.getBeansOfType(ViewResolver.class)
				.values());
		try {
			localeResolver = applicationContext.getBean(DispatcherServlet.LOCALE_RESOLVER_BEAN_NAME, LocaleResolver.class);
		} catch (NoSuchBeanDefinitionException e) {
		}

	}

	// String viewName = null;
	// Locale locale;
	// View mav = null;
	// Check.illegalargument.assertNotNull(mav,
	// "cannot resolve view named:"+viewName);
	private @Nullable
	View resolveViewName(String viewName, Locale locale) throws Exception {
		for (ViewResolver r : resolvers) {
			View view = r.resolveViewName(viewName, locale);
			if (view != null) {
				return view;
			}
		}
		return null;
	}

	public void renderHandlerOutput(HttpServletRequest request,
			HttpServletResponse response, Object result) throws Exception {
{'fraction_non_alphanumeric': 0.08984283368519821, 'fraction_numerical': 0.0, 'mean_word_length': 6.0948419301164725, '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': '4268648', 'n_tokens_mistral': 1270, 'n_tokens_neox': 1214, 'n_words': 259}