<commit_before>/***
 * Copyright (c) 2009 Caelum - www.caelum.com.br/opensource
 * All rights reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * 	http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package br.com.caelum.vraptor.ioc;

import static org.slf4j.LoggerFactory.getLogger;

import javax.enterprise.context.ApplicationScoped;
import javax.enterprise.event.Observes;
import javax.inject.Inject;

import org.slf4j.Logger;

import br.com.caelum.vraptor.controller.BeanClass;
import br.com.caelum.vraptor.core.InterceptsQualifier;
import br.com.caelum.vraptor.interceptor.InterceptorRegistry;
import br.com.caelum.vraptor.interceptor.InterceptorValidator;

@ApplicationScoped
public class InterceptorStereotypeHandler{

	private static final Logger logger = getLogger(InterceptorStereotypeHandler.class);

	private final InterceptorRegistry registry;

	private InterceptorValidator interceptorValidator;

	/**
	 * @deprecated CDI eyes only
	 */
	public InterceptorStereotypeHandler() {
		this(null, null);
	}

	@Inject
	public InterceptorStereotypeHandler(InterceptorRegistry registry,
			InterceptorValidator interceptorValidator) {

		this.registry = registry;
		this.interceptorValidator = interceptorValidator;
	}

	public void handle(@Observes @InterceptsQualifier BeanClass beanClass) {
		Class<?> originalType = beanClass.getType();
		interceptorValidator.validate(originalType);
		registerInterceptor(originalType);
	}

	private void registerInterceptor(Class<?> type) {
		logger.debug("Found interceptor for {}", type);
		registry.register(type);
	}
}<commit_msg>no need for registerInterceptor private method<commit_after>/***
 * Copyright (c) 2009 Caelum - www.caelum.com.br/opensource
 * All rights reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * 	http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package br.com.caelum.vraptor.ioc;

import static org.slf4j.LoggerFactory.getLogger;

import javax.enterprise.context.ApplicationScoped;
import javax.enterprise.event.Observes;
import javax.inject.Inject;

import org.slf4j.Logger;

import br.com.caelum.vraptor.controller.BeanClass;
import br.com.caelum.vraptor.core.InterceptsQualifier;
import br.com.caelum.vraptor.interceptor.InterceptorRegistry;
import br.com.caelum.vraptor.interceptor.InterceptorValidator;

@ApplicationScoped
public class InterceptorStereotypeHandler{

	private static final Logger logger = getLogger(InterceptorStereotypeHandler.class);

	private final InterceptorRegistry registry;

	private InterceptorValidator interceptorValidator;

	/**
	 * @deprecated CDI eyes only
	 */
	public InterceptorStereotypeHandler() {
		this(null, null);
	}

	@Inject
	public InterceptorStereotypeHandler(InterceptorRegistry registry,
			InterceptorValidator interceptorValidator) {

		this.registry = registry;
		this.interceptorValidator = interceptorValidator;
	}

	public void handle(@Observes @InterceptsQualifier BeanClass beanClass) {
		Class<?> originalType = beanClass.getType();
		interceptorValidator.validate(originalType);
		logger.debug("Found interceptor for {}", originalType);
		registry.register(originalType);
	}
}
{'fraction_non_alphanumeric': 0.08661222469685721, 'fraction_numerical': 0.004949269982677555, 'mean_word_length': 5.256965944272446, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, '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': '1377852', 'n_tokens_mistral': 1179, 'n_tokens_neox': 1152, 'n_words': 326}