mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Fixing a dodgy line of code in SiteServiceImpl which I don't believe can cause a bug today, but exposes us to a bug in the future.
A java.util.Comparator.compare result was being compared to 1, which worked because the Comparator implementation we ship returns -1, 0 or 1. But the method contract is actually -ve, 0, +ve - so I've changed the comparison to that, which is safer. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@88056 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -2107,7 +2107,7 @@ public class SiteServiceImpl extends AbstractLifecycleBean implements SiteServic
|
||||
{
|
||||
int index = members.indexOf(memberInfo);
|
||||
int priority = roleComparator.compare(members.get(index).getMemberRole(), memberInfo.getMemberRole());
|
||||
if (priority == 1)
|
||||
if (priority > 0)
|
||||
{
|
||||
members.set(index, memberInfo);
|
||||
}
|
||||
|
Reference in New Issue
Block a user