src/share/classes/java/util/logging/StreamHandler.java

Print this page

        

@@ -101,28 +101,26 @@
 
     /**
      * Create a <tt>StreamHandler</tt>, with no current output stream.
      */
     public StreamHandler() {
-        sealed = false;
-        configure();
-        sealed = true;
+        doWithControlPermission(this::configure);
     }
 
     /**
      * Create a <tt>StreamHandler</tt> with a given <tt>Formatter</tt>
      * and output stream.
      * <p>
      * @param out         the target output stream
      * @param formatter   Formatter to be used to format output
      */
     public StreamHandler(OutputStream out, Formatter formatter) {
-        sealed = false;
+        doWithControlPermission(() -> {
         configure();
         setFormatter(formatter);
         setOutputStream(out);
-        sealed = true;
+        });
     }
 
     /**
      * Change the output stream.
      * <P>