返回给定的加载器或系统类加载器(如果loader为null)
/** from N o w J a v a . c o m**/ //package com.nowjava; public class Main { /** * Returns the given loader or the sytem classloader if loader is null * * @param loader * @return */ public static ClassLoader getLoaderOrSystemLoader(ClassLoader loader) { if (loader != null) { return loader; } else { return ClassLoader.getSystemClassLoader(); } } }