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

Print this page

        

*** 101,128 **** /** * Create a <tt>StreamHandler</tt>, with no current output stream. */ public StreamHandler() { ! sealed = false; ! configure(); ! sealed = true; } /** * 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; configure(); setFormatter(formatter); setOutputStream(out); ! sealed = true; } /** * Change the output stream. * <P> --- 101,126 ---- /** * Create a <tt>StreamHandler</tt>, with no current output stream. */ public StreamHandler() { ! 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) { ! doWithControlPermission(() -> { configure(); setFormatter(formatter); setOutputStream(out); ! }); } /** * Change the output stream. * <P>