< prev index next >

test/testlibrary/ctw/src/sun/hotspot/tools/ctw/PathHandler.java

Print this page

        

@@ -38,10 +38,11 @@
 /**
  * Abstract handler for path.
  * Concrete subclasses should implement method {@link #process()}.
  */
 public abstract class PathHandler {
+    private static final Unsafe UNSAFE = jdk.test.lib.Utils.getUnsafe();
     private static final AtomicLong CLASS_COUNT = new AtomicLong(0L);
     private static volatile boolean CLASSES_LIMIT_REACHED = false;
     private static final Pattern JAR_IN_DIR_PATTERN
             = Pattern.compile("^(.*[/\\\\])?\\*$");
     protected final Path root;

@@ -149,10 +150,11 @@
             return;
         }
         if (id >= Utils.COMPILE_THE_WORLD_START_AT) {
             try {
                 Class<?> aClass = loader.loadClass(name);
+                UNSAFE.ensureClassInitialized(aClass);
                 CompileTheWorld.OUT.printf("[%d]\t%s%n", id, name);
                 Compiler.compileClass(aClass, id, executor);
             } catch (ClassNotFoundException e) {
                 CompileTheWorld.OUT.printf("Class %s loading failed : %s%n",
                         name, e.getMessage());
< prev index next >