Ensures that the given classes are initialized, as described in JLS Section 12.4.2 . WARNING: Normally it's a smell if a class needs to be explicitly initialized, because static state hurts system maintaina
(Class<?>... classes)
| 71 | |
| 72 | |
| 73 | public static void initialize(Class<?>... classes) { |
| 74 | for (Class<?> clazz : classes) { |
| 75 | try { |
| 76 | Class.forName(clazz.getName(), true, clazz.getClassLoader()); |
| 77 | } catch (ClassNotFoundException e) { |
| 78 | throw new AssertionError(e); |
| 79 | } |
| 80 | } |
| 81 | } |
| 82 | |
| 83 | /** |
| 84 | * Returns a proxy instance that implements {@code interfaceType} by dispatching method |