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:42 UTC
[lucene] 01/04: fix variable assigned to itself in test and enable check (#11980)
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 6249b9ab2cbc402f9cfab01a8ba7c1ca288202fe
Author: Robert Muir <rm...@apache.org>
AuthorDate: Fri Nov 25 11:45:45 2022 -0500
fix variable assigned to itself in test and enable check (#11980)
---
gradle/validation/error-prone.gradle | 2 +-
.../core/src/test/org/apache/lucene/index/TestNRTReaderWithThreads.java | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/gradle/validation/error-prone.gradle b/gradle/validation/error-prone.gradle
index 1bb2f9f6a7d..bdf6701bc3b 100644
--- a/gradle/validation/error-prone.gradle
+++ b/gradle/validation/error-prone.gradle
@@ -221,7 +221,7 @@ allprojects { prj ->
'-Xep:RequiredModifiers:ERROR',
'-Xep:RestrictedApiChecker:ERROR',
// '-Xep:ReturnValueIgnored:OFF',
- // '-Xep:SelfAssignment:OFF',
+ '-Xep:SelfAssignment:ERROR',
'-Xep:SelfComparison:ERROR',
'-Xep:SelfEquals:ERROR',
'-Xep:ShouldHaveEvenArgs:ERROR',
diff --git a/lucene/core/src/test/org/apache/lucene/index/TestNRTReaderWithThreads.java b/lucene/core/src/test/org/apache/lucene/index/TestNRTReaderWithThreads.java
index 20720363055..ad2ad8074c2 100644
--- a/lucene/core/src/test/org/apache/lucene/index/TestNRTReaderWithThreads.java
+++ b/lucene/core/src/test/org/apache/lucene/index/TestNRTReaderWithThreads.java
@@ -105,7 +105,7 @@ public class TestNRTReaderWithThreads extends LuceneTestCase {
}
} catch (Throwable ex) {
ex.printStackTrace(System.out);
- this.failure = failure;
+ this.failure = ex;
throw new RuntimeException(ex);
}
}