Skip to content

Commit

Permalink
Better local variable names
Browse files Browse the repository at this point in the history
  • Loading branch information
garydgregory committed Dec 16, 2023
1 parent 7cff388 commit b07637d
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/main/java/org/apache/commons/mail/util/MimeMessageUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand All @@ -61,8 +61,8 @@ public static MimeMessage createMimeMessage(final Session session, final byte[]
* @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);
}
}

Expand Down Expand Up @@ -106,9 +106,9 @@ public static void writeMimeMessage(final MimeMessage mimeMessage, final File re
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();
}
}

Expand Down

0 comments on commit b07637d

Please sign in to comment.