<commit_before>/*******************************************************************************
 * Copyright 2013 <NAME>
 * 
 * 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 net.sf.qualitytest.blueprint;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;

import net.sf.qualitycheck.Check;

/**
 * Invocation handler which is used to blueprint objects returned from dynamic interface proxies created during
 * blueprinting.
 * 
 * @author <NAME>
 */
class BlueprintInvocationHandler implements InvocationHandler {

	private final BlueprintConfiguration config;

	public BlueprintInvocationHandler(final BlueprintConfiguration config) {
		this.config = Check.notNull(config, "config");
	}

	@Override
	public Object invoke(final Object instance, final Method method, final Object[] parameters) throws Throwable {
		return Blueprint.object(method.getReturnType(), config);
	}

}<commit_msg>Added NOSONAR comment to suppress 'Illegal Throws' warning, because we implement a native Java interface and cannot decide to do that in a different way<commit_after>/*******************************************************************************
 * Copyright 2013 <NAME>
 * 
 * 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 net.sf.qualitytest.blueprint;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;

import net.sf.qualitycheck.Check;

/**
 * Invocation handler which is used to blueprint objects returned from dynamic interface proxies created during
 * blueprinting.
 * 
 * @author <NAME>
 */
class BlueprintInvocationHandler implements InvocationHandler {

	private final BlueprintConfiguration config;

	public BlueprintInvocationHandler(final BlueprintConfiguration config) {
		this.config = Check.notNull(config, "config");
	}

	@Override
	public Object invoke(final Object instance, final Method method, final Object[] parameters) throws Throwable { // NOSONAR
		return Blueprint.object(method.getReturnType(), config);
	}

}
{'fraction_non_alphanumeric': 0.16750788643533124, 'fraction_numerical': 0.005047318611987382, 'mean_word_length': 5.205479452054795, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '3146074', 'n_tokens_mistral': 772, 'n_tokens_neox': 726, 'n_words': 306}