<commit_before>package br.com.caelum.vraptor.interceptor;

import java.lang.reflect.Method;

import javax.inject.Inject;

import br.com.caelum.vraptor.Intercepts;
import br.com.caelum.vraptor.Result;
import br.com.caelum.vraptor.core.MethodInfo;
import br.com.caelum.vraptor.http.ParameterNameProvider;
import br.com.caelum.vraptor4.BeforeCall;
import br.com.caelum.vraptor4.controller.ControllerMethod;

@Intercepts(after=ParametersInstantiatorInterceptor.class)
public class ReturnParamInterceptor {

	@Inject private MethodInfo info;
	@Inject private Result result;
	@Inject private ParameterNameProvider nameProvider;
	@Inject private ControllerMethod cmethod;

	@BeforeCall
	public void intercept() {
		Object[] parameters = info.getParameters();
		Method method = cmethod.getMethod();
		String[] names = nameProvider.parameterNamesFor(method);

		for(int i=0; i< names.length; i++) {
			result.include(names[i], parameters[i]);
		}
	}

}<commit_msg>Using constructor injection<commit_after>package br.com.caelum.vraptor.interceptor;

import java.lang.reflect.Method;

import javax.inject.Inject;

import br.com.caelum.vraptor.Intercepts;
import br.com.caelum.vraptor.Result;
import br.com.caelum.vraptor.core.MethodInfo;
import br.com.caelum.vraptor.http.ParameterNameProvider;
import br.com.caelum.vraptor4.BeforeCall;
import br.com.caelum.vraptor4.controller.ControllerMethod;

@Intercepts(
	after=ParametersInstantiatorInterceptor.class
)
public class ReturnParamInterceptor {

	private MethodInfo info;
	private Result result;
	private ParameterNameProvider nameProvider;
	private ControllerMethod controllerMethod;

	@Deprecated // CDI eyes only
	public ReturnParamInterceptor() {}

	@Inject
	public ReturnParamInterceptor(MethodInfo info,
			Result result, ParameterNameProvider nameProvider,
			ControllerMethod controllerMethod) {

		this.info = info;
		this.result = result;
		this.nameProvider = nameProvider;
		this.controllerMethod = controllerMethod;
	}

	@BeforeCall
	public void intercept() {

		Object[] parameters = info.getParameters();
		Method method = controllerMethod.getMethod();
		String[] names = nameProvider.parameterNamesFor(method);

		for(int i=0; i< names.length; i++) {
			result.include(names[i], parameters[i]);
		}
	}

}
{'fraction_non_alphanumeric': 0.10482087571870853, 'fraction_numerical': 0.0026536930561698365, 'mean_word_length': 5.7522388059701495, 'pattern_counts': {'":': 0, '<': 5, '<?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': '7155090', 'n_tokens_mistral': 747, 'n_tokens_neox': 729, 'n_words': 139}