[Fix] Fixed a concurrent modification in DefaultPrivilegeHandler
This commit is contained in:
parent
7ce6375288
commit
c0636deff2
|
@ -1138,8 +1138,8 @@ public class DefaultPrivilegeHandler implements PrivilegeHandler {
|
||||||
if (!this.persistSessions)
|
if (!this.persistSessions)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
List<Certificate> sessions = this.privilegeContextMap.values().stream().map(p -> p.getCertificate())
|
List<Certificate> sessions = new ArrayList<>(this.privilegeContextMap.values()).stream()
|
||||||
.filter(c -> !c.getUserState().isSystem()).collect(Collectors.toList());
|
.map(p -> p.getCertificate()).filter(c -> !c.getUserState().isSystem()).collect(Collectors.toList());
|
||||||
|
|
||||||
try (OutputStream fout = Files.newOutputStream(this.persistSessionsPath.toPath());
|
try (OutputStream fout = Files.newOutputStream(this.persistSessionsPath.toPath());
|
||||||
OutputStream outputStream = AesCryptoHelper.wrapEncrypt(this.secretKey, fout)) {
|
OutputStream outputStream = AesCryptoHelper.wrapEncrypt(this.secretKey, fout)) {
|
||||||
|
|
Loading…
Reference in New Issue