// Path: src/main/java/com/insightfullogic/multiinherit/api/MultiInjector.java
// public interface MultiInjector {
// 	
// 	public <T> T getInstance(Class<T> combined);
// 	
// }
// 
// Path: src/main/java/com/insightfullogic/multiinherit/common/ResolutionInfo.java
// public final class ResolutionInfo {
// 
// 	private final String name;
// 	private final Class<?>[] parameterTypes;
// 
// 	public ResolutionInfo(final Method method) {
// 		super();
// 		name = method.getName();
// 		parameterTypes = method.getParameterTypes();
// 	}
// 
// 	@Override
// 	public int hashCode() {
// 		final int prime = 31;
// 		int result = 1;
// 		result = prime * result + ((name == null) ? 0 : name.hashCode());
// 		result = prime * result + Arrays.hashCode(parameterTypes);
// 		return result;
// 	}
// 
// 	@Override
// 	public boolean equals(final Object obj) {
// 		if (this == obj)
// 			return true;
// 		if (obj == null)
// 			return false;
// 		if (getClass() != obj.getClass())
// 			return false;
// 		final ResolutionInfo other = (ResolutionInfo) obj;
// 		if (name == null) {
// 			if (other.name != null)
// 				return false;
// 		} else if (!name.equals(other.name))
// 			return false;
// 		if (!Arrays.equals(parameterTypes, other.parameterTypes))
// 			return false;
// 		return true;
// 	}
// }


import java.lang.reflect.Method;
import java.lang.reflect.Proxy;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
import com.google.inject.Inject;
import com.google.inject.Injector;
import com.google.inject.Singleton;
import com.insightfullogic.multiinherit.api.MultiInjector;
import com.insightfullogic.multiinherit.api.Prefer;
import com.insightfullogic.multiinherit.common.ResolutionInfo;
package com.insightfullogic.multiinherit.reflection;



@Singleton
public class ReflectionMultiInjector implements MultiInjector {

	@Inject
	private Injector injector;

	@SuppressWarnings("unchecked")
	@Override
	public <T> T getInstance(final Class<T> combined) {
		final Class<?>[] parents = combined.getInterfaces();
		Class<?>[] interfaces = null;
		if (combined.isInterface()) {
			interfaces = Arrays.copyOf(parents, parents.length + 1);
			interfaces[parents.length] = combined;
		} else {
			interfaces = parents;
			throw new UnsupportedOperationException(
					"It is impossible to do multiple class inheritance with the Reflection backend, try using the Generation backend");
		}
// Path: src/main/java/com/insightfullogic/multiinherit/api/MultiInjector.java
// public interface MultiInjector {
// 	
// 	public <T> T getInstance(Class<T> combined);
// 	
// }
// 
// Path: src/main/java/com/insightfullogic/multiinherit/common/ResolutionInfo.java
// public final class ResolutionInfo {
// 
// 	private final String name;
// 	private final Class<?>[] parameterTypes;
// 
// 	public ResolutionInfo(final Method method) {
// 		super();
// 		name = method.getName();
// 		parameterTypes = method.getParameterTypes();
// 	}
// 
// 	@Override
// 	public int hashCode() {
// 		final int prime = 31;
// 		int result = 1;
// 		result = prime * result + ((name == null) ? 0 : name.hashCode());
// 		result = prime * result + Arrays.hashCode(parameterTypes);
// 		return result;
// 	}
// 
// 	@Override
// 	public boolean equals(final Object obj) {
// 		if (this == obj)
// 			return true;
// 		if (obj == null)
// 			return false;
// 		if (getClass() != obj.getClass())
// 			return false;
// 		final ResolutionInfo other = (ResolutionInfo) obj;
// 		if (name == null) {
// 			if (other.name != null)
// 				return false;
// 		} else if (!name.equals(other.name))
// 			return false;
// 		if (!Arrays.equals(parameterTypes, other.parameterTypes))
// 			return false;
// 		return true;
// 	}
// }


// Path: src/main/java/com/insightfullogic/multiinherit/reflection/ReflectionMultiInjector.java
import java.lang.reflect.Method;
import java.lang.reflect.Proxy;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
import com.google.inject.Inject;
import com.google.inject.Injector;
import com.google.inject.Singleton;
import com.insightfullogic.multiinherit.api.MultiInjector;
import com.insightfullogic.multiinherit.api.Prefer;
import com.insightfullogic.multiinherit.common.ResolutionInfo;

package com.insightfullogic.multiinherit.reflection;



@Singleton
public class ReflectionMultiInjector implements MultiInjector {

	@Inject
	private Injector injector;

	@SuppressWarnings("unchecked")
	@Override
	public <T> T getInstance(final Class<T> combined) {
		final Class<?>[] parents = combined.getInterfaces();
		Class<?>[] interfaces = null;
		if (combined.isInterface()) {
			interfaces = Arrays.copyOf(parents, parents.length + 1);
			interfaces[parents.length] = combined;
		} else {
			interfaces = parents;
			throw new UnsupportedOperationException(
					"It is impossible to do multiple class inheritance with the Reflection backend, try using the Generation backend");
		}
		final Map<ResolutionInfo, Method> preferences1 = new HashMap<ResolutionInfo, Method>();