SOLR-10639: Fix NPE in LRU/LFU/FastLRU caches toString method

This commit is contained in:
Tomas Fernandez Lobbe 2017-05-08 17:11:35 -07:00
parent 82b78bd95e
commit fbdd2c0ee8
4 changed files with 5 additions and 3 deletions

View File

@ -324,6 +324,8 @@ Bug Fixes
* SOLR-10630: HttpSolrCall.getAuthCtx().new AuthorizationContext() {...}.getParams()
sometimes throws java.lang.NullPointerException (hu xiaodong via shalin)
* SOLR-10639: Fix NPE on LRU/FastLRU/LFU toString method (Tomás Fernández Löbbe)
Other Changes
----------------------

View File

@ -292,7 +292,7 @@ public class FastLRUCache<K, V> extends SolrCacheBase implements SolrCache<K,V>
@Override
public String toString() {
return name() + cacheMap != null ? cacheMap.getValue().toString() : "";
return name() + (cacheMap != null ? cacheMap.getValue().toString() : "");
}
}

View File

@ -308,7 +308,7 @@ public class LFUCache<K, V> implements SolrCache<K, V> {
@Override
public String toString() {
return name + cacheMap != null ? cacheMap.getValue().toString() : "";
return name + (cacheMap != null ? cacheMap.getValue().toString() : "");
}
}

View File

@ -375,7 +375,7 @@ public class LRUCache<K,V> extends SolrCacheBase implements SolrCache<K,V>, Acco
@Override
public String toString() {
return name() + cacheMap != null ? cacheMap.getValue().toString() : "";
return name() + (cacheMap != null ? cacheMap.getValue().toString() : "");
}
@Override