From 9cc5323048cad17344845aa0965e7b360a1f05d2 Mon Sep 17 00:00:00 2001 From: peter Date: Thu, 2 Feb 2012 19:49:30 +0100 Subject: [PATCH] some nullity annos --- .../platform-impl/src/com/intellij/idea/RareLogger.java | 2 +- .../util/src/com/intellij/util/containers/SLRUMap.java | 7 ++++--- .../intellij/openapi/vcs/impl/ContentRevisionCache.java | 6 +----- 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/platform/platform-impl/src/com/intellij/idea/RareLogger.java b/platform/platform-impl/src/com/intellij/idea/RareLogger.java index ee642c0855f4..a18948341a24 100644 --- a/platform/platform-impl/src/com/intellij/idea/RareLogger.java +++ b/platform/platform-impl/src/com/intellij/idea/RareLogger.java @@ -48,7 +48,7 @@ public class RareLogger extends Logger { } @Override - public void put(Object key, Long value) { + public void put(Object key, @NotNull Long value) { if (fairSynch) { synchronized (lock) { super.put(key, value); diff --git a/platform/util/src/com/intellij/util/containers/SLRUMap.java b/platform/util/src/com/intellij/util/containers/SLRUMap.java index a4a0d389f4a7..fbef2ef40bf0 100644 --- a/platform/util/src/com/intellij/util/containers/SLRUMap.java +++ b/platform/util/src/com/intellij/util/containers/SLRUMap.java @@ -21,14 +21,15 @@ package com.intellij.util.containers; import com.intellij.util.Consumer; import com.intellij.util.containers.hash.LinkedHashMap; +import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import java.util.Map; import java.util.Set; public class SLRUMap { - protected final Map myProtectedQueue; - protected final Map myProbationalQueue; + protected final LinkedHashMap myProtectedQueue; + protected final LinkedHashMap myProbationalQueue; private final int myProtectedQueueSize; private final int myProbationalQueueSize; @@ -83,7 +84,7 @@ public class SLRUMap { return null; } - public void put(K key, V value) { + public void put(K key, @NotNull V value) { V oldValue = myProtectedQueue.remove(key); if (oldValue != null) { onDropFromCache(key, oldValue); diff --git a/platform/vcs-api/src/com/intellij/openapi/vcs/impl/ContentRevisionCache.java b/platform/vcs-api/src/com/intellij/openapi/vcs/impl/ContentRevisionCache.java index 6f5c86c0a7d6..5efcb347f1cb 100644 --- a/platform/vcs-api/src/com/intellij/openapi/vcs/impl/ContentRevisionCache.java +++ b/platform/vcs-api/src/com/intellij/openapi/vcs/impl/ContentRevisionCache.java @@ -57,7 +57,7 @@ public class ContentRevisionCache { myCounter = 0; } - private void put(FilePath path, VcsRevisionNumber number, @NotNull VcsKey vcsKey, @NotNull UniqueType type, final byte[] bytes) { + private void put(FilePath path, VcsRevisionNumber number, @NotNull VcsKey vcsKey, @NotNull UniqueType type, @Nullable final byte[] bytes) { if (bytes == null) return; synchronized (myLock) { myCache.put(new Key(path, number, vcsKey, type), bytes); @@ -247,10 +247,6 @@ public class ContentRevisionCache { return myPath; } - public VcsKey getVcsKey() { - return myVcsKey; - } - @Override public boolean equals(Object o) { if (this == o) return true;