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:45:52 UTC

[lucene] branch main updated: 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 main
in repository https://gitbox.apache.org/repos/asf/lucene.git


The following commit(s) were added to refs/heads/main by this push:
     new f4286493d16 fix variable assigned to itself in test and enable check (#11980)
f4286493d16 is described below

commit f4286493d161253519f970465704aab112663476
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);
       }
     }