mirror of
https://github.com/M66B/FairEmail.git
synced 2026-01-07 05:15:43 +01:00
use try-with-resources
This commit is contained in:
@@ -616,8 +616,7 @@ public class FragmentIdentity extends FragmentBase {
|
||||
|
||||
// Create transport
|
||||
String protocol = (starttls ? "smtp" : "smtps");
|
||||
Transport itransport = isession.getTransport(protocol);
|
||||
try {
|
||||
try (Transport itransport = isession.getTransport(protocol)) {
|
||||
try {
|
||||
itransport.connect(host, Integer.parseInt(port), user, password);
|
||||
} catch (AuthenticationFailedException ex) {
|
||||
@@ -627,8 +626,6 @@ public class FragmentIdentity extends FragmentBase {
|
||||
} else
|
||||
throw ex;
|
||||
}
|
||||
} finally {
|
||||
itransport.close();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user