findbugs all over

This commit is contained in:
zzz
2020-08-19 14:50:58 +00:00
parent 797a31924d
commit cc6247fe7e
14 changed files with 23 additions and 20 deletions

View File

@ -186,17 +186,18 @@ public class KeyStoreProvider {
if (_keystore == null) {
File keyStoreFile = new File(getKeyStoreLocation());
InputStream is = null;
try {
_keystore = KeyStore.getInstance(KeyStore.getDefaultType());
if (keyStoreFile.exists()) {
InputStream is = new FileInputStream(keyStoreFile);
is = new FileInputStream(keyStoreFile);
_keystore.load(is, DEFAULT_KEYSTORE_PASSWORD.toCharArray());
return _keystore;
}
initialize();
if (keyStoreFile.exists()) {
InputStream is = new FileInputStream(keyStoreFile);
is = new FileInputStream(keyStoreFile);
_keystore.load(is, DEFAULT_KEYSTORE_PASSWORD.toCharArray());
return _keystore;
} else {
@ -204,6 +205,8 @@ public class KeyStoreProvider {
}
} catch (Exception e) {
// Ignore. Not an issue. Let's just create a new keystore instead.
} finally {
if (is != null) try { is.close(); } catch (IOException ioe) {}
}
return null;
} else {