Here you can find the source of isAssignableFrom(Class clazzA, Class clazzB)
private static boolean isAssignableFrom(Class clazzA, Class clazzB)
//package com.java2s; /******************************************************************************* * Copyright (c) 2010 Markus Alexander Kuppe. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors:// ww w. ja v a 2 s .com * Markus Alexander Kuppe (ecf-dev_eclipse.org <at> lemmster <dot> de) - initial API and implementation ******************************************************************************/ import java.util.*; public class Main { private static Map convertor = new HashMap(); private static boolean isAssignableFrom(Class clazzA, Class clazzB) { if (!(clazzA.isPrimitive() ^ clazzB.isPrimitive())) { return clazzA.isAssignableFrom(clazzB); } else if (clazzA.isPrimitive()) { final Class oClazzA = (Class) convertor.get(clazzA); return oClazzA.isAssignableFrom(clazzB); } else { final Class oClazzB = (Class) convertor.get(clazzB); return clazzA.isAssignableFrom(oClazzB); } } }