From 6195bac9757f1279ff72defb05ed14c5c76359d7 Mon Sep 17 00:00:00 2001 From: AnuradhaSK Date: Mon, 23 Oct 2023 10:49:05 +0530 Subject: [PATCH] fix imports --- .../listener/FragmentApplicationMgtListener.java | 12 +++++++----- pom.xml | 2 +- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/components/org.wso2.carbon.identity.organization.management.application/src/main/java/org/wso2/carbon/identity/organization/management/application/listener/FragmentApplicationMgtListener.java b/components/org.wso2.carbon.identity.organization.management.application/src/main/java/org/wso2/carbon/identity/organization/management/application/listener/FragmentApplicationMgtListener.java index 1cf35d9f0..722ba2ac6 100644 --- a/components/org.wso2.carbon.identity.organization.management.application/src/main/java/org/wso2/carbon/identity/organization/management/application/listener/FragmentApplicationMgtListener.java +++ b/components/org.wso2.carbon.identity.organization.management.application/src/main/java/org/wso2/carbon/identity/organization/management/application/listener/FragmentApplicationMgtListener.java @@ -47,8 +47,8 @@ import org.wso2.carbon.identity.organization.management.service.OrganizationManager; import org.wso2.carbon.identity.organization.management.service.exception.OrganizationManagementClientException; import org.wso2.carbon.identity.organization.management.service.exception.OrganizationManagementException; -import org.wso2.carbon.identity.role.v2.mgt.core.IdentityRoleManagementException; import org.wso2.carbon.identity.role.v2.mgt.core.RoleManagementService; +import org.wso2.carbon.identity.role.v2.mgt.core.exception.IdentityRoleManagementException; import java.util.Arrays; import java.util.List; @@ -238,10 +238,12 @@ private AssociatedRolesConfig getAssociatedRolesConfigForSharedApp( throws IdentityRoleManagementException { String allowedAudience = associatedRolesConfigOfMainApp.getAllowedAudience(); - List mainAppRoles = associatedRolesConfigOfMainApp.getRoles(); + RoleV2[] mainAppRoles = associatedRolesConfigOfMainApp.getRoles(); + List mainappRoleList = Arrays.asList(mainAppRoles); AssociatedRolesConfig associatedRolesConfigForSharedApp = new AssociatedRolesConfig(); associatedRolesConfigForSharedApp.setAllowedAudience(allowedAudience); - List mainAppRoleIds = mainAppRoles.stream().map(RoleV2::getId).collect(Collectors.toList()); + List mainAppRoleIds = + mainappRoleList.stream().map(RoleV2::getId).collect(Collectors.toList()); Map mainRoleToSharedRoleMappingsBySubOrg = getRoleManagementServiceV2().getMainRoleToSharedRoleMappingsBySubOrg(mainAppRoleIds, tenantDomainOfSharedApp); @@ -252,7 +254,7 @@ private AssociatedRolesConfig getAssociatedRolesConfigForSharedApp( String mainRoleId = entry.getKey(); // Find the main role by ID and retrieve its name. - String mainRoleName = mainAppRoles.stream() + String mainRoleName = mainappRoleList.stream() .filter(role -> role.getId().equals(mainRoleId)) .findFirst() .map(RoleV2::getName) @@ -265,7 +267,7 @@ private AssociatedRolesConfig getAssociatedRolesConfigForSharedApp( }) .collect(Collectors.toList()); - associatedRolesConfigForSharedApp.setRoles(associatedRolesOfSharedApp); + associatedRolesConfigForSharedApp.setRoles(associatedRolesOfSharedApp.toArray(new RoleV2[0])); return associatedRolesConfigForSharedApp; } diff --git a/pom.xml b/pom.xml index f2760ad67..4875f1e3e 100644 --- a/pom.xml +++ b/pom.xml @@ -503,7 +503,7 @@ [4.7.0,5.0.0) - 5.25.400 + 5.25.424-SNAPSHOT [5.20.0, 7.0.0)