Correct lock and flush scoping

This commit is contained in:
Clay Baenziger 2022-10-11 10:20:03 -06:00
parent b408f76d01
commit 5d045909b3
1 changed files with 2 additions and 2 deletions

View File

@ -142,8 +142,8 @@ public abstract class LocalKeyStoreProvider extends
@Override
public void flush() throws IOException {
super.getWriteLock().lock();
try {
super.getWriteLock().lock();
file.createNewFile();
if (LOG.isDebugEnabled()) {
LOG.debug("Resetting permissions to '" + permissions + "'");
@ -159,10 +159,10 @@ public abstract class LocalKeyStoreProvider extends
"-" + PosixFilePermissions.toString(permissions));
FileUtil.setPermission(file, fsPermission);
}
super.flush();
} finally {
super.getWriteLock().unlock();
}
super.flush();
}
private static Set<PosixFilePermission> modeToPosixFilePermission(