From 8921b23bcd4ae5eea392b9a169aee88c71b6c806 Mon Sep 17 00:00:00 2001 From: Alan Woodward Date: Mon, 16 May 2022 14:25:36 +0100 Subject: [PATCH] LUCENE-10575: Fix some visibility issues (#894) --- .../uniformsplit/sharedterms/STMergingTermsEnum.java | 2 +- .../search/matchhighlight/MatchRegionRetriever.java | 8 ++++---- .../lucene/search/suggest/fst/ExternalRefSorter.java | 7 +++---- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/lucene/codecs/src/java/org/apache/lucene/codecs/uniformsplit/sharedterms/STMergingTermsEnum.java b/lucene/codecs/src/java/org/apache/lucene/codecs/uniformsplit/sharedterms/STMergingTermsEnum.java index 199b2f75883..7a772c38908 100644 --- a/lucene/codecs/src/java/org/apache/lucene/codecs/uniformsplit/sharedterms/STMergingTermsEnum.java +++ b/lucene/codecs/src/java/org/apache/lucene/codecs/uniformsplit/sharedterms/STMergingTermsEnum.java @@ -34,7 +34,7 @@ import org.apache.lucene.util.BytesRef; * * @lucene.experimental */ -public class STMergingTermsEnum extends TermsEnum { +class STMergingTermsEnum extends TermsEnum { protected final String fieldName; protected final MultiSegmentsPostingsEnum multiPostingsEnum; diff --git a/lucene/highlighter/src/java/org/apache/lucene/search/matchhighlight/MatchRegionRetriever.java b/lucene/highlighter/src/java/org/apache/lucene/search/matchhighlight/MatchRegionRetriever.java index afd19e54083..aa406817781 100644 --- a/lucene/highlighter/src/java/org/apache/lucene/search/matchhighlight/MatchRegionRetriever.java +++ b/lucene/highlighter/src/java/org/apache/lucene/search/matchhighlight/MatchRegionRetriever.java @@ -70,10 +70,10 @@ public class MatchRegionRetriever { } /** - * An abstraction that provides document values for a given field. Default implementation in - * {@link DocumentFieldValueProvider} just reaches to a preloaded {@link Document}. It is possible - * to write a more efficient implementation on top of a reusable character buffer (that reuses the - * buffer while retrieving hit regions for documents). + * An abstraction that provides document values for a given field. The default implementation just + * reaches to a preloaded {@link Document}. It is possible to write a more efficient + * implementation on top of a reusable character buffer (that reuses the buffer while retrieving + * hit regions for documents). */ @FunctionalInterface public interface FieldValueProvider { diff --git a/lucene/suggest/src/java/org/apache/lucene/search/suggest/fst/ExternalRefSorter.java b/lucene/suggest/src/java/org/apache/lucene/search/suggest/fst/ExternalRefSorter.java index 998a2a2fd95..d8dfc022da9 100644 --- a/lucene/suggest/src/java/org/apache/lucene/search/suggest/fst/ExternalRefSorter.java +++ b/lucene/suggest/src/java/org/apache/lucene/search/suggest/fst/ExternalRefSorter.java @@ -118,11 +118,10 @@ public class ExternalRefSorter implements BytesRefSorter, Closeable { /** * Iterates over {@link BytesRef}s in a file, closes the reader when the iterator is exhausted. */ - static class ByteSequenceIterator implements BytesRefIterator, Closeable { + public static class ByteSequenceIterator implements BytesRefIterator, Closeable { private final OfflineSorter.ByteSequencesReader reader; - private BytesRef scratch; - public ByteSequenceIterator(OfflineSorter.ByteSequencesReader reader) { + private ByteSequenceIterator(OfflineSorter.ByteSequencesReader reader) { this.reader = reader; } @@ -130,7 +129,7 @@ public class ExternalRefSorter implements BytesRefSorter, Closeable { public BytesRef next() throws IOException { boolean success = false; try { - scratch = reader.next(); + BytesRef scratch = reader.next(); if (scratch == null) { close(); }