aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJon Bratseth <bratseth@gmail.com>2023-10-18 15:39:17 +0200
committerGitHub <noreply@github.com>2023-10-18 15:39:17 +0200
commit24f8d5ab63a193aeb6660eafb83a22956a679a75 (patch)
tree9986c985a85eacd4b595e46d9f467eb66a452905
parent1eda7c64c9817a935a597d3cd3da7b8b0dee591b (diff)
parente2fc2d05193e20224cedd20f277cb6e1c253cefb (diff)
Merge pull request #29009 from vespa-engine/bratseth/non-functional-only
Non-functional changes only
-rw-r--r--config-model/src/main/java/com/yahoo/schema/document/Ranking.java3
-rw-r--r--config-model/src/test/derived/schemainheritance/schema-info.cfg127
-rw-r--r--container-core/src/main/java/com/yahoo/container/jdisc/state/StateHandler.java12
-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
-rw-r--r--indexinglanguage/src/main/java/com/yahoo/vespa/indexinglanguage/linguistics/LinguisticsAnnotator.java6
8 files changed, 149 insertions, 21 deletions
diff --git a/config-model/src/main/java/com/yahoo/schema/document/Ranking.java b/config-model/src/main/java/com/yahoo/schema/document/Ranking.java
index d00abfcb9aa..2a2b1431057 100644
--- a/config-model/src/main/java/com/yahoo/schema/document/Ranking.java
+++ b/config-model/src/main/java/com/yahoo/schema/document/Ranking.java
@@ -44,9 +44,8 @@ public class Ranking implements Cloneable, Serializable {
/** Returns true if the given rank settings are the same */
@Override
public boolean equals(Object o) {
- if ( ! (o instanceof Ranking)) return false;
+ if ( ! (o instanceof Ranking other)) return false;
- Ranking other=(Ranking)o;
if (this.filter != other.filter) return false;
if (this.literal != other.literal) return false;
if (this.normal != other.normal) return false;
diff --git a/config-model/src/test/derived/schemainheritance/schema-info.cfg b/config-model/src/test/derived/schemainheritance/schema-info.cfg
new file mode 100644
index 00000000000..9fe71780c7a
--- /dev/null
+++ b/config-model/src/test/derived/schemainheritance/schema-info.cfg
@@ -0,0 +1,127 @@
+schema[].name "child"
+schema[].field[].name "parent_field"
+schema[].field[].type "string"
+schema[].field[].attribute true
+schema[].field[].index true
+schema[].field[].name "child_field"
+schema[].field[].type "string"
+schema[].field[].attribute true
+schema[].field[].index true
+schema[].field[].name "pf1"
+schema[].field[].type "string"
+schema[].field[].attribute false
+schema[].field[].index false
+schema[].field[].name "importedschema_ref"
+schema[].field[].type "reference<importedschema>"
+schema[].field[].attribute true
+schema[].field[].index false
+schema[].field[].name "parent_field"
+schema[].field[].type "string"
+schema[].field[].attribute true
+schema[].field[].index true
+schema[].field[].name "cf1"
+schema[].field[].type "string"
+schema[].field[].attribute false
+schema[].field[].index false
+schema[].field[].name "child_field"
+schema[].field[].type "string"
+schema[].field[].attribute true
+schema[].field[].index true
+schema[].field[].name "parent_imported"
+schema[].field[].type "string"
+schema[].field[].attribute true
+schema[].field[].index false
+schema[].field[].name "importedfield1"
+schema[].field[].type "string"
+schema[].field[].attribute true
+schema[].field[].index false
+schema[].field[].name "child_imported"
+schema[].field[].type "string"
+schema[].field[].attribute true
+schema[].field[].index false
+schema[].field[].name "importedfield2"
+schema[].field[].type "string"
+schema[].field[].attribute true
+schema[].field[].index false
+schema[].fieldset[].name "[document]"
+schema[].fieldset[].field[] "cf1"
+schema[].fieldset[].field[] "importedschema_ref"
+schema[].fieldset[].field[] "pf1"
+schema[].fieldset[].name "[search]"
+schema[].fieldset[].field[] "child_field"
+schema[].fieldset[].field[] "parent_field"
+schema[].fieldset[].name "parent_set"
+schema[].fieldset[].field[] "pf1"
+schema[].fieldset[].name "child_set"
+schema[].fieldset[].field[] "cf1"
+schema[].fieldset[].field[] "pf1"
+schema[].summaryclass[].name "default"
+schema[].summaryclass[].fields[].name "parent_field"
+schema[].summaryclass[].fields[].type "longstring"
+schema[].summaryclass[].fields[].dynamic false
+schema[].summaryclass[].fields[].name "child_field"
+schema[].summaryclass[].fields[].type "longstring"
+schema[].summaryclass[].fields[].dynamic false
+schema[].summaryclass[].fields[].name "pf1"
+schema[].summaryclass[].fields[].type "longstring"
+schema[].summaryclass[].fields[].dynamic false
+schema[].summaryclass[].fields[].name "cf1"
+schema[].summaryclass[].fields[].type "longstring"
+schema[].summaryclass[].fields[].dynamic false
+schema[].summaryclass[].fields[].name "rankfeatures"
+schema[].summaryclass[].fields[].type "featuredata"
+schema[].summaryclass[].fields[].dynamic false
+schema[].summaryclass[].fields[].name "summaryfeatures"
+schema[].summaryclass[].fields[].type "featuredata"
+schema[].summaryclass[].fields[].dynamic false
+schema[].summaryclass[].fields[].name "documentid"
+schema[].summaryclass[].fields[].type "longstring"
+schema[].summaryclass[].fields[].dynamic false
+schema[].summaryclass[].name "parent_summary"
+schema[].summaryclass[].fields[].name "pf1"
+schema[].summaryclass[].fields[].type "longstring"
+schema[].summaryclass[].fields[].dynamic false
+schema[].summaryclass[].fields[].name "rankfeatures"
+schema[].summaryclass[].fields[].type "featuredata"
+schema[].summaryclass[].fields[].dynamic false
+schema[].summaryclass[].fields[].name "summaryfeatures"
+schema[].summaryclass[].fields[].type "featuredata"
+schema[].summaryclass[].fields[].dynamic false
+schema[].summaryclass[].name "attributeprefetch"
+schema[].summaryclass[].fields[].name "parent_field"
+schema[].summaryclass[].fields[].type "longstring"
+schema[].summaryclass[].fields[].dynamic false
+schema[].summaryclass[].fields[].name "child_field"
+schema[].summaryclass[].fields[].type "longstring"
+schema[].summaryclass[].fields[].dynamic false
+schema[].summaryclass[].fields[].name "rankfeatures"
+schema[].summaryclass[].fields[].type "featuredata"
+schema[].summaryclass[].fields[].dynamic false
+schema[].summaryclass[].fields[].name "summaryfeatures"
+schema[].summaryclass[].fields[].type "featuredata"
+schema[].summaryclass[].fields[].dynamic false
+schema[].summaryclass[].name "child_summary"
+schema[].summaryclass[].fields[].name "pf1"
+schema[].summaryclass[].fields[].type "longstring"
+schema[].summaryclass[].fields[].dynamic false
+schema[].summaryclass[].fields[].name "rankfeatures"
+schema[].summaryclass[].fields[].type "featuredata"
+schema[].summaryclass[].fields[].dynamic false
+schema[].summaryclass[].fields[].name "summaryfeatures"
+schema[].summaryclass[].fields[].type "featuredata"
+schema[].summaryclass[].fields[].dynamic false
+schema[].summaryclass[].fields[].name "cf1"
+schema[].summaryclass[].fields[].type "longstring"
+schema[].summaryclass[].fields[].dynamic false
+schema[].rankprofile[].name "default"
+schema[].rankprofile[].hasSummaryFeatures false
+schema[].rankprofile[].hasRankFeatures false
+schema[].rankprofile[].name "unranked"
+schema[].rankprofile[].hasSummaryFeatures false
+schema[].rankprofile[].hasRankFeatures false
+schema[].rankprofile[].name "child_profile"
+schema[].rankprofile[].hasSummaryFeatures false
+schema[].rankprofile[].hasRankFeatures false
+schema[].rankprofile[].name "parent_profile"
+schema[].rankprofile[].hasSummaryFeatures false
+schema[].rankprofile[].hasRankFeatures false
diff --git a/container-core/src/main/java/com/yahoo/container/jdisc/state/StateHandler.java b/container-core/src/main/java/com/yahoo/container/jdisc/state/StateHandler.java
index da730dc9acc..045b13e5d63 100644
--- a/container-core/src/main/java/com/yahoo/container/jdisc/state/StateHandler.java
+++ b/container-core/src/main/java/com/yahoo/container/jdisc/state/StateHandler.java
@@ -131,12 +131,12 @@ public class StateHandler extends AbstractRequestHandler implements CapabilityRe
try {
String suffix = resolvePath(requestUri);
return switch (suffix) {
- case "" -> ByteBuffer.wrap(apiLinks(requestUri));
- case CONFIG_GENERATION_PATH -> ByteBuffer.wrap(toPrettyString(config));
- case HISTOGRAMS_PATH -> ByteBuffer.wrap(buildHistogramsOutput());
- case HEALTH_PATH, METRICS_PATH -> ByteBuffer.wrap(buildMetricOutput(suffix));
- case VERSION_PATH -> ByteBuffer.wrap(buildVersionOutput());
- default -> ByteBuffer.wrap(buildMetricOutput(suffix)); // XXX should possibly do something else here
+ case "" -> ByteBuffer.wrap(apiLinks(requestUri));
+ case CONFIG_GENERATION_PATH -> ByteBuffer.wrap(toPrettyString(config));
+ case HISTOGRAMS_PATH -> ByteBuffer.wrap(buildHistogramsOutput());
+ case HEALTH_PATH, METRICS_PATH -> ByteBuffer.wrap(buildMetricOutput(suffix));
+ case VERSION_PATH -> ByteBuffer.wrap(buildVersionOutput());
+ default -> ByteBuffer.wrap(buildMetricOutput(suffix)); // XXX should possibly do something else here
};
} catch (JsonProcessingException e) {
throw new RuntimeException("Bad JSON construction", e);
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;
diff --git a/indexinglanguage/src/main/java/com/yahoo/vespa/indexinglanguage/linguistics/LinguisticsAnnotator.java b/indexinglanguage/src/main/java/com/yahoo/vespa/indexinglanguage/linguistics/LinguisticsAnnotator.java
index d65d25aa537..61ee3069127 100644
--- a/indexinglanguage/src/main/java/com/yahoo/vespa/indexinglanguage/linguistics/LinguisticsAnnotator.java
+++ b/indexinglanguage/src/main/java/com/yahoo/vespa/indexinglanguage/linguistics/LinguisticsAnnotator.java
@@ -88,9 +88,9 @@ public class LinguisticsAnnotator {
* Creates a TERM annotation which has the lowercase value as annotation (only) if it is different from the
* original.
*
- * @param termToLowerCase The term to lower case.
- * @param origTerm The original term.
- * @return the created TERM annotation.
+ * @param termToLowerCase the term to lower case
+ * @param origTerm the original term
+ * @return the created TERM annotation
*/
public static Annotation lowerCaseTermAnnotation(String termToLowerCase, String origTerm) {
String annotationValue = toLowerCase(termToLowerCase);