mirror of
https://github.com/moparisthebest/davmail
synced 2025-02-28 09:21:49 -05:00
Various fixes from FindBugs audit
git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@731 3d1905a2-6b24-0410-a738-b14d5a86fcbd
This commit is contained in:
parent
78691ae389
commit
8bfa014ab3
@ -86,12 +86,13 @@ public abstract class AbstractServer extends Thread {
|
||||
if (keystoreFile == null || keystoreFile.length() == 0) {
|
||||
serverSocketFactory = ServerSocketFactory.getDefault();
|
||||
} else {
|
||||
|
||||
FileInputStream keyStoreInputStream = null;
|
||||
try {
|
||||
keyStoreInputStream = new FileInputStream(keystoreFile);
|
||||
// keystore for keys and certificates
|
||||
// keystore and private keys should be password protected...
|
||||
KeyStore keystore = KeyStore.getInstance(Settings.getProperty("davmail.ssl.keystoreType"));
|
||||
keystore.load(new FileInputStream(keystoreFile),
|
||||
keystore.load(keyStoreInputStream,
|
||||
Settings.getProperty("davmail.ssl.keystorePass").toCharArray());
|
||||
|
||||
// KeyManagerFactory to create key managers
|
||||
@ -113,6 +114,14 @@ public abstract class AbstractServer extends Thread {
|
||||
throw new DavMailException("LOG_EXCEPTION_CREATING_SSL_SERVER_SOCKET", getProtocolName(), port, ex.getMessage() == null ? ex.toString() : ex.getMessage());
|
||||
} catch (GeneralSecurityException ex) {
|
||||
throw new DavMailException("LOG_EXCEPTION_CREATING_SSL_SERVER_SOCKET", getProtocolName(), port, ex.getMessage() == null ? ex.toString() : ex.getMessage());
|
||||
} finally {
|
||||
if (keyStoreInputStream != null) {
|
||||
try {
|
||||
keyStoreInputStream.close();
|
||||
} catch (IOException exc) {
|
||||
DavGatewayTray.warn(new BundleMessage("LOG_EXCEPTION_CLOSING_KEYSTORE_INPUT_STREAM"), exc);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
try {
|
||||
|
@ -1697,7 +1697,7 @@ public class ExchangeSession {
|
||||
}
|
||||
|
||||
private static int dumpIndex = 1;
|
||||
private static String defaultSound = "Basso";
|
||||
private String defaultSound = "Basso";
|
||||
|
||||
protected void dumpICS(String icsBody, boolean fromServer, boolean after) {
|
||||
// additional setting to activate ICS dump (not available in GUI)
|
||||
|
@ -128,7 +128,11 @@ public class DavGatewayX509TrustManager implements X509TrustManager {
|
||||
while (!yes.equals(answer) && !no.equals(answer)) {
|
||||
System.out.println(buffer.toString());
|
||||
try {
|
||||
answer = inReader.readLine().toLowerCase();
|
||||
answer = inReader.readLine();
|
||||
if (answer == null) {
|
||||
answer = no;
|
||||
}
|
||||
answer = answer.toLowerCase();
|
||||
} catch (IOException e) {
|
||||
System.err.println(e);
|
||||
}
|
||||
|
@ -39,7 +39,7 @@ public class PasswordPromptDialog extends JDialog {
|
||||
* @return user password as char array
|
||||
*/
|
||||
public char[] getPassword() {
|
||||
return password;
|
||||
return password.clone();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -49,11 +49,11 @@ public class AwtGatewayTray implements DavGatewayTrayInterface {
|
||||
static SettingsFrame settingsFrame;
|
||||
ActionListener settingsListener;
|
||||
|
||||
protected static TrayIcon trayIcon;
|
||||
static TrayIcon trayIcon;
|
||||
private static Image image;
|
||||
private static Image image2;
|
||||
private static Image inactiveImage;
|
||||
protected static LogBrokerMonitor logBrokerMonitor;
|
||||
LogBrokerMonitor logBrokerMonitor;
|
||||
private boolean isActive = true;
|
||||
|
||||
/**
|
||||
|
@ -41,10 +41,10 @@ public class FrameGatewayTray implements DavGatewayTrayInterface {
|
||||
protected FrameGatewayTray() {
|
||||
}
|
||||
|
||||
protected static JFrame mainFrame;
|
||||
protected static AboutFrame aboutFrame;
|
||||
protected static SettingsFrame settingsFrame;
|
||||
protected static LogBrokerMonitor logBrokerMonitor;
|
||||
static JFrame mainFrame;
|
||||
static AboutFrame aboutFrame;
|
||||
static SettingsFrame settingsFrame;
|
||||
LogBrokerMonitor logBrokerMonitor;
|
||||
private static JEditorPane errorArea;
|
||||
private static JLabel errorLabel;
|
||||
private static JEditorPane messageArea;
|
||||
|
@ -50,7 +50,7 @@ public class SwtGatewayTray implements DavGatewayTrayInterface {
|
||||
private static Image inactiveImage;
|
||||
private static Display display;
|
||||
private static Shell shell;
|
||||
private static LogBrokerMonitor logBrokerMonitor;
|
||||
private LogBrokerMonitor logBrokerMonitor;
|
||||
private boolean isActive = true;
|
||||
private boolean isReady;
|
||||
|
||||
|
@ -227,3 +227,4 @@ UI_UNTRUSTED_CERTIFICATE_HTML=<html><b>Server provided an untrusted certificate,
|
||||
UI_VALID_FROM=Valid from
|
||||
UI_VALID_UNTIL=Valid until
|
||||
MEETING_REQUEST=Meeting request
|
||||
LOG_EXCEPTION_CLOSING_KEYSTORE_INPUT_STREAM=Exception closing keystore input stream
|
@ -227,3 +227,4 @@ LOG_ACCESS_FORBIDDEN=Acc
|
||||
LOG_LDAP_REQ_BIND_INVALID_CREDENTIALS=LDAP_REQ_BIND Utilisateur ou mot de passe invalide
|
||||
LOG_LDAP_REQ_BIND_SUCCESS=LOG_LDAP_REQ_BIND Authentification réussie
|
||||
EXCEPTION_GET_FAILED=La requête GET a échoué avec le statut {0} à l''adresse {1}
|
||||
LOG_EXCEPTION_CLOSING_KEYSTORE_INPUT_STREAM=Erreur à la fermeture du flux d''entrée du fichier de clés
|
Loading…
x
Reference in New Issue
Block a user