From 4e40679d257e665b0f408cc217dcd6877e4f1715 Mon Sep 17 00:00:00 2001 From: Christine Poerschke Date: Mon, 12 Feb 2018 17:41:34 +0000 Subject: [PATCH] LUCENE-8167: fix three incompleteEnumSwitch warnings --- .../src/java/org/apache/lucene/index/FilteredTermsEnum.java | 4 +++- .../lucene/queries/function/TestDocValuesFieldSources.java | 4 ++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/lucene/core/src/java/org/apache/lucene/index/FilteredTermsEnum.java b/lucene/core/src/java/org/apache/lucene/index/FilteredTermsEnum.java index 411b435f2de..61392c3a2c5 100644 --- a/lucene/core/src/java/org/apache/lucene/index/FilteredTermsEnum.java +++ b/lucene/core/src/java/org/apache/lucene/index/FilteredTermsEnum.java @@ -249,7 +249,9 @@ public abstract class FilteredTermsEnum extends TermsEnum { case END: // we are supposed to end the enum return null; - // NO: we just fall through and iterate again + case NO: + // we just iterate again + break; } } } diff --git a/lucene/queries/src/test/org/apache/lucene/queries/function/TestDocValuesFieldSources.java b/lucene/queries/src/test/org/apache/lucene/queries/function/TestDocValuesFieldSources.java index 479ac3cd121..f3946cb6f75 100644 --- a/lucene/queries/src/test/org/apache/lucene/queries/function/TestDocValuesFieldSources.java +++ b/lucene/queries/src/test/org/apache/lucene/queries/function/TestDocValuesFieldSources.java @@ -92,6 +92,8 @@ public class TestDocValuesFieldSources extends LuceneTestCase { vals[i] = (long) random().nextInt((int) PackedInts.maxValue(bitsPerValue)); f.setLongValue((Long) vals[i]); break; + default: + throw new AssertionError(); } iw.addDocument(document); if (random().nextBoolean() && i % 10 == 9) { @@ -150,6 +152,8 @@ public class TestDocValuesFieldSources extends LuceneTestCase { case SORTED_NUMERIC: assertEquals(((Number) expected).longValue(), values.longVal(i)); break; + default: + throw new AssertionError(); } } }