From 7849e77b295d7967c38c6f55c9deed1649418e62 Mon Sep 17 00:00:00 2001 From: Jorge Bescos Gascon Date: Fri, 8 Mar 2024 06:27:01 +0100 Subject: [PATCH] Update MessagingException Signed-off-by: Jorge Bescos Gascon --- api/src/main/java/jakarta/mail/BodyPart.java | 2 +- api/src/main/java/jakarta/mail/Message.java | 2 +- api/src/main/java/jakarta/mail/Multipart.java | 4 ++-- api/src/main/java/jakarta/mail/Part.java | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/api/src/main/java/jakarta/mail/BodyPart.java b/api/src/main/java/jakarta/mail/BodyPart.java index 77ec3c2f..876a2214 100644 --- a/api/src/main/java/jakarta/mail/BodyPart.java +++ b/api/src/main/java/jakarta/mail/BodyPart.java @@ -69,7 +69,7 @@ void setParent(Multipart parent) { } @Override - public StreamProvider getStreamProvider() throws NoSuchProviderException { + public StreamProvider getStreamProvider() throws MessagingException { if (parent != null) { return parent.getStreamProvider(); } else { diff --git a/api/src/main/java/jakarta/mail/Message.java b/api/src/main/java/jakarta/mail/Message.java index e1f915d6..b12586e7 100644 --- a/api/src/main/java/jakarta/mail/Message.java +++ b/api/src/main/java/jakarta/mail/Message.java @@ -709,7 +709,7 @@ public boolean match(SearchTerm term) throws MessagingException { } @Override - public StreamProvider getStreamProvider() throws NoSuchProviderException { + public StreamProvider getStreamProvider() throws MessagingException { try { try { final Session s = this.session; diff --git a/api/src/main/java/jakarta/mail/Multipart.java b/api/src/main/java/jakarta/mail/Multipart.java index 18750a24..5702c64a 100644 --- a/api/src/main/java/jakarta/mail/Multipart.java +++ b/api/src/main/java/jakarta/mail/Multipart.java @@ -267,11 +267,11 @@ public synchronized void setParent(Part parent) { * {@link Session#getDefaultInstance(java.util.Properties, Authenticator)}. * * @return the StreamProvider implementation from the session. - * @throws NoSuchProviderException if errors. + * @throws MessagingException if errors. * * @since JavaMail 2.2 */ - protected StreamProvider getStreamProvider() throws NoSuchProviderException { + protected StreamProvider getStreamProvider() throws MessagingException { Part parent = this.parent; if (parent != null) { return parent.getStreamProvider(); diff --git a/api/src/main/java/jakarta/mail/Part.java b/api/src/main/java/jakarta/mail/Part.java index 612e28ec..68cb4680 100644 --- a/api/src/main/java/jakarta/mail/Part.java +++ b/api/src/main/java/jakarta/mail/Part.java @@ -461,11 +461,11 @@ Enumeration
getNonMatchingHeaders(String[] header_names) * It defaults to {@link Session#getDefaultInstance(java.util.Properties, Authenticator)}. * * @return the StreamProvider. - * @throws NoSuchProviderException if errors. + * @throws MessagingException if errors. * * @since JavaMail 2.2 */ - default StreamProvider getStreamProvider() throws NoSuchProviderException { + default StreamProvider getStreamProvider() throws MessagingException { try { try { return Session.getDefaultInstance(System.getProperties(), null).getStreamProvider();