You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ro...@apache.org on 2022/03/22 09:20:56 UTC

[lucene] branch main updated: LUCENE-10422: Make errorprone happy

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

romseygeek 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 42bf772  LUCENE-10422: Make errorprone happy
42bf772 is described below

commit 42bf77229ec2882ac9a8a004b98a103417d4ce2f
Author: Alan Woodward <ro...@apache.org>
AuthorDate: Tue Mar 22 09:18:27 2022 +0000

    LUCENE-10422: Make errorprone happy
---
 .../src/test/org/apache/lucene/monitor/TestMonitorReadonly.java       | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lucene/monitor/src/test/org/apache/lucene/monitor/TestMonitorReadonly.java b/lucene/monitor/src/test/org/apache/lucene/monitor/TestMonitorReadonly.java
index 29a873e..db316ba 100644
--- a/lucene/monitor/src/test/org/apache/lucene/monitor/TestMonitorReadonly.java
+++ b/lucene/monitor/src/test/org/apache/lucene/monitor/TestMonitorReadonly.java
@@ -70,10 +70,10 @@ public class TestMonitorReadonly extends MonitorTestBase {
                 MonitorQuerySerializer.fromParser(MonitorTestBase::parse),
                 true);
     try (Monitor monitor = new Monitor(ANALYZER, config)) {
+      TermQuery query = new TermQuery(new Term(FIELD, "test"));
       assertThrows(
           UnsupportedOperationException.class,
           () -> {
-            TermQuery query = new TermQuery(new Term(FIELD, "test"));
             monitor.register(
                 new MonitorQuery("query1", query, query.toString(), Collections.emptyMap()));
           });
@@ -156,10 +156,10 @@ public class TestMonitorReadonly extends MonitorTestBase {
       assertEquals(1, matches.getMatchCount());
       assertNotNull(matches.matches("query1"));
 
+      TermQuery query = new TermQuery(new Term(FIELD, "test"));
       assertThrows(
           UnsupportedOperationException.class,
           () -> {
-            TermQuery query = new TermQuery(new Term(FIELD, "test"));
             readMonitor2.register(
                 new MonitorQuery("query1", query, query.toString(), Collections.emptyMap()));
           });