You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by rm...@apache.org on 2022/11/25 16:52:44 UTC

[lucene] 03/04: fix use of wrong array toString() method in test, enable check (#11978)

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

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

commit b84a269197a17e9a02e8eed7df10f523e9e6edca
Author: Robert Muir <rm...@apache.org>
AuthorDate: Fri Nov 25 11:47:04 2022 -0500

    fix use of wrong array toString() method in test, enable check (#11978)
---
 gradle/validation/error-prone.gradle                                  | 4 ++--
 .../lucene/analysis/miscellaneous/TestStemmerOverrideFilter.java      | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/gradle/validation/error-prone.gradle b/gradle/validation/error-prone.gradle
index 294a824c83b..44971d7409b 100644
--- a/gradle/validation/error-prone.gradle
+++ b/gradle/validation/error-prone.gradle
@@ -80,8 +80,8 @@ allprojects { prj ->
             '-Xep:AndroidInjectionBeforeSuper:ERROR',
             '-Xep:ArrayEquals:ERROR',
             '-Xep:ArrayFillIncompatibleType:ERROR',
-            // '-Xep:ArrayHashCode:OFF',
-            // '-Xep:ArrayToString:OFF',
+            '-Xep:ArrayHashCode:ERROR',
+            '-Xep:ArrayToString:ERROR',
             '-Xep:ArraysAsListPrimitiveArray:ERROR',
             '-Xep:AsyncCallableReturnsNull:ERROR',
             '-Xep:AsyncFunctionReturnsNull:ERROR',
diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestStemmerOverrideFilter.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestStemmerOverrideFilter.java
index e2dec98cbf4..28a6f3b004b 100644
--- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestStemmerOverrideFilter.java
+++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestStemmerOverrideFilter.java
@@ -102,7 +102,7 @@ public class TestStemmerOverrideFilter extends BaseTokenStreamTestCase {
           // TODO: can we simply use inputValue.toLowerCase(Locale.ROOT)???
           char[] buffer = inputValue.toCharArray();
           CharacterUtils.toLowerCase(buffer, 0, buffer.length);
-          seenInputValue = buffer.toString();
+          seenInputValue = new String(buffer);
         } else {
           seenInputValue = inputValue;
         }