Skip to content

Commit

Permalink
Merge pull request #513 from ZiyamSanthosh/master-beta2-security
Browse files Browse the repository at this point in the history
Refine string value comparison logic to improve code quality
  • Loading branch information
chamathns authored Nov 30, 2023
2 parents e4b517a + 8f3be5e commit 588ecd6
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

package org.wso2.carbon.identity.scim2.common.impl;

import java.util.Objects;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.collections.ListUtils;
import org.apache.commons.collections.MapUtils;
Expand Down Expand Up @@ -2394,8 +2395,9 @@ private Boolean hasBothIdentityClaimAndDefaultClaims(List<ExpressionCondition> e
for (ExpressionCondition expressionCondition : expressionConditions) {
List<LocalClaim> mappedClaim =
claimMapping1.stream()
.filter(mapping -> mapping.getMappedAttributes().get(0).getAttributeName() ==
expressionCondition.getAttributeName()).collect(Collectors.toList());
.filter(mapping -> Objects.equals(
mapping.getMappedAttributes().get(0).getAttributeName(),
expressionCondition.getAttributeName())).collect(Collectors.toList());
//Obtaining relevant URI for the mapped attribute.
if (mappedClaim.size() == 1) {
String tempClaimURI = mappedClaim.get(0).getClaimURI();
Expand Down

0 comments on commit 588ecd6

Please sign in to comment.