You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ja...@apache.org on 2019/11/27 09:34:59 UTC

[lucene-solr] branch branch_8x updated: Fix typos in various comments and log msgs (#1000)

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

janhoy pushed a commit to branch branch_8x
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git


The following commit(s) were added to refs/heads/branch_8x by this push:
     new c6efd58  Fix typos in various comments and log msgs (#1000)
c6efd58 is described below

commit c6efd58282a0a3a3a943fd7be83bbdeb9f4e08d6
Author: Benedict Jin <as...@apache.org>
AuthorDate: Wed Nov 27 17:34:00 2019 +0800

    Fix typos in various comments and log msgs (#1000)
    
    (cherry picked from commit f70e21c91c1fb810ccb79a41938787bb3afea79e)
---
 .../java/org/apache/lucene/codecs/memory/DirectPostingsFormat.java    | 2 +-
 .../lucene/analysis/tokenattributes/TermFrequencyAttribute.java       | 2 +-
 .../lucene/analysis/tokenattributes/TermFrequencyAttributeImpl.java   | 2 +-
 .../java/org/apache/lucene/codecs/CompetitiveImpactAccumulator.java   | 2 +-
 .../java/org/apache/lucene/codecs/blocktree/IntersectTermsEnum.java   | 2 +-
 .../core/src/java/org/apache/lucene/codecs/lucene80/IndexedDISI.java  | 2 +-
 .../src/java/org/apache/lucene/geo/SimpleGeoJSONPolygonParser.java    | 2 +-
 lucene/core/src/java/org/apache/lucene/index/DocValuesIterator.java   | 2 +-
 .../src/java/org/apache/lucene/index/DocumentsWriterPerThread.java    | 2 +-
 lucene/core/src/java/org/apache/lucene/index/FieldInfos.java          | 2 +-
 lucene/core/src/java/org/apache/lucene/index/FieldUpdatesBuffer.java  | 4 ++--
 lucene/core/src/java/org/apache/lucene/index/SegmentWriteState.java   | 2 +-
 lucene/core/src/java/org/apache/lucene/search/IndexSearcher.java      | 2 +-
 lucene/core/src/java/org/apache/lucene/search/ReferenceManager.java   | 2 +-
 lucene/core/src/java/org/apache/lucene/util/automaton/Automaton.java  | 2 +-
 .../java/org/apache/lucene/util/automaton/CharacterRunAutomaton.java  | 2 +-
 .../src/java/org/apache/lucene/util/automaton/CompiledAutomaton.java  | 2 +-
 .../org/apache/lucene/util/packed/MonotonicBlockPackedWriter.java     | 2 +-
 lucene/core/src/java/org/apache/lucene/util/packed/PackedInts.java    | 2 +-
 .../src/test/org/apache/lucene/search/highlight/TokenSourcesTest.java | 2 +-
 20 files changed, 21 insertions(+), 21 deletions(-)

diff --git a/lucene/codecs/src/java/org/apache/lucene/codecs/memory/DirectPostingsFormat.java b/lucene/codecs/src/java/org/apache/lucene/codecs/memory/DirectPostingsFormat.java
index 3a1fb5f..5c6a00e 100644
--- a/lucene/codecs/src/java/org/apache/lucene/codecs/memory/DirectPostingsFormat.java
+++ b/lucene/codecs/src/java/org/apache/lucene/codecs/memory/DirectPostingsFormat.java
@@ -1663,7 +1663,7 @@ public final class DirectPostingsFormat extends PostingsFormat {
     }
   }
 
-  // Docs + freqs + positions/offets:
+  // Docs + freqs + positions/offsets:
   private final static class LowFreqDocsEnum extends PostingsEnum {
     private int[] postings;
     private final int posMult;
diff --git a/lucene/core/src/java/org/apache/lucene/analysis/tokenattributes/TermFrequencyAttribute.java b/lucene/core/src/java/org/apache/lucene/analysis/tokenattributes/TermFrequencyAttribute.java
index 15aed41..0f33aef 100644
--- a/lucene/core/src/java/org/apache/lucene/analysis/tokenattributes/TermFrequencyAttribute.java
+++ b/lucene/core/src/java/org/apache/lucene/analysis/tokenattributes/TermFrequencyAttribute.java
@@ -28,6 +28,6 @@ public interface TermFrequencyAttribute extends Attribute {
   /** Set the custom term frequency of the current term within one document. */
   public void setTermFrequency(int termFrequency);
 
-  /** Returns the custom term frequencey. */
+  /** Returns the custom term frequency. */
   public int getTermFrequency();
 }
diff --git a/lucene/core/src/java/org/apache/lucene/analysis/tokenattributes/TermFrequencyAttributeImpl.java b/lucene/core/src/java/org/apache/lucene/analysis/tokenattributes/TermFrequencyAttributeImpl.java
index 12409a7..c214453 100644
--- a/lucene/core/src/java/org/apache/lucene/analysis/tokenattributes/TermFrequencyAttributeImpl.java
+++ b/lucene/core/src/java/org/apache/lucene/analysis/tokenattributes/TermFrequencyAttributeImpl.java
@@ -24,7 +24,7 @@ import org.apache.lucene.util.AttributeReflector;
 public class TermFrequencyAttributeImpl extends AttributeImpl implements TermFrequencyAttribute, Cloneable {
   private int termFrequency = 1;
   
-  /** Initialize this attribute with term frequencey of 1 */
+  /** Initialize this attribute with term frequency of 1 */
   public TermFrequencyAttributeImpl() {}
 
   @Override
diff --git a/lucene/core/src/java/org/apache/lucene/codecs/CompetitiveImpactAccumulator.java b/lucene/core/src/java/org/apache/lucene/codecs/CompetitiveImpactAccumulator.java
index d887c4f..5909602 100644
--- a/lucene/core/src/java/org/apache/lucene/codecs/CompetitiveImpactAccumulator.java
+++ b/lucene/core/src/java/org/apache/lucene/codecs/CompetitiveImpactAccumulator.java
@@ -93,7 +93,7 @@ public final class CompetitiveImpactAccumulator {
     assertConsistent();
   }
 
-  /** Get the set of competitive freq and norm pairs, orderer by increasing freq and norm. */
+  /** Get the set of competitive freq and norm pairs, ordered by increasing freq and norm. */
   public Collection<Impact> getCompetitiveFreqNormPairs() {
     List<Impact> impacts = new ArrayList<>();
     int maxFreqForLowerNorms = 0;
diff --git a/lucene/core/src/java/org/apache/lucene/codecs/blocktree/IntersectTermsEnum.java b/lucene/core/src/java/org/apache/lucene/codecs/blocktree/IntersectTermsEnum.java
index 76bfdf2..9978f6c 100644
--- a/lucene/core/src/java/org/apache/lucene/codecs/blocktree/IntersectTermsEnum.java
+++ b/lucene/core/src/java/org/apache/lucene/codecs/blocktree/IntersectTermsEnum.java
@@ -515,7 +515,7 @@ final class IntersectTermsEnum extends BaseTermsEnum {
         assert savedStartTerm == null || term.compareTo(savedStartTerm) > 0: "saveStartTerm=" + savedStartTerm.utf8ToString() + " term=" + term.utf8ToString();
         return term;
       } else {
-        // This term is a prefix of a term accepted by the automaton, but is not itself acceptd
+        // This term is a prefix of a term accepted by the automaton, but is not itself accepted
       }
 
       isSubBlock = popPushNext();
diff --git a/lucene/core/src/java/org/apache/lucene/codecs/lucene80/IndexedDISI.java b/lucene/core/src/java/org/apache/lucene/codecs/lucene80/IndexedDISI.java
index 520d1d4..ec340ce 100644
--- a/lucene/core/src/java/org/apache/lucene/codecs/lucene80/IndexedDISI.java
+++ b/lucene/core/src/java/org/apache/lucene/codecs/lucene80/IndexedDISI.java
@@ -239,7 +239,7 @@ final class IndexedDISI extends DocIdSetIterator {
     return jumps;
   }
 
-  // Flushes the offet & index jump-table for blocks. This should be the last data written to out
+  // Flushes the offset & index jump-table for blocks. This should be the last data written to out
   // This method returns the blockCount for the blocks reachable for the jump_table or -1 for no jump-table
   private static short flushBlockJumps(int[] jumps, int blockCount, IndexOutput out, long origo) throws IOException {
     if (blockCount == 2) { // Jumps with a single real entry + NO_MORE_DOCS is just wasted space so we ignore that
diff --git a/lucene/core/src/java/org/apache/lucene/geo/SimpleGeoJSONPolygonParser.java b/lucene/core/src/java/org/apache/lucene/geo/SimpleGeoJSONPolygonParser.java
index d33d11a..f6a15d0 100644
--- a/lucene/core/src/java/org/apache/lucene/geo/SimpleGeoJSONPolygonParser.java
+++ b/lucene/core/src/java/org/apache/lucene/geo/SimpleGeoJSONPolygonParser.java
@@ -193,7 +193,7 @@ class SimpleGeoJSONPolygonParser {
           // OK, we recurse
         } else {
           upto = uptoStart;
-          throw newParseException("can only handle type FeatureCollection (if it has a single polygon geometry), Feature, Polygon or MutiPolygon, but got " + type);
+          throw newParseException("can only handle type FeatureCollection (if it has a single polygon geometry), Feature, Polygon or MultiPolygon, but got " + type);
         }
       } else if (key.equals("coordinates") && isValidGeometryPath(path)) {
         if (o instanceof List == false) {
diff --git a/lucene/core/src/java/org/apache/lucene/index/DocValuesIterator.java b/lucene/core/src/java/org/apache/lucene/index/DocValuesIterator.java
index d53e26a..b118b18 100644
--- a/lucene/core/src/java/org/apache/lucene/index/DocValuesIterator.java
+++ b/lucene/core/src/java/org/apache/lucene/index/DocValuesIterator.java
@@ -27,7 +27,7 @@ abstract class DocValuesIterator extends DocIdSetIterator {
    *  {@code target} must be greater than or equal to the current
    *  {@link #docID() doc ID} and must be a valid doc ID, ie. &ge; 0 and
    *  &lt; {@code maxDoc}.
-   *  After this method returns, {@link #docID()} retuns {@code target}. */
+   *  After this method returns, {@link #docID()} returns {@code target}. */
   public abstract boolean advanceExact(int target) throws IOException;
 
 }
diff --git a/lucene/core/src/java/org/apache/lucene/index/DocumentsWriterPerThread.java b/lucene/core/src/java/org/apache/lucene/index/DocumentsWriterPerThread.java
index 2f520e0..18d951e 100644
--- a/lucene/core/src/java/org/apache/lucene/index/DocumentsWriterPerThread.java
+++ b/lucene/core/src/java/org/apache/lucene/index/DocumentsWriterPerThread.java
@@ -60,7 +60,7 @@ final class DocumentsWriterPerThread {
   private Throwable abortingException;
 
   final void onAbortingException(Throwable throwable) {
-    assert abortingException == null: "aborting excpetion has already been set";
+    assert abortingException == null: "aborting exception has already been set";
     abortingException = throwable;
   }
 
diff --git a/lucene/core/src/java/org/apache/lucene/index/FieldInfos.java b/lucene/core/src/java/org/apache/lucene/index/FieldInfos.java
index 879baa7..d16c129 100644
--- a/lucene/core/src/java/org/apache/lucene/index/FieldInfos.java
+++ b/lucene/core/src/java/org/apache/lucene/index/FieldInfos.java
@@ -277,7 +277,7 @@ public class FieldInfos implements Iterable<FieldInfo> {
     private final Map<String,FieldDimensions> dimensions;
 
     // TODO: we should similarly catch an attempt to turn
-    // norms back on after they were already ommitted; today
+    // norms back on after they were already committed; today
     // we silently discard the norm but this is badly trappy
     private int lowestUnassignedFieldNumber = -1;
 
diff --git a/lucene/core/src/java/org/apache/lucene/index/FieldUpdatesBuffer.java b/lucene/core/src/java/org/apache/lucene/index/FieldUpdatesBuffer.java
index d9db980..c91f650 100644
--- a/lucene/core/src/java/org/apache/lucene/index/FieldUpdatesBuffer.java
+++ b/lucene/core/src/java/org/apache/lucene/index/FieldUpdatesBuffer.java
@@ -250,13 +250,13 @@ final class FieldUpdatesBuffer {
     @Override
     public int hashCode() {
       throw new UnsupportedOperationException(
-          "this struct should not be use in map or other data-stuctures that use hashCode / equals");
+          "this struct should not be use in map or other data-structures that use hashCode / equals");
     }
 
     @Override
     public boolean equals(Object obj) {
       throw new UnsupportedOperationException(
-          "this struct should not be use in map or other data-stuctures that use hashCode / equals");
+          "this struct should not be use in map or other data-structures that use hashCode / equals");
     }
   }
 
diff --git a/lucene/core/src/java/org/apache/lucene/index/SegmentWriteState.java b/lucene/core/src/java/org/apache/lucene/index/SegmentWriteState.java
index d00a19e..3f62ee6 100644
--- a/lucene/core/src/java/org/apache/lucene/index/SegmentWriteState.java
+++ b/lucene/core/src/java/org/apache/lucene/index/SegmentWriteState.java
@@ -114,7 +114,7 @@ public class SegmentWriteState {
   }
   
   // currently only used by assert? clean up and make real check?
-  // either it's a segment suffix (_X_Y) or it's a parseable generation
+  // either it's a segment suffix (_X_Y) or it's a parsable generation
   // TODO: this is very confusing how ReadersAndUpdates passes generations via
   // this mechanism, maybe add 'generation' explicitly to ctor create the 'actual suffix' here?
   private boolean assertSegmentSuffix(String segmentSuffix) {
diff --git a/lucene/core/src/java/org/apache/lucene/search/IndexSearcher.java b/lucene/core/src/java/org/apache/lucene/search/IndexSearcher.java
index 7707f8f..41957d1 100644
--- a/lucene/core/src/java/org/apache/lucene/search/IndexSearcher.java
+++ b/lucene/core/src/java/org/apache/lucene/search/IndexSearcher.java
@@ -345,7 +345,7 @@ public class IndexSearcher {
       return count;
     }
 
-    // general case: create a collecor and count matches
+    // general case: create a collector and count matches
     final CollectorManager<TotalHitCountCollector, Integer> collectorManager = new CollectorManager<TotalHitCountCollector, Integer>() {
 
       @Override
diff --git a/lucene/core/src/java/org/apache/lucene/search/ReferenceManager.java b/lucene/core/src/java/org/apache/lucene/search/ReferenceManager.java
index c3487ad..41eee16 100644
--- a/lucene/core/src/java/org/apache/lucene/search/ReferenceManager.java
+++ b/lucene/core/src/java/org/apache/lucene/search/ReferenceManager.java
@@ -162,7 +162,7 @@ public abstract class ReferenceManager<G> implements Closeable {
 
   private void doMaybeRefresh() throws IOException {
     // it's ok to call lock() here (blocking) because we're supposed to get here
-    // from either maybeRefreh() or maybeRefreshBlocking(), after the lock has
+    // from either maybeRefresh() or maybeRefreshBlocking(), after the lock has
     // already been obtained. Doing that protects us from an accidental bug
     // where this method will be called outside the scope of refreshLock.
     // Per ReentrantLock's javadoc, calling lock() by the same thread more than
diff --git a/lucene/core/src/java/org/apache/lucene/util/automaton/Automaton.java b/lucene/core/src/java/org/apache/lucene/util/automaton/Automaton.java
index 76bbcfa..3006940 100644
--- a/lucene/core/src/java/org/apache/lucene/util/automaton/Automaton.java
+++ b/lucene/core/src/java/org/apache/lucene/util/automaton/Automaton.java
@@ -496,7 +496,7 @@ public class Automaton implements Accountable {
 
     int upto = t.transitionUpto;
     if (upto == states[2*t.source]) {
-      // Transition isn't initialzed yet (this is the first transition); don't check:
+      // Transition isn't initialized yet (this is the first transition); don't check:
       return true;
     }
 
diff --git a/lucene/core/src/java/org/apache/lucene/util/automaton/CharacterRunAutomaton.java b/lucene/core/src/java/org/apache/lucene/util/automaton/CharacterRunAutomaton.java
index 1a9c1c9..c282e24 100644
--- a/lucene/core/src/java/org/apache/lucene/util/automaton/CharacterRunAutomaton.java
+++ b/lucene/core/src/java/org/apache/lucene/util/automaton/CharacterRunAutomaton.java
@@ -31,7 +31,7 @@ public class CharacterRunAutomaton extends RunAutomaton {
   /**
    * Construct specifying maxDeterminizedStates.
    * @param a Automaton to match
-   * @param maxDeterminizedStates maximum number of states that the automataon
+   * @param maxDeterminizedStates maximum number of states that the automaton
    *   can have once determinized.  If more states are required to determinize
    *   it then a TooComplexToDeterminizeException is thrown.
    */ 
diff --git a/lucene/core/src/java/org/apache/lucene/util/automaton/CompiledAutomaton.java b/lucene/core/src/java/org/apache/lucene/util/automaton/CompiledAutomaton.java
index e3ad266..55800db 100644
--- a/lucene/core/src/java/org/apache/lucene/util/automaton/CompiledAutomaton.java
+++ b/lucene/core/src/java/org/apache/lucene/util/automaton/CompiledAutomaton.java
@@ -273,7 +273,7 @@ public class CompiledAutomaton implements Accountable {
       if (transition.min < leadLabel) {
         maxIndex = i;
       } else {
-        // Transitions are alway sorted
+        // Transitions are always sorted
         break;
       }
     }
diff --git a/lucene/core/src/java/org/apache/lucene/util/packed/MonotonicBlockPackedWriter.java b/lucene/core/src/java/org/apache/lucene/util/packed/MonotonicBlockPackedWriter.java
index 6b42ffb..da76db9 100644
--- a/lucene/core/src/java/org/apache/lucene/util/packed/MonotonicBlockPackedWriter.java
+++ b/lucene/core/src/java/org/apache/lucene/util/packed/MonotonicBlockPackedWriter.java
@@ -48,7 +48,7 @@ import org.apache.lucene.util.BitUtil;
  * <li>Ints: if BitsPerValue is <tt>0</tt>, then there is nothing to read and
  *     all values perfectly match the result of the function. Otherwise, these
  *     are the {@link PackedInts packed} deltas from the expected value
- *     (computed from the function) using exaclty BitsPerValue bits per value.
+ *     (computed from the function) using exactly BitsPerValue bits per value.
  * </ul>
  * @see MonotonicBlockPackedReader
  * @lucene.internal
diff --git a/lucene/core/src/java/org/apache/lucene/util/packed/PackedInts.java b/lucene/core/src/java/org/apache/lucene/util/packed/PackedInts.java
index 8446e0e..4c391a0 100644
--- a/lucene/core/src/java/org/apache/lucene/util/packed/PackedInts.java
+++ b/lucene/core/src/java/org/apache/lucene/util/packed/PackedInts.java
@@ -890,7 +890,7 @@ public class PackedInts {
       case PACKED_SINGLE_BLOCK:
         return new DirectPacked64SingleBlockReader(bitsPerValue, valueCount, in);
       default:
-        throw new AssertionError("Unknwown format: " + format);
+        throw new AssertionError("Unknown format: " + format);
     }
   }
 
diff --git a/lucene/highlighter/src/test/org/apache/lucene/search/highlight/TokenSourcesTest.java b/lucene/highlighter/src/test/org/apache/lucene/search/highlight/TokenSourcesTest.java
index df139f7..825133c 100644
--- a/lucene/highlighter/src/test/org/apache/lucene/search/highlight/TokenSourcesTest.java
+++ b/lucene/highlighter/src/test/org/apache/lucene/search/highlight/TokenSourcesTest.java
@@ -306,7 +306,7 @@ public class TokenSourcesTest extends BaseTokenStreamTestCase {
   int curOffset;
 
   /** Just make a token with the text, and set the payload
-   *  to the text as well.  Offets increment "naturally". */
+   *  to the text as well.  Offsets increment "naturally". */
   private Token getToken(String text) {
     Token t = new Token(text, curOffset, curOffset+text.length());
     t.setPayload(new BytesRef(text));