<commit_before>package de.mccityville.common.java.reflection;

import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;

import com.google.common.base.Preconditions;

public class AssignedMethodInvoker {
	
	private final Object target;
	private final Method method;
	
	public AssignedMethodInvoker(Object target, Method method) {
		Preconditions.checkNotNull(method);
		
		this.target = target;
		this.method = method;
	}
	
	public Object invoke(Object... args) throws IllegalAccessException, IllegalArgumentException, InvocationTargetException {
		if (!method.isAccessible())
			method.setAccessible(true);
		
		return method.invoke(target, args);
	}
}<commit_msg>Equals überschrieben<commit_after>package de.mccityville.common.java.reflection;

import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;

import com.google.common.base.Objects;
import com.google.common.base.Preconditions;

public class AssignedMethodInvoker {
	
	private final Object target;
	private final Method method;
	
	public AssignedMethodInvoker(Object target, Method method) {
		Preconditions.checkNotNull(method);
		
		this.target = target;
		this.method = method;
	}
	
	public Object invoke(Object... args) throws IllegalAccessException, IllegalArgumentException, InvocationTargetException {
		if (!method.isAccessible())
			method.setAccessible(true);
		
		return method.invoke(target, args);
	}
	
	@Override
	public boolean equals(Object other) {
		if (!(other instanceof AssignedMethodInvoker))
			return false;
		
		AssignedMethodInvoker invoker = (AssignedMethodInvoker) other;
		
		if (!Objects.equal(target, invoker.target))
			return false;
		
		if (!Objects.equal(method, invoker.method))
			return false;
		
		return true;
	}
}
{'fraction_non_alphanumeric': 0.0942970073404856, 'fraction_numerical': 0.0, 'mean_word_length': 5.068493150684931, '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': '7664883', 'n_tokens_mistral': 556, 'n_tokens_neox': 493, 'n_words': 116}