Skip to content

armgit / solr

Public Imported from GitHub
0

Apache Solr open-source search software

Fix typos in various comments and log msgs (#1000)

Benedict Jinf70e21c91c1f
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 0503e034c3d..1102ccc5115 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
@@ -1655,7 +1655,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 15aed412a13..0f33aef69a9 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 12409a7158e..c21445358b9 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 d887c4f3018..590960286c7 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 76bfdf23dde..9978f6cacc5 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 520d1d41c5f..ec340cec7b3 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 d33d11acf5f..f6a15d075e6 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 d53e26a3e4b..b118b18fa31 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 2f520e0ec1d..18d951ebf09 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 979a248f705..281c36d2795 100644
--- a/lucene/core/src/java/org/apache/lucene/index/FieldInfos.java
+++ b/lucene/core/src/java/org/apache/lucene/index/FieldInfos.java
@@ -275,7 +275,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 d9db98073f3..c91f6502244 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 d00a19edf52..3f62ee6e6ca 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 b620b3dc6de..df6c72092d4 100644
--- a/lucene/core/src/java/org/apache/lucene/search/IndexSearcher.java
+++ b/lucene/core/src/java/org/apache/lucene/search/IndexSearcher.java
@@ -422,7 +422,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 c3487ad0fff..41eee16df58 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 3bfd04fcc27..6c317ebdff7 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 1a9c1c92680..c282e24d1bf 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 e3ad2661dbf..55800dbb60f 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 6b42ffbaa14..da76db9a880 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 5519d4ad2fb..4cc4f2a27bf 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
@@ -855,7 +855,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 df139f7c11c..825133c3f71 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));