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)
| 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 |