You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by vi...@apache.org on 2025/07/08 06:08:26 UTC
(lucene) branch main updated: Deprecate MergeSpecification#segString(Directory) (#14908)
This is an automated email from the ASF dual-hosted git repository.
vigyasharma pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/lucene.git
The following commit(s) were added to refs/heads/main by this push:
new 35ea55ace5a Deprecate MergeSpecification#segString(Directory) (#14908)
35ea55ace5a is described below
commit 35ea55ace5a029950fdec8b7e9932a028ef1f042
Author: kitoha <ki...@gmail.com>
AuthorDate: Tue Jul 8 15:08:20 2025 +0900
Deprecate MergeSpecification#segString(Directory) (#14908)
---
lucene/CHANGES.txt | 2 ++
.../src/java/org/apache/lucene/index/MergePolicy.java | 17 ++++++++---------
2 files changed, 10 insertions(+), 9 deletions(-)
diff --git a/lucene/CHANGES.txt b/lucene/CHANGES.txt
index 9d72522d531..3bc3c8ca27c 100644
--- a/lucene/CHANGES.txt
+++ b/lucene/CHANGES.txt
@@ -106,6 +106,8 @@ API Changes
* GITHUB#14426: Support determining desired off-heap memory requirements through
KnnVectorsReader::getOffHeapByteSize (Chris Hegarty)
+* GITHUB#14899: Deprecate MergeSpecification#segString(Directory) (kitoha)
+
New Features
---------------------
* GITHUB#14404: Introducing DocValuesMultiRangeQuery.SortedNumericStabbingBuilder into sandbox.
diff --git a/lucene/core/src/java/org/apache/lucene/index/MergePolicy.java b/lucene/core/src/java/org/apache/lucene/index/MergePolicy.java
index cbea98daf58..50af192671a 100644
--- a/lucene/core/src/java/org/apache/lucene/index/MergePolicy.java
+++ b/lucene/core/src/java/org/apache/lucene/index/MergePolicy.java
@@ -494,16 +494,15 @@ public abstract class MergePolicy {
merges.add(merge);
}
- // TODO: deprecate me (dir is never used! and is sometimes difficult to provide!)
- /** Returns a description of the merges in this specification. */
+ /**
+ * Returns a description of the merges in this specification
+ *
+ * @deprecated Use {@link #toString()} instead. The {@code Directory} parameter is ignored and
+ * will be removed in a future release.
+ */
+ @Deprecated
public String segString(Directory dir) {
- StringBuilder b = new StringBuilder();
- b.append("MergeSpec:\n");
- final int count = merges.size();
- for (int i = 0; i < count; i++) {
- b.append(" ").append(1 + i).append(": ").append(merges.get(i).segString());
- }
- return b.toString();
+ return toString();
}
@Override