mirror of
https://github.com/M66B/FairEmail.git
synced 2025-12-26 15:40:59 +01:00
Merge pull request #149 from Unpublished/cleanup
use try-with-resources and NotificationCompat
This commit is contained in:
@@ -618,8 +618,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) {
|
||||
@@ -629,8 +628,6 @@ public class FragmentIdentity extends FragmentBase {
|
||||
} else
|
||||
throw ex;
|
||||
}
|
||||
} finally {
|
||||
itransport.close();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user