Skip to content

Apache Lucene open-source search software

LUCENE-7084: fail precommit on comparingIdentical. also replaces one assert in the SingletonSortedSetDocValues constructor with equivalent test (TestSortedSetDocValues.testNoMoreOrdsConstant).

Christine Poerschkef1ad769666d5
diff --git a/lucene/core/src/java/org/apache/lucene/index/SingletonSortedSetDocValues.java b/lucene/core/src/java/org/apache/lucene/index/SingletonSortedSetDocValues.java
index c90fcc5fafd..5077cd84320 100644
--- a/lucene/core/src/java/org/apache/lucene/index/SingletonSortedSetDocValues.java
+++ b/lucene/core/src/java/org/apache/lucene/index/SingletonSortedSetDocValues.java
@@ -33,7 +33,6 @@ final class SingletonSortedSetDocValues extends RandomAccessOrds {
/** Creates a multi-valued view over the provided SortedDocValues */
public SingletonSortedSetDocValues(SortedDocValues in) {
this.in = in;
- assert NO_MORE_ORDS == -1; // this allows our nextOrd() to work for missing values without a check
}
/** Return the wrapped {@link SortedDocValues} */
diff --git a/lucene/core/src/test/org/apache/lucene/index/TestSortedSetDocValues.java b/lucene/core/src/test/org/apache/lucene/index/TestSortedSetDocValues.java
new file mode 100644
index 00000000000..8cffeaf00a6
--- /dev/null
+++ b/lucene/core/src/test/org/apache/lucene/index/TestSortedSetDocValues.java
@@ -0,0 +1,27 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.lucene.index;
+
+import org.apache.lucene.util.LuceneTestCase;
+
+public class TestSortedSetDocValues extends LuceneTestCase {
+
+ public void testNoMoreOrdsConstant() {
+ assertEquals(SortedSetDocValues.NO_MORE_ORDS, -1);
+ }
+
+}
diff --git a/lucene/tools/javadoc/ecj.javadocs.prefs b/lucene/tools/javadoc/ecj.javadocs.prefs
index d01148c602f..bd98c99ac62 100644
--- a/lucene/tools/javadoc/ecj.javadocs.prefs
+++ b/lucene/tools/javadoc/ecj.javadocs.prefs
@@ -11,7 +11,7 @@ org.eclipse.jdt.core.compiler.doc.comment.support=enabled
org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=ignore
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
-org.eclipse.jdt.core.compiler.problem.comparingIdentical=ignore
+org.eclipse.jdt.core.compiler.problem.comparingIdentical=error
org.eclipse.jdt.core.compiler.problem.deadCode=ignore
org.eclipse.jdt.core.compiler.problem.deprecation=ignore
org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled