Java 类com.intellij.util.IntSLRUCache 实例源码

项目:intellij-ce-playground    文件:FileNameCache.java   
@NotNull
private static IntObjectLinkedMap.MapEntry<CharSequence> cacheData(String name, int id, int stripe) {
  if (name == null) {
    ourNames.markCorrupted();
    throw new RuntimeException("VFS name enumerator corrupted");
  }

  CharSequence rawName = ByteArrayCharSequence.convertToBytesIfAsciiString(name);
  IntObjectLinkedMap.MapEntry<CharSequence> entry = new IntObjectLinkedMap.MapEntry<CharSequence>(id, rawName);
  IntSLRUCache<IntObjectLinkedMap.MapEntry<CharSequence>> cache = ourNameCache[stripe];
  //noinspection SynchronizationOnLocalVariableOrMethodParameter
  synchronized (cache) {
    return cache.cacheEntry(entry);
  }
}
项目:consulo    文件:FileNameCache.java   
@Nonnull
private static IntObjectLinkedMap.MapEntry<CharSequence> cacheData(String name, int id, int stripe) {
  if (name == null) {
    ourNames.markCorrupted();
    throw new RuntimeException("VFS name enumerator corrupted");
  }

  CharSequence rawName = ByteArrayCharSequence.convertToBytesIfAsciiString(name);
  IntObjectLinkedMap.MapEntry<CharSequence> entry = new IntObjectLinkedMap.MapEntry<CharSequence>(id, rawName);
  IntSLRUCache<IntObjectLinkedMap.MapEntry<CharSequence>> cache = ourNameCache[stripe];
  //noinspection SynchronizationOnLocalVariableOrMethodParameter
  synchronized (cache) {
    return cache.cacheEntry(entry);
  }
}