Skip to content

Commit

Permalink
Add license
Browse files Browse the repository at this point in the history
  • Loading branch information
Edarke committed Jan 10, 2025
1 parent 5b7fdf8 commit 5cee2e9
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -581,7 +581,8 @@ private static void enforceDistinctLeaves(LeafSlice leafSlice) {
* @throws TooManyClauses If a query would exceed {@link IndexSearcher#getMaxClauseCount()}
* clauses.
*/
public TopDocs searchAfter(@Nullable ScoreDoc after, Query query, int numHits) throws IOException {
public TopDocs searchAfter(@Nullable ScoreDoc after, Query query, int numHits)
throws IOException {
final int limit = Math.max(1, reader.maxDoc());
if (after != null && after.doc >= limit) {
throw new IllegalArgumentException(
Expand Down Expand Up @@ -714,7 +715,8 @@ public TopFieldDocs searchAfter(
}

private TopFieldDocs searchAfter(
@Nullable FieldDoc after, Query query, int numHits, Sort sort, boolean doDocScores) throws IOException {
@Nullable FieldDoc after, Query query, int numHits, Sort sort, boolean doDocScores)
throws IOException {
final int limit = Math.max(1, reader.maxDoc());
if (after != null && after.doc >= limit) {
throw new IllegalArgumentException(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@ public TopFieldCollectorManager(
* count of the result will be accurate. {@link Integer#MAX_VALUE} may be used to make the hit
* count accurate, but this will also make query processing slower.
*/
public TopFieldCollectorManager(Sort sort, int numHits, @Nullable FieldDoc after, int totalHitsThreshold) {
public TopFieldCollectorManager(
Sort sort, int numHits, @Nullable FieldDoc after, int totalHitsThreshold) {
if (totalHitsThreshold < 0) {
throw new IllegalArgumentException(
"totalHitsThreshold must be >= 0, got " + totalHitsThreshold);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ public TopScoreDocCollectorManager(
* count of the result will be accurate. {@link Integer#MAX_VALUE} may be used to make the hit
* count accurate, but this will also make query processing slower.
*/
public TopScoreDocCollectorManager(int numHits, @Nullable ScoreDoc after, int totalHitsThreshold) {
public TopScoreDocCollectorManager(
int numHits, @Nullable ScoreDoc after, int totalHitsThreshold) {
if (totalHitsThreshold < 0) {
throw new IllegalArgumentException(
"totalHitsThreshold must be >= 0, got " + totalHitsThreshold);
Expand Down
33 changes: 31 additions & 2 deletions lucene/core/src/java/org/apache/lucene/util/Nullable.java
Original file line number Diff line number Diff line change
@@ -1,4 +1,33 @@
/*
* 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.util;

public @interface Nullable {
}
import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
* Annotates a type to indicate that it is allowed to take {@code null} as a valid value.
*
* @lucene.internal
*/
@Documented
@Target(ElementType.TYPE_USE)
@Retention(RetentionPolicy.RUNTIME)
public @interface Nullable {}

0 comments on commit 5cee2e9

Please sign in to comment.