< prev index next >

src/java.base/share/classes/jdk/internal/misc/VM.java

Print this page
*** 25,18 ***
  
  package jdk.internal.misc;
  
  import static java.lang.Thread.State.*;
  
- import java.text.NumberFormat;
  import java.util.ArrayList;
  import java.util.Collections;
  import java.util.List;
  import java.util.Map;
  
  import jdk.internal.access.SharedSecrets;
! 
  import sun.nio.ch.FileChannelImpl;
  
  public class VM {
  
      // the init level when the VM is fully initialized
--- 25,17 ---
  
  package jdk.internal.misc;
  
  import static java.lang.Thread.State.*;
  
  import java.util.ArrayList;
  import java.util.Collections;
  import java.util.List;
  import java.util.Map;
  
  import jdk.internal.access.SharedSecrets;
! import jdk.internal.vm.annotation.Stable;
  import sun.nio.ch.FileChannelImpl;
  
  public class VM {
  
      // the init level when the VM is fully initialized

*** 89,11 ***
      /**
       * Returns {@code true} if the module system has been initialized.
       * @see java.lang.System#initPhase2
       */
      public static boolean isModuleSystemInited() {
!         return VM.initLevel() >= MODULE_SYSTEM_INITED;
      }
  
      /**
       * Returns {@code true} if the VM is fully initialized.
       */
--- 88,23 ---
      /**
       * Returns {@code true} if the module system has been initialized.
       * @see java.lang.System#initPhase2
       */
      public static boolean isModuleSystemInited() {
!         return initLevel >= MODULE_SYSTEM_INITED;
+     }
+ 
+     private static @Stable boolean javaLangInvokeInited;
+     public static void setJavaLangInvokeInited() {
+         if (javaLangInvokeInited) {
+             throw new InternalError("java.lang.invoke already inited");
+         }
+         javaLangInvokeInited = true;
+     }
+ 
+     public static boolean isJavaLangInvokeInited() {
+         return javaLangInvokeInited;
      }
  
      /**
       * Returns {@code true} if the VM is fully initialized.
       */
< prev index next >