aboutsummaryrefslogtreecommitdiffstats
path: root/container-search
diff options
context:
space:
mode:
authorJon Bratseth <bratseth@vespa.ai>2023-10-18 14:48:42 +0200
committerJon Bratseth <bratseth@vespa.ai>2023-10-18 14:48:42 +0200
commite2fc2d05193e20224cedd20f277cb6e1c253cefb (patch)
tree7a9e501b33321aa10bc6e6865a887963f7200bf9 /container-search
parent771b853b8a0b13a476854eed4e98317d02232ebc (diff)
Non-functional changes only
Diffstat (limited to 'container-search')
-rw-r--r--container-search/src/main/java/com/yahoo/prelude/query/BoolItem.java12
-rw-r--r--container-search/src/main/java/com/yahoo/search/Result.java4
-rw-r--r--container-search/src/main/java/com/yahoo/search/query/SelectParser.java2
-rw-r--r--container-search/src/main/java/com/yahoo/search/result/HitIterator.java4
4 files changed, 12 insertions, 10 deletions
diff --git a/container-search/src/main/java/com/yahoo/prelude/query/BoolItem.java b/container-search/src/main/java/com/yahoo/prelude/query/BoolItem.java
index f6170048158..b6b84c4b276 100644
--- a/container-search/src/main/java/com/yahoo/prelude/query/BoolItem.java
+++ b/container-search/src/main/java/com/yahoo/prelude/query/BoolItem.java
@@ -7,6 +7,8 @@ import java.nio.ByteBuffer;
/**
* A true/false term suitable for searching bool indexes.
+ *
+ * @author bratseth
*/
public class BoolItem extends TermItem {
@@ -58,11 +60,11 @@ public class BoolItem extends TermItem {
}
private boolean toBoolean(String stringValue) {
- switch (stringValue.toLowerCase()) {
- case "true" : return true;
- case "false" : return false;
- default: throw new IllegalInputException("Expected 'true' or 'false', got '" + stringValue + "'");
- }
+ return switch (stringValue.toLowerCase()) {
+ case "true" -> true;
+ case "false" -> false;
+ default -> throw new IllegalInputException("Expected 'true' or 'false', got '" + stringValue + "'");
+ };
}
/** Returns the same as stringValue */
diff --git a/container-search/src/main/java/com/yahoo/search/Result.java b/container-search/src/main/java/com/yahoo/search/Result.java
index 4962466c752..b1a0107c6d8 100644
--- a/container-search/src/main/java/com/yahoo/search/Result.java
+++ b/container-search/src/main/java/com/yahoo/search/Result.java
@@ -70,8 +70,8 @@ public final class Result extends com.yahoo.processing.Response implements Clone
*/
public Result(Query query, HitGroup hits) {
super(query);
- if (query==null) throw new NullPointerException("The query reference in a result cannot be null");
- this.hits=hits;
+ if (query == null) throw new NullPointerException("The query reference in a result cannot be null");
+ this.hits = hits;
hits.setQuery(query);
if (query.getRanking().getSorting() != null) {
setHitOrderer(new HitSortOrderer(query.getRanking().getSorting()));
diff --git a/container-search/src/main/java/com/yahoo/search/query/SelectParser.java b/container-search/src/main/java/com/yahoo/search/query/SelectParser.java
index 4c4eef38d39..93df7fdfb18 100644
--- a/container-search/src/main/java/com/yahoo/search/query/SelectParser.java
+++ b/container-search/src/main/java/com/yahoo/search/query/SelectParser.java
@@ -992,7 +992,7 @@ public class SelectParser implements Parser {
if (origin != null) {
out.setOrigin(origin);
}
- if (annotations != null){
+ if (annotations != null) {
Boolean usePositionData = getBoolAnnotation(USE_POSITION_DATA, annotations, null);
if (usePositionData != null) {
out.setPositionData(usePositionData);
diff --git a/container-search/src/main/java/com/yahoo/search/result/HitIterator.java b/container-search/src/main/java/com/yahoo/search/result/HitIterator.java
index d701c15cb24..3d3eb6030f4 100644
--- a/container-search/src/main/java/com/yahoo/search/result/HitIterator.java
+++ b/container-search/src/main/java/com/yahoo/search/result/HitIterator.java
@@ -19,10 +19,10 @@ public class HitIterator implements Iterator<Hit> {
private int index = -1;
/** The list of hits to iterate over */
- private List<Hit> hits;
+ private final List<Hit> hits;
/** The result the hits belong to */
- private HitGroup hitGroup;
+ private final HitGroup hitGroup;
/** Whether the iterator is in a state where remove is OK */
private boolean canRemove = false;