[error prone] suppress NonAtomicVolatileUpdate warning in SimpleLruCache
It's not important to update time field, scalability is more important
than perfect LRU ordering of cache entries.
Change-Id: I22466c580cd3613b81e1989130b2724af9d6c466
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/util/SimpleLruCache.java b/org.eclipse.jgit/src/org/eclipse/jgit/util/SimpleLruCache.java
index 709d9ee..7235b15 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/util/SimpleLruCache.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/util/SimpleLruCache.java
@@ -159,6 +159,7 @@ public SimpleLruCache(int maxSize, float purgeFactor) {
*
* @return value mapped for this key, or {@code null} if no value is mapped
*/
+ @SuppressWarnings("NonAtomicVolatileUpdate")
public V get(Object key) {
Entry<K, V> entry = map.get(key);
if (entry != null) {
@@ -185,6 +186,7 @@ public V get(Object key) {
* @throws NullPointerException
* if the specified key or value is null
*/
+ @SuppressWarnings("NonAtomicVolatileUpdate")
public V put(@NonNull K key, @NonNull V value) {
map.put(key, new Entry<>(key, value, ++time));
if (map.size() > maximumSize) {