aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit/src
diff options
context:
space:
mode:
authorMatthias Sohn <matthias.sohn@sap.com>2019-08-09 01:25:47 +0200
committerMatthias Sohn <matthias.sohn@sap.com>2019-08-09 01:49:59 +0200
commitb4cb06b294bbb7747bd0322bf055b06613c5fb51 (patch)
treef216c229081d8ac864700032f45e768e8f8c02c0 /org.eclipse.jgit/src
parent66cb2d9db48836afac346e421034a418620e6aab (diff)
downloadjgit-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.java2
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) {