diff --git a/lucene/CHANGES.txt b/lucene/CHANGES.txt index 9d739e1366b5..b14dc9df87fc 100644 --- a/lucene/CHANGES.txt +++ b/lucene/CHANGES.txt @@ -157,6 +157,8 @@ Bug Fixes * GITHUB#14971: Fix CachedExecutor thread pool leak in ConcurrentMergeScheduler when IndexWriter initialization fails. (Su Beom) +* GITHUB#15781: Fix incorrect parameter names in GradientFormatter error messages. (Vinay Krishna Pudyodu) + Changes in Runtime Behavior --------------------- * GITHUB#14187: The query cache is now disabled by default. (Adrien Grand) diff --git a/lucene/highlighter/src/java/org/apache/lucene/search/highlight/GradientFormatter.java b/lucene/highlighter/src/java/org/apache/lucene/search/highlight/GradientFormatter.java index e532f0779298..8fd59725e724 100644 --- a/lucene/highlighter/src/java/org/apache/lucene/search/highlight/GradientFormatter.java +++ b/lucene/highlighter/src/java/org/apache/lucene/search/highlight/GradientFormatter.java @@ -58,7 +58,7 @@ public GradientFormatter( } if (maxForegroundColor.length() != 7) { throw new IllegalArgumentException( - "minForegroundColor is not 7 bytes long eg a hex " + "RGB value such as #FFFFFF"); + "maxForegroundColor is not 7 bytes long eg a hex " + "RGB value such as #FFFFFF"); } fgRMin = hexToInt(minForegroundColor.substring(1, 3)); fgGMin = hexToInt(minForegroundColor.substring(3, 5)); @@ -77,7 +77,7 @@ public GradientFormatter( } if (maxBackgroundColor.length() != 7) { throw new IllegalArgumentException( - "minBackgroundColor is not 7 bytes long eg a hex " + "RGB value such as #FFFFFF"); + "maxBackgroundColor is not 7 bytes long eg a hex " + "RGB value such as #FFFFFF"); } bgRMin = hexToInt(minBackgroundColor.substring(1, 3)); bgGMin = hexToInt(minBackgroundColor.substring(3, 5)); @@ -87,14 +87,11 @@ public GradientFormatter( bgGMax = hexToInt(maxBackgroundColor.substring(3, 5)); bgBMax = hexToInt(maxBackgroundColor.substring(5, 7)); } - // this.corpusReader = corpusReader; this.maxScore = maxScore; - // totalNumDocs = corpusReader.numDocs(); } @Override public String highlightTerm(String originalText, TokenGroup tokenGroup) { - if (tokenGroup.getTotalScore() == 0) return originalText; float score = tokenGroup.getTotalScore(); if (score == 0) { return originalText;