From e19f3420ff9db52e7ff3d960aee3f9122848ec83 Mon Sep 17 00:00:00 2001 From: Jorge Bescos Gascon Date: Fri, 1 Apr 2022 11:43:19 +0200 Subject: [PATCH] expected resource not found: /META-INF/javamail.default.address.map #598 Signed-off-by: Jorge Bescos Gascon --- api/src/main/java/jakarta/mail/Session.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/api/src/main/java/jakarta/mail/Session.java b/api/src/main/java/jakarta/mail/Session.java index 5fe4d54b..e76b7acb 100644 --- a/api/src/main/java/jakarta/mail/Session.java +++ b/api/src/main/java/jakarta/mail/Session.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2021 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2022 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -261,10 +261,12 @@ private Session(Properties props, Authenticator authenticator) { // get the Class associated with the Authenticator Class cl; - if (authenticator != null) + if (authenticator != null) { cl = authenticator.getClass(); - else - cl = this.getClass(); + } else { + // Use implementation class, because that class loader has access to jakarta.mail module and implementation resources + cl = streamProvider.getClass(); + } // load the resources loadProviders(cl); loadAddressMap(cl);