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

Print this page

        

@@ -114,13 +114,11 @@
     /**
      * Create a <tt>MemoryHandler</tt> and configure it based on
      * <tt>LogManager</tt> configuration properties.
      */
     public MemoryHandler() {
-        sealed = false;
-        configure();
-        sealed = true;
+        doWithControlPermission(this::configure);
 
         LogManager manager = LogManager.getLogManager();
         String handlerName = getClass().getName();
         String targetName = manager.getProperty(handlerName+".target");
         if (targetName == null) {

@@ -162,13 +160,11 @@
             throw new NullPointerException();
         }
         if (size <= 0) {
             throw new IllegalArgumentException();
         }
-        sealed = false;
-        configure();
-        sealed = true;
+        doWithControlPermission(this::configure);
         this.target = target;
         this.pushLevel = pushLevel;
         this.size = size;
         init();
     }