You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2023/12/16 16:50:32 UTC
(commons-email) 02/02: Better local variable names
This is an automated email from the ASF dual-hosted git repository.
ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-email.git
commit b07637d4fe75cb1d4da754ebef8c5062c206b631
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Sat Dec 16 11:50:25 2023 -0500
Better local variable names
---
.../org/apache/commons/mail/util/MimeMessageUtils.java | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/src/main/java/org/apache/commons/mail/util/MimeMessageUtils.java b/src/main/java/org/apache/commons/mail/util/MimeMessageUtils.java
index f1ab564..12784ff 100644
--- a/src/main/java/org/apache/commons/mail/util/MimeMessageUtils.java
+++ b/src/main/java/org/apache/commons/mail/util/MimeMessageUtils.java
@@ -46,8 +46,8 @@ public final class MimeMessageUtils {
* @throws IOException creating the MimeMessage failed
*/
public static MimeMessage createMimeMessage(final Session session, final byte[] source) throws MessagingException, IOException {
- try (ByteArrayInputStream is = new ByteArrayInputStream(source)) {
- return new MimeMessage(session, is);
+ try (ByteArrayInputStream inputStream = new ByteArrayInputStream(source)) {
+ return new MimeMessage(session, inputStream);
}
}
@@ -61,8 +61,8 @@ public final class MimeMessageUtils {
* @throws IOException creating the MimeMessage failed
*/
public static MimeMessage createMimeMessage(final Session session, final File source) throws MessagingException, IOException {
- try (FileInputStream is = new FileInputStream(source)) {
- return createMimeMessage(session, is);
+ try (FileInputStream inputStream = new FileInputStream(source)) {
+ return createMimeMessage(session, inputStream);
}
}
@@ -106,9 +106,9 @@ public final class MimeMessageUtils {
if (!resultFile.getParentFile().exists() && !resultFile.getParentFile().mkdirs()) {
throw new IOException("Failed to create the following parent directories: " + resultFile.getParentFile());
}
- try (FileOutputStream fos = new FileOutputStream(resultFile)) {
- mimeMessage.writeTo(fos);
- fos.flush();
+ try (FileOutputStream outputStream = new FileOutputStream(resultFile)) {
+ mimeMessage.writeTo(outputStream);
+ outputStream.flush();
}
}