Skip to content

Commit

Permalink
MailHandler LogManger support for mail entries eclipse-ee4j#119
Browse files Browse the repository at this point in the history
Signed-off-by: jmehrens <[email protected]>
  • Loading branch information
jmehrens committed Jan 22, 2024
1 parent 044218e commit be7dcaa
Showing 1 changed file with 10 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -241,8 +241,8 @@
* empty string can be used to specify no sender address.
* (defaults to <code>null</code>, none)
*
* <li>&lt;handler-name&gt;.mailEntries specifies session properties for this
* <code>Handler</code>. The format for the value is described in
* <li>&lt;handler-name&gt;.mailEntries specifies mail session properties for
* this <code>Handler</code>. The format for the value is described in
* {@linkplain #setMailEntries(java.lang.String) setMailEntries} method.
* This property is eagerly loaded where as the
* <a href="#top-level-properties">top level properties</a> are lazily loaded.
Expand Down Expand Up @@ -1428,7 +1428,9 @@ private void setAuthenticator0(final Authenticator auth) {
* trigger <a href="#verify">verification</a>.
*
* @param props properties object or null. A null value will supply the
* <code>mailEntries</code> from the <code>LogManager</code>.
* <code>mailEntries</code> from the <code>LogManager</code>. An empty
* properties will clear all existing mail properties assigned to this
* handler.
* @throws SecurityException if a security manager exists and the
* caller does not have <code>LoggingPermission("control")</code>.
* @throws IllegalStateException if called from inside a push.
Expand Down Expand Up @@ -1495,16 +1497,11 @@ public final Properties getMailProperties() {
props = this.mailProps;
}

final Object clone = props.clone();
if (clone != null) {
try {
return (Properties) clone;
} catch (ClassCastException brokenClone) {
reportError(props.getClass().getName(),
brokenClone, ErrorManager.GENERIC_FAILURE);
}
} else {
reportNullError(ErrorManager.GENERIC_FAILURE);
try {
return Objects.requireNonNull((Properties) props.clone());
} catch (RuntimeException brokenClone) {
reportError(props.getClass().getName(),
brokenClone, ErrorManager.GENERIC_FAILURE);
}
return new Properties();
}
Expand Down

0 comments on commit be7dcaa

Please sign in to comment.