@Test public void testInitSubject() throws Exception { InternalErrorManager em; MailHandler target; final String p = MailHandler.class.getName(); final LogManager manager = LogManager.getLogManager(); Properties props = createInitProperties(p); props.put(p.concat(".errorManager"), InternalErrorManager.class.getName()); props.put(p.concat(".subject"), Properties.class.getName()); read(manager, props); try { target = new MailHandler(); try { em = internalErrorManagerFrom(target); for (int i = 0; i < em.exceptions.size(); i++) { dump(em.exceptions.get(i)); } assertTrue(em.exceptions.isEmpty()); } finally { target.close(); } props.put(p.concat(".subject"), ThrowFormatter.class.getName().toUpperCase(Locale.US)); read(manager, props); target = new MailHandler(); try { em = internalErrorManagerFrom(target); for (int i = 0; i < em.exceptions.size(); i++) { dump(em.exceptions.get(i)); } assertTrue(em.exceptions.isEmpty()); } finally { target.close(); } props.put(p.concat(".subject"), Properties.class.getName().toUpperCase(Locale.US)); read(manager, props); target = new MailHandler(); try { em = internalErrorManagerFrom(target); for (int i = 0; i < em.exceptions.size(); i++) { dump(em.exceptions.get(i)); } assertTrue(em.exceptions.isEmpty()); } finally { target.close(); } } finally { manager.reset(); } }
private void initSubject(LogManager manager, final String p) { assert Thread.holdsLock(this); String name = manager.getProperty(p.concat(".subject")); if (hasValue(name)) { try { this.subjectFormatter = LogManagerProperties.newFormatter(name); } catch (final SecurityException SE) { throw SE; } catch (final ClassNotFoundException literalSubject) { this.subjectFormatter = new TailNameFormatter(name); } catch (final ClassCastException literalSubject) { this.subjectFormatter = new TailNameFormatter(name); } catch (final Exception E) { this.subjectFormatter = new TailNameFormatter(name); reportError(E.getMessage(), E, ErrorManager.OPEN_FAILURE); } } else { if (name != null) { this.subjectFormatter = new TailNameFormatter(name); } } if (this.subjectFormatter == null) { this.subjectFormatter = new TailNameFormatter(""); } }
MailHandler extends Handler { private void initSubject(LogManager manager, final String p) { assert Thread.holdsLock(this); String name = manager.getProperty(p.concat(".subject")); if (hasValue(name)) { try { this.subjectFormatter = LogManagerProperties.newFormatter(name); } catch (final SecurityException SE) { throw SE; } catch (final ClassNotFoundException literalSubject) { this.subjectFormatter = new TailNameFormatter(name); } catch (final ClassCastException literalSubject) { this.subjectFormatter = new TailNameFormatter(name); } catch (final Exception E) { this.subjectFormatter = new TailNameFormatter(name); reportError(E.getMessage(), E, ErrorManager.OPEN_FAILURE); } } else { if (name != null) { this.subjectFormatter = new TailNameFormatter(name); } } if (this.subjectFormatter == null) { this.subjectFormatter = new TailNameFormatter(""); } } }
MailHandler extends Handler { private void initSubject(LogManager manager, final String p) { assert Thread.holdsLock(this); String name = manager.getProperty(p.concat(".subject")); if (hasValue(name)) { try { this.subjectFormatter = LogManagerProperties.newFormatter(name); } catch (final SecurityException SE) { throw SE; } catch (final ClassNotFoundException literalSubject) { this.subjectFormatter = new TailNameFormatter(name); } catch (final ClassCastException literalSubject) { this.subjectFormatter = new TailNameFormatter(name); } catch (final Exception E) { this.subjectFormatter = new TailNameFormatter(name); reportError(E.getMessage(), E, ErrorManager.OPEN_FAILURE); } } else { if (name != null) { this.subjectFormatter = new TailNameFormatter(name); } } if (this.subjectFormatter == null) { this.subjectFormatter = new TailNameFormatter(""); } } MailHandler();  MailHandler(final int capacity);  MailHandler(final Properties props); }
MailHandler extends Handler { private void initSubject(LogManager manager, final String p) { assert Thread.holdsLock(this); String name = manager.getProperty(p.concat(".subject")); if (hasValue(name)) { try { this.subjectFormatter = LogManagerProperties.newFormatter(name); } catch (final SecurityException SE) { throw SE; } catch (final ClassNotFoundException literalSubject) { this.subjectFormatter = new TailNameFormatter(name); } catch (final ClassCastException literalSubject) { this.subjectFormatter = new TailNameFormatter(name); } catch (final Exception E) { this.subjectFormatter = new TailNameFormatter(name); reportError(E.getMessage(), E, ErrorManager.OPEN_FAILURE); } } else { if (name != null) { this.subjectFormatter = new TailNameFormatter(name); } } if (this.subjectFormatter == null) { this.subjectFormatter = new TailNameFormatter(""); } } MailHandler();  MailHandler(final int capacity);  MailHandler(final Properties props); @Override boolean isLoggable(final LogRecord record); void publish(final LogRecord record); void push(); void flush(); void close(); @Override synchronized void setLevel(final Level newLevel); final synchronized Level getPushLevel(); final synchronized void setPushLevel(final Level level); final synchronized Filter getPushFilter(); final synchronized void setPushFilter(final Filter filter); final synchronized Comparator<? super LogRecord> getComparator(); final synchronized void setComparator(Comparator<? super LogRecord> c); final synchronized int getCapacity(); final synchronized Authenticator getAuthenticator(); final void setAuthenticator(final Authenticator auth); final void setAuthenticator(final char... password); final void setMailProperties(Properties props); final Properties getMailProperties(); final Filter[] getAttachmentFilters(); final void setAttachmentFilters(Filter... filters); final Formatter[] getAttachmentFormatters(); final void setAttachmentFormatters(Formatter... formatters); final Formatter[] getAttachmentNames(); final void setAttachmentNames(final String... names); final void setAttachmentNames(Formatter... formatters); final synchronized Formatter getSubject(); final void setSubject(final String subject); final void setSubject(final Formatter format); }
MailHandler extends Handler { private void initSubject(LogManager manager, final String p) { assert Thread.holdsLock(this); String name = manager.getProperty(p.concat(".subject")); if (hasValue(name)) { try { this.subjectFormatter = LogManagerProperties.newFormatter(name); } catch (final SecurityException SE) { throw SE; } catch (final ClassNotFoundException literalSubject) { this.subjectFormatter = new TailNameFormatter(name); } catch (final ClassCastException literalSubject) { this.subjectFormatter = new TailNameFormatter(name); } catch (final Exception E) { this.subjectFormatter = new TailNameFormatter(name); reportError(E.getMessage(), E, ErrorManager.OPEN_FAILURE); } } else { if (name != null) { this.subjectFormatter = new TailNameFormatter(name); } } if (this.subjectFormatter == null) { this.subjectFormatter = new TailNameFormatter(""); } } MailHandler();  MailHandler(final int capacity);  MailHandler(final Properties props); @Override boolean isLoggable(final LogRecord record); void publish(final LogRecord record); void push(); void flush(); void close(); @Override synchronized void setLevel(final Level newLevel); final synchronized Level getPushLevel(); final synchronized void setPushLevel(final Level level); final synchronized Filter getPushFilter(); final synchronized void setPushFilter(final Filter filter); final synchronized Comparator<? super LogRecord> getComparator(); final synchronized void setComparator(Comparator<? super LogRecord> c); final synchronized int getCapacity(); final synchronized Authenticator getAuthenticator(); final void setAuthenticator(final Authenticator auth); final void setAuthenticator(final char... password); final void setMailProperties(Properties props); final Properties getMailProperties(); final Filter[] getAttachmentFilters(); final void setAttachmentFilters(Filter... filters); final Formatter[] getAttachmentFormatters(); final void setAttachmentFormatters(Formatter... formatters); final Formatter[] getAttachmentNames(); final void setAttachmentNames(final String... names); final void setAttachmentNames(Formatter... formatters); final synchronized Formatter getSubject(); final void setSubject(final String subject); final void setSubject(final Formatter format);  }