diff options
author | Matthias Sohn <matthias.sohn@sap.com> | 2019-08-09 01:25:47 +0200 |
---|---|---|
committer | Matthias Sohn <matthias.sohn@sap.com> | 2019-08-09 01:49:59 +0200 |
commit | b4cb06b294bbb7747bd0322bf055b06613c5fb51 (patch) | |
tree | f216c229081d8ac864700032f45e768e8f8c02c0 /org.eclipse.jgit/src | |
parent | 66cb2d9db48836afac346e421034a418620e6aab (diff) | |
download | jgit-b4cb06b294bbb7747bd0322bf055b06613c5fb51.tar.gz jgit-b4cb06b294bbb7747bd0322bf055b06613c5fb51.zip |
[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>
Diffstat (limited to 'org.eclipse.jgit/src')
-rw-r--r-- | org.eclipse.jgit/src/org/eclipse/jgit/util/SimpleLruCache.java | 2 |
1 files changed, 2 insertions, 0 deletions
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 709d9ee73d..7235b15548 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 class SimpleLruCache<K, V> { * * @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 class SimpleLruCache<K, V> { * @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) { |