/*
 * Copyright 2000-2015 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.openapi.util.Condition;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.util.containers.BiDirectionalEnumerator;
import com.intellij.vcs.log.CommitId;
import com.intellij.vcs.log.Hash;
import com.intellij.vcs.log.VcsLogStorage;
import com.intellij.vcs.log.VcsRef;
import gnu.trove.TObjectHashingStrategy;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

public class InMemoryStorage implements VcsLogStorage {
  @SuppressWarnings("unchecked") private final BiDirectionalEnumerator<CommitId> myCommitIdEnumerator =
    new BiDirectionalEnumerator<>(1, TObjectHashingStrategy.CANONICAL);
  @SuppressWarnings("unchecked") private final BiDirectionalEnumerator<VcsRef> myRefsEnumerator =
    new BiDirectionalEnumerator<>(1, TObjectHashingStrategy.CANONICAL);

  @Override
  public int getCommitIndex(@NotNull Hash hash, @NotNull VirtualFile root) {
    return getOrPut(hash, root);
  }

  private int getOrPut(@NotNull Hash hash, @NotNull VirtualFile root) {
    return myCommitIdEnumerator.enumerate(new CommitId(hash, root));
  }

  @NotNull
  @Override
  public CommitId getCommitId(int commitIndex) {
    return myCommitIdEnumerator.getValue(commitIndex);
  }

  @Nullable
  @Override
  public CommitId findCommitId(@NotNull final Condition<CommitId> condition) {
    final CommitId[] result = new CommitId[]{null};
    myCommitIdEnumerator.forEachValue(commitId -> {
      if (condition.value(commitId)) {
        result[0] = commitId;
        return false;
      }
      return true;
    });
    return result[0];
  }

  @Override
  public int getRefIndex(@NotNull VcsRef ref) {
    return myRefsEnumerator.enumerate(ref);
  }

  @Nullable
  @Override
  public VcsRef getVcsRef(int refIndex) {
    return myRefsEnumerator.getValue(refIndex);
  }

  @Override
  public void flush() {
    // nothing to flush
  }
}

@@ -942,40 +942,41 @@
 ort 
-gnu.trove.TObjectHashingStrategy
+org.jetbrains.annotations.NotNull
 ;%0Aim
@@ -1011,57 +1011,92 @@
 ns.N
-otNull;%0Aimport org.jetbrains.annotations.Nullable
+ullable;%0A%0Aimport static com.intellij.util.containers.ContainerUtil.canonicalStrategy
 ;%0A%0Ap
@@ -1155,39 +1155,8 @@
  %7B%0A 
- @SuppressWarnings(%22unchecked%22)
  pri
@@ -1214,36 +1214,32 @@
 itIdEnumerator =
-%0A   
  new BiDirection
@@ -1260,75 +1260,31 @@
 (1, 
-TObjectHashingStrategy.CANONICAL);%0A  @SuppressWarnings(%22unchecked%22)
+canonicalStrategy());%0A 
  pri
@@ -1344,20 +1344,16 @@
 erator =
-%0A   
  new BiD
@@ -1382,40 +1382,27 @@
 (1, 
-TObjectHashingStrategy.CANONICAL
+canonicalStrategy()
 );%0A%0A

Use a utility method to avoid suppression