< prev index next >

src/java.base/share/classes/jdk/internal/access/SharedSecrets.java

Print this page
@@ -35,10 +35,12 @@
  import java.util.jar.JarFile;
  import java.io.Console;
  import java.io.FileDescriptor;
  import java.io.FilePermission;
  import java.io.ObjectInputStream;
+ import java.io.PrintStream;
+ import java.io.PrintWriter;
  import java.io.RandomAccessFile;
  import java.security.ProtectionDomain;
  import java.security.Signature;
  
  /** A repository of "shared secrets", which are a mechanism for

@@ -59,10 +61,12 @@
      private static JavaLangInvokeAccess javaLangInvokeAccess;
      private static JavaLangModuleAccess javaLangModuleAccess;
      private static JavaLangRefAccess javaLangRefAccess;
      private static JavaLangReflectAccess javaLangReflectAccess;
      private static JavaIOAccess javaIOAccess;
+     private static JavaIOPrintStreamAccess javaIOPrintStreamAccess;
+     private static JavaIOPrintWriterAccess javaIOPrintWriterAccess;
      private static JavaIOFileDescriptorAccess javaIOFileDescriptorAccess;
      private static JavaIOFilePermissionAccess javaIOFilePermissionAccess;
      private static JavaIORandomAccessFileAccess javaIORandomAccessFileAccess;
      private static JavaObjectInputStreamReadString javaObjectInputStreamReadString;
      private static JavaObjectInputStreamAccess javaObjectInputStreamAccess;

@@ -242,10 +246,36 @@
              access = javaIOAccess;
          }
          return access;
      }
  
+     public static void setJavaIOCPrintWriterAccess(JavaIOPrintWriterAccess a) {
+         javaIOPrintWriterAccess = a;
+     }
+ 
+     public static JavaIOPrintWriterAccess getJavaIOPrintWriterAccess() {
+         var access = javaIOPrintWriterAccess;
+         if (access == null) {
+             ensureClassInitialized(PrintWriter.class);
+             access = javaIOPrintWriterAccess;
+         }
+         return access;
+     }
+ 
+     public static void setJavaIOCPrintStreamAccess(JavaIOPrintStreamAccess a) {
+         javaIOPrintStreamAccess = a;
+     }
+ 
+     public static JavaIOPrintStreamAccess getJavaIOPrintStreamAccess() {
+         var access = javaIOPrintStreamAccess;
+         if (access == null) {
+             ensureClassInitialized(PrintStream.class);
+             access = javaIOPrintStreamAccess;
+         }
+         return access;
+     }
+ 
      public static void setJavaIOFileDescriptorAccess(JavaIOFileDescriptorAccess jiofda) {
          javaIOFileDescriptorAccess = jiofda;
      }
  
      public static JavaIOFilePermissionAccess getJavaIOFilePermissionAccess() {
< prev index next >