[KEYCLOAK-17080] Fix ConcurrentModificationException in the migration to 8.0.0 that was introduced by the streamification work
This commit is contained in:
parent
33bb1fda38
commit
bea3410357
1 changed files with 4 additions and 2 deletions
|
@ -28,6 +28,7 @@ import org.keycloak.models.RealmModel;
|
|||
import org.keycloak.representations.idm.RealmRepresentation;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author <a href="mailto:mposolda@redhat.com">Marek Posolda</a>
|
||||
|
@ -78,11 +79,12 @@ public class MigrateTo8_0_0 implements Migration {
|
|||
}
|
||||
|
||||
protected void migrateRealmMFA(RealmModel realm) {
|
||||
realm.getAuthenticationFlowsStream()
|
||||
realm.getAuthenticationFlowsStream().collect(Collectors.toList())
|
||||
.forEach(authFlow ->
|
||||
realm.getAuthenticationExecutionsStream(authFlow.getId())
|
||||
.filter(exe -> exe.getRequirement() == AuthenticationExecutionModel.Requirement.CONDITIONAL)
|
||||
.forEachOrdered(exe -> migrateOptionalAuthenticationExecution(realm, authFlow, exe, true)));
|
||||
.collect(Collectors.toList())
|
||||
.forEach(exe -> migrateOptionalAuthenticationExecution(realm, authFlow, exe, true)));
|
||||
}
|
||||
|
||||
public static void migrateOptionalAuthenticationExecution(RealmModel realm, AuthenticationFlowModel parentFlow, AuthenticationExecutionModel optionalExecution, boolean updateOptionalExecution) {
|
||||
|
|
Loading…
Reference in a new issue