Apache Lucene open-source search software
LUCENE-6147: Make the core Accountables.namedAccountable function public
Ryan Ernste17de210f457
diff --git a/lucene/CHANGES.txt b/lucene/CHANGES.txtindex 6265b8bf24f..45e07fa05b9 100644--- a/lucene/CHANGES.txt+++ b/lucene/CHANGES.txt@@ -323,6 +323,9 @@ API ChangesincrementToken(). You must call reset() now on this filter instead of doing it a-priori on theinput(), which previously didn't work. (David Smiley, Robert Muir)+* LUCENE-6147: Make the core Accountables.namedAccountable function public+ (Ryan Ernst)+Bug Fixes* LUCENE-5650: Enforce read-only access to any path outside the temporarydiff --git a/lucene/core/src/java/org/apache/lucene/util/Accountables.java b/lucene/core/src/java/org/apache/lucene/util/Accountables.javaindex bd824bac063..1896c045655 100644--- a/lucene/core/src/java/org/apache/lucene/util/Accountables.java+++ b/lucene/core/src/java/org/apache/lucene/util/Accountables.java@@ -112,15 +112,17 @@ public class Accountables {}/**- * Returns an accountable with the provided description, bytes, and children.+ * Returns an accountable with the provided description, children and bytes.* <p>* The resource descriptions are constructed in this format:* {@code description [toString()]}* <p>* This is a point-in-time type safe view: consumers- * will not be able to cast or manipulate the resources in any way..+ * will not be able to cast or manipulate the resources in any way, provided+ * that the passed in children Accountables (and all their descendants) were created+ * with one of the namedAccountable functions.*/- private static Accountable namedAccountable(final String description, final Iterable<Accountable> children, final long bytes) {+ public static Accountable namedAccountable(final String description, final Iterable<Accountable> children, final long bytes) {return new Accountable() {@Overridepublic long ramBytesUsed() {