diff options
author | Harald Musum <musum@verizonmedia.com> | 2022-08-13 09:29:58 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-13 09:29:58 +0200 |
commit | d29794a319a78daafc4e691b5f76432ecda32d5e (patch) | |
tree | 9218a031d013ce7410a863bfe46c87aa1f115d5b | |
parent | 629d25fec86c8ca0a1c0e61da58932e05b0b2802 (diff) | |
parent | 715af42fc61e168d8bf5d2d7d541af758d07cc2d (diff) |
Merge pull request #23654 from vespa-engine/balder/add-finalv8.34.38
Add final to members, and use pattern variable.
-rw-r--r-- | config-model/src/main/java/com/yahoo/schema/derived/IndexInfo.java | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/config-model/src/main/java/com/yahoo/schema/derived/IndexInfo.java b/config-model/src/main/java/com/yahoo/schema/derived/IndexInfo.java index 4887ad52974..277858bed26 100644 --- a/config-model/src/main/java/com/yahoo/schema/derived/IndexInfo.java +++ b/config-model/src/main/java/com/yahoo/schema/derived/IndexInfo.java @@ -178,13 +178,11 @@ public class IndexInfo extends Derived implements IndexInfoConfig.Producer { PrimitiveDataType primitive = dataType.getPrimitiveType(); if (primitive == PrimitiveDataType.STRING) return true; if (primitive != null) return false; - if (dataType instanceof StructuredDataType) { - StructuredDataType structured = (StructuredDataType) dataType; + if (dataType instanceof StructuredDataType structured) { for (Field field : structured.getFields()) { if (isAnyChildString(field.getDataType())) return true; } - } else if (dataType instanceof MapDataType) { - MapDataType mapType = (MapDataType) dataType; + } else if (dataType instanceof MapDataType mapType) { return isAnyChildString(mapType.getKeyType()) || isAnyChildString(mapType.getValueType()); } return false; @@ -494,9 +492,9 @@ public class IndexInfo extends Derived implements IndexInfoConfig.Producer { */ public static class IndexCommand { - private String index; + private final String index; - private String command; + private final String command; public IndexCommand(String index, String command) { this.index = index; @@ -523,14 +521,12 @@ public class IndexInfo extends Derived implements IndexInfoConfig.Producer { } public boolean equals(Object object) { - if (!(object instanceof IndexCommand)) { + if (!(object instanceof IndexCommand other)) { return false; } - IndexCommand other = (IndexCommand)object; - return - other.index.equals(this.index) && - other.command.equals(this.command); + return other.index.equals(this.index) && + other.command.equals(this.command); } public String toString() { @@ -544,7 +540,7 @@ public class IndexInfo extends Derived implements IndexInfoConfig.Producer { */ private static abstract class IndexOverrider { - protected IndexInfo owner; + protected final IndexInfo owner; public IndexOverrider(IndexInfo owner) { this.owner = owner; @@ -560,7 +556,7 @@ public class IndexInfo extends Derived implements IndexInfoConfig.Producer { private static class StemmingOverrider extends IndexOverrider { - private Schema schema; + private final Schema schema; public StemmingOverrider(IndexInfo owner, Schema schema) { super(owner); |