HADOOP-18279. Cancel fileMonitoringTimer even if trustManager isn't defined (#4789)

Co-authored-by: Steve Vaughan Jr <s_vaughan@apple.com>
This commit is contained in:
Steve Vaughan 2023-02-01 16:33:34 -05:00 committed by GitHub
parent f3fa4af5dc
commit 7b6a69faaa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -319,8 +319,10 @@ public class FileBasedKeyStoresFactory implements KeyStoresFactory {
*/
@Override
public synchronized void destroy() {
if (trustManager != null) {
if (fileMonitoringTimer != null) {
fileMonitoringTimer.cancel();
}
if (trustManager != null) {
trustManager = null;
keyManagers = null;
trustManagers = null;