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

Print this page

        

@@ -97,15 +97,25 @@
                 // assert false;
             }
         }
     }
 
+    // Package private support for security checking.  When isSealed
+    // returns true, we access check updates to the class.
+    // Initially the value is false, but we set to true at end of
+    // each constructor...
+    private final boolean sealed;
+
+    @Override
+    boolean isSealed() {
+        return sealed;
+    }
+
     /**
      * Create a <tt>StreamHandler</tt>, with no current output stream.
      */
     public StreamHandler() {
-        sealed = false;
         configure();
         sealed = true;
     }
 
     /**

@@ -114,11 +124,10 @@
      * <p>
      * @param out         the target output stream
      * @param formatter   Formatter to be used to format output
      */
     public StreamHandler(OutputStream out, Formatter formatter) {
-        sealed = false;
         configure();
         setFormatter(formatter);
         setOutputStream(out);
         sealed = true;
     }