MCPcopy
hub / github.com/google/guava / initialize

Method initialize

guava/src/com/google/common/reflect/Reflection.java:60–68  ·  view source on GitHub ↗

Ensures that the given classes are initialized, as described in <a href="http://java.sun.com/docs/books/jls/third_edition/html/execution.html#12.4.2">JLS Section 12.4.2</a>. <p>WARNING: Normally it's a smell if a class needs to be explicitly initialized, because static state hurts system maintainab

(Class<?>... classes)

Source from the content-addressed store, hash-verified

58 * @throws ExceptionInInitializerError if an exception is thrown during initialization of a class
59 */
60 public static void initialize(Class<?>... classes) {
61 for (Class<?> clazz : classes) {
62 try {
63 Class.forName(clazz.getName(), true, clazz.getClassLoader());
64 } catch (ClassNotFoundException e) {
65 throw new AssertionError(e);
66 }
67 }
68 }
69
70 /**
71 * Returns a proxy instance that implements {@code interfaceType} by dispatching method

Callers 1

testInitializeMethod · 0.95

Calls 2

getNameMethod · 0.45
getClassLoaderMethod · 0.45

Tested by 1

testInitializeMethod · 0.76