Merge pull request #149 from Unpublished/cleanup

use try-with-resources and NotificationCompat
This commit is contained in:
Marcel Bokhorst
2019-02-25 21:10:00 +01:00
committed by GitHub
17 changed files with 151 additions and 382 deletions

View File

@@ -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();
}
}