diff --git a/lucene/src/java/org/apache/lucene/util/SorterTemplate.java b/lucene/src/java/org/apache/lucene/util/SorterTemplate.java
index 1be58152b76..b0e558c1c20 100644
--- a/lucene/src/java/org/apache/lucene/util/SorterTemplate.java
+++ b/lucene/src/java/org/apache/lucene/util/SorterTemplate.java
@@ -36,14 +36,14 @@ public abstract class SorterTemplate {
protected abstract void swap(int i, int j);
/** Compares slots {@code i} and {@code j} of you data.
- * Should be implemented like valueOf(j).compareTo(valueOf(i))
*/
+ * Should be implemented like valueOf(i).compareTo(valueOf(j))
*/
protected abstract int compare(int i, int j);
/** Implement this method, that stores the value of slot {@code i} as pivot value */
protected abstract void setPivot(int i);
/** Implements the compare function for the previously stored pivot value.
- * Should be implemented like pivot.compareTo(valueOf(i))
*/
+ * Should be implemented like pivot.compareTo(valueOf(j))
*/
protected abstract int comparePivot(int j);
/** Sorts via stable in-place InsertionSort algorithm