/*
 * Copyright 2000-2013 JetBrains s.r.o.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.intellij.vcs.log.data;

import com.intellij.util.containers.Interner;
import com.intellij.vcs.log.VcsUser;
import com.intellij.vcs.log.impl.VcsUserImpl;

import java.util.Set;

/**
 *
 */
public class VcsUserRegistry {

  private final Interner<VcsUser> myUserMap = new Interner<VcsUser>();

  public VcsUser createUser(String name, String email) {
    return myUserMap.intern(new VcsUserImpl(name, email));
  }

  public void addUser(VcsUser user) {
    myUserMap.intern(user);
  }

  public Set<VcsUser> getUsers() {
    return myUserMap.getValues();
  }
}

@@ -630,16 +630,67 @@
 .data;%0A%0A
+import com.intellij.util.containers.ContainerUtil;%0A
 import c
@@ -723,24 +723,24 @@
 s.Interner;%0A
-
 import com.i
@@ -809,16 +809,58 @@
 serImpl;
+%0Aimport org.jetbrains.annotations.NotNull;
 %0A%0Aimport
@@ -991,16 +991,27 @@
 er%3E();%0A%0A
+  @NotNull%0A
   public
@@ -1030,16 +1030,25 @@
 ateUser(
+@NotNull 
 String n
@@ -1051,16 +1051,25 @@
 ng name,
+ @NotNull
  String 
@@ -1163,16 +1163,25 @@
 addUser(
+@NotNull 
 VcsUser 
@@ -1213,32 +1213,43 @@
 ern(user);%0A  %7D%0A%0A
+  @NotNull%0A
   public Set%3CVcs
@@ -1270,32 +1270,57 @@
 () %7B%0A    return 
+ContainerUtil.newHashSet(
 myUserMap.getVal
@@ -1324,16 +1324,17 @@
 Values()
+)
 ;%0A  %7D%0A%7D%0A

return a copy of users map, to avoid CCME