You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-commits@lucene.apache.org by sh...@apache.org on 2008/10/29 09:30:57 UTC

svn commit: r708824 - /lucene/solr/trunk/src/java/org/apache/solr/search/FastLRUCache.java

Author: shalin
Date: Wed Oct 29 01:30:57 2008
New Revision: 708824

URL: http://svn.apache.org/viewvc?rev=708824&view=rev
Log:
Add null check to avoid NPE during JMX registration

Modified:
    lucene/solr/trunk/src/java/org/apache/solr/search/FastLRUCache.java

Modified: lucene/solr/trunk/src/java/org/apache/solr/search/FastLRUCache.java
URL: http://svn.apache.org/viewvc/lucene/solr/trunk/src/java/org/apache/solr/search/FastLRUCache.java?rev=708824&r1=708823&r2=708824&view=diff
==============================================================================
--- lucene/solr/trunk/src/java/org/apache/solr/search/FastLRUCache.java (original)
+++ lucene/solr/trunk/src/java/org/apache/solr/search/FastLRUCache.java Wed Oct 29 01:30:57 2008
@@ -189,6 +189,7 @@
 
   public NamedList getStatistics() {
     NamedList<Serializable> lst = new SimpleOrderedMap<Serializable>();
+    if (cache == null)  return lst;
     ConcurrentLRUCache.Stats stats = cache.getStats();
     long lookups = stats.getCumulativeLookups();
     long hits = stats.getCumulativeHits();