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/05/16 13:34:05 UTC

[lucene] branch branch_9x updated: LUCENE-10575: Fix some visibility issues (#894)

This is an automated email from the ASF dual-hosted git repository.

romseygeek pushed a commit to branch branch_9x
in repository https://gitbox.apache.org/repos/asf/lucene.git


The following commit(s) were added to refs/heads/branch_9x by this push:
     new 520d771ebac LUCENE-10575: Fix some visibility issues (#894)
520d771ebac is described below

commit 520d771ebac1c2da822b74e2a44f3c096d5f96f6
Author: Alan Woodward <ro...@apache.org>
AuthorDate: Mon May 16 14:25:36 2022 +0100

    LUCENE-10575: Fix some visibility issues (#894)
---
 .../codecs/uniformsplit/sharedterms/STMergingTermsEnum.java       | 2 +-
 .../apache/lucene/search/matchhighlight/MatchRegionRetriever.java | 8 ++++----
 .../org/apache/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();
         }