Created
March 15, 2017 07:00
-
-
Save qingniufly/7f79028649f16dd8fde2fc74a84aa1de to your computer and use it in GitHub Desktop.
ClassLoader, Reflect
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class ReflectHelpers { | |
public static ClassLoader findClassLoader() { | |
ClassLoader classLoader = Thread.currentThread().getContextClassLoader(); | |
if(classLoader == null) { | |
classLoader = ReflectHelpers.class.getClassLoader(); | |
} | |
if(classLoader == null) { | |
classLoader = ClassLoader.getSystemClassLoader(); | |
} | |
return classLoader; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment