Skip to content

Commit

Permalink
Fix equal check for groupOIDs list
Browse files Browse the repository at this point in the history
  • Loading branch information
amoosbr committed Aug 7, 2019
1 parent c27b7a2 commit aa7b307
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/main/java/com/microsoft/jenkins/azuread/AzureAdUser.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import org.acegisecurity.GrantedAuthority;
import org.acegisecurity.GrantedAuthorityImpl;
import org.acegisecurity.userdetails.UserDetails;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang.StringUtils;
import org.jose4j.jwt.JwtClaims;
import org.jose4j.jwt.MalformedClaimException;
Expand Down Expand Up @@ -126,7 +127,11 @@ public boolean equals(Object o) {
if (familyName != null ? !familyName.equals(that.familyName) : that.familyName != null) return false;
if (uniqueName != null ? !uniqueName.equals(that.uniqueName) : that.uniqueName != null) return false;
if (tenantID != null ? !tenantID.equals(that.tenantID) : that.tenantID != null) return false;
if (groupOIDs != null ? !groupOIDs.equals(that.groupOIDs) : that.groupOIDs != null) return false;
if (groupOIDs != null && that.groupOIDs != null) {
if (!CollectionUtils.isEqualCollection(groupOIDs, that.groupOIDs)) return false;
} else if (groupOIDs != null || that.groupOIDs != null) {
return false;
}
return objectID.equals(that.objectID);
}

Expand Down

0 comments on commit aa7b307

Please sign in to comment.