diff --git a/platform/vcs-log/impl/src/com/intellij/vcs/log/impl/VcsUserImpl.java b/platform/vcs-log/impl/src/com/intellij/vcs/log/impl/VcsUserImpl.java index e3d6ec53ae70..38c834e02ca4 100644 --- a/platform/vcs-log/impl/src/com/intellij/vcs/log/impl/VcsUserImpl.java +++ b/platform/vcs-log/impl/src/com/intellij/vcs/log/impl/VcsUserImpl.java @@ -23,8 +23,10 @@ import org.jetbrains.annotations.Nullable; import java.util.regex.Matcher; import java.util.regex.Pattern; +import java.util.Objects; + /** - * Note: users are considered equal if they have the same name, even if the e-mail is different. + * Note: users are considered equal if they have the same name and email. Emails are converted to lower case in constructor. */ public class VcsUserImpl implements VcsUser { @NotNull private static final Pattern NAME_WITH_DOT = Pattern.compile("(\\w*)\\.(\\w*)"); @@ -35,7 +37,7 @@ public class VcsUserImpl implements VcsUser { public VcsUserImpl(@NotNull String name, @NotNull String email) { myName = name; - myEmail = email; + myEmail = email.toLowerCase(); } @NotNull @@ -58,13 +60,14 @@ public class VcsUserImpl implements VcsUser { VcsUserImpl user = (VcsUserImpl)o; if (!myName.equals(user.myName)) return false; + if (!myEmail.equals(user.myEmail)) return false; return true; } @Override public int hashCode() { - return myName.hashCode(); + return Objects.hash(myName, myEmail); } @Override