You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ro...@apache.org on 2022/11/28 16:22:53 UTC
[lucene] branch main updated: Give OffsetsRetrievalStrategy implementations public constructors (#11983)
This is an automated email from the ASF dual-hosted git repository.
romseygeek 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 0cc6f695363 Give OffsetsRetrievalStrategy implementations public constructors (#11983)
0cc6f695363 is described below
commit 0cc6f695363419ab0f89e2bef5e7595ace077345
Author: Alan Woodward <ro...@apache.org>
AuthorDate: Mon Nov 28 16:22:46 2022 +0000
Give OffsetsRetrievalStrategy implementations public constructors (#11983)
OffsetsFromMatchIterator and OffsetsFromPositions both have package-
private constructors, which makes them difficult to use as components in a
separate highlighter implementation.
---
lucene/CHANGES.txt | 3 +++
.../apache/lucene/search/matchhighlight/OffsetsFromMatchIterator.java | 2 +-
.../org/apache/lucene/search/matchhighlight/OffsetsFromPositions.java | 2 +-
3 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/lucene/CHANGES.txt b/lucene/CHANGES.txt
index a47de99039f..2b69f159a61 100644
--- a/lucene/CHANGES.txt
+++ b/lucene/CHANGES.txt
@@ -206,6 +206,9 @@ Other
* GITHUB#11752: Added interface to relate a LatLonShape with another shape represented as Component2D. (Navneet Verma)
+* GITHUB#11983: Make constructors for OffsetFromPositions and OffsetsFromMatchIterator
+ public. (Alan Woodward)
+
Build
---------------------
diff --git a/lucene/highlighter/src/java/org/apache/lucene/search/matchhighlight/OffsetsFromMatchIterator.java b/lucene/highlighter/src/java/org/apache/lucene/search/matchhighlight/OffsetsFromMatchIterator.java
index 17104a01a80..d7c42ebb03e 100644
--- a/lucene/highlighter/src/java/org/apache/lucene/search/matchhighlight/OffsetsFromMatchIterator.java
+++ b/lucene/highlighter/src/java/org/apache/lucene/search/matchhighlight/OffsetsFromMatchIterator.java
@@ -30,7 +30,7 @@ public final class OffsetsFromMatchIterator implements OffsetsRetrievalStrategy
private final String field;
private final OffsetsFromPositions noOffsetsFallback;
- OffsetsFromMatchIterator(String field, OffsetsFromPositions noOffsetsFallback) {
+ public OffsetsFromMatchIterator(String field, OffsetsFromPositions noOffsetsFallback) {
this.field = field;
this.noOffsetsFallback = Objects.requireNonNull(noOffsetsFallback);
}
diff --git a/lucene/highlighter/src/java/org/apache/lucene/search/matchhighlight/OffsetsFromPositions.java b/lucene/highlighter/src/java/org/apache/lucene/search/matchhighlight/OffsetsFromPositions.java
index e460541c115..20a67194299 100644
--- a/lucene/highlighter/src/java/org/apache/lucene/search/matchhighlight/OffsetsFromPositions.java
+++ b/lucene/highlighter/src/java/org/apache/lucene/search/matchhighlight/OffsetsFromPositions.java
@@ -36,7 +36,7 @@ public final class OffsetsFromPositions implements OffsetsRetrievalStrategy {
private final String field;
private final Analyzer analyzer;
- OffsetsFromPositions(String field, Analyzer analyzer) {
+ public OffsetsFromPositions(String field, Analyzer analyzer) {
this.field = field;
this.analyzer = analyzer;
}