public V put()

in core/src/main/java/gnu/trove/THashMap.java [164:183]


  public V put(K key, V value) {
    if (null == key) {
      throw new NullPointerException("null keys not supported");
    }
    V previous = null;
    int index = insertionIndex(key);
    boolean alreadyStored = index < 0;
    if (alreadyStored) {
      index = -index - 1;
      previous = _values[index];
    }
    Object oldKey = _set[index];
    _set[index] = key;
    _values[index] = value;
    if (!alreadyStored) {
      postInsertHook(oldKey == null);
    }

    return previous;
  }