private static <T> T chooseKey(T base, T forIndex) {
    return FileBasedIndex.getInstance().getFileBeingCurrentlyIndexed() != null ? forIndex : base;
  }
private static <T> T chooseKey(T base, T forIndex)