Skip to content

Apache Lucene open-source search software

added a getter for refcount

Noble Paul23d1d0bc2f16
diff --git a/src/java/org/apache/solr/util/RefCounted.java b/src/java/org/apache/solr/util/RefCounted.java
index c9686c85523..508fb01df90 100644
--- a/src/java/org/apache/solr/util/RefCounted.java
+++ b/src/java/org/apache/solr/util/RefCounted.java
@@ -39,6 +39,10 @@ public abstract class RefCounted<Type> {
this.resource = resource;
}
+ public int getRefcount() {
+ return refcount.get();
+ }
+
public final RefCounted<Type> incref() {
refcount.incrementAndGet();
return this;