aboutsummaryrefslogtreecommitdiffstats
path: root/config-model/src/main/java/com/yahoo/searchdefinition
diff options
context:
space:
mode:
authorArne H Juul <arnej@yahooinc.com>2021-12-08 13:20:20 +0000
committerArne H Juul <arnej@yahooinc.com>2021-12-08 20:01:31 +0000
commitd2d8a190d82833558c76acd410a1100f83b2398d (patch)
tree7a1a065cc2dd5681dfbaff810ef964df31c8adbb /config-model/src/main/java/com/yahoo/searchdefinition
parent1088286a370f1b234a981e5e1aa5f89843681640 (diff)
try harder to resolve temporaries
Diffstat (limited to 'config-model/src/main/java/com/yahoo/searchdefinition')
-rw-r--r--config-model/src/main/java/com/yahoo/searchdefinition/DocumentModelBuilder.java22
1 files changed, 15 insertions, 7 deletions
diff --git a/config-model/src/main/java/com/yahoo/searchdefinition/DocumentModelBuilder.java b/config-model/src/main/java/com/yahoo/searchdefinition/DocumentModelBuilder.java
index 8809cdeacc8..dec5505c7e3 100644
--- a/config-model/src/main/java/com/yahoo/searchdefinition/DocumentModelBuilder.java
+++ b/config-model/src/main/java/com/yahoo/searchdefinition/DocumentModelBuilder.java
@@ -204,13 +204,21 @@ public class DocumentModelBuilder {
private static DataType resolveTemporariesRecurse(DataType type, DataTypeCollection repo,
Collection<NewDocumentType> docs) {
if (type instanceof TemporaryStructuredDataType) {
- DataType struct = repo.getDataType(type.getId());
- if (struct != null)
- type = struct;
- else
- type = getDocumentType(docs, type.getId());
- }
- else if (type instanceof StructDataType) {
+ DataType other = repo.getDataType(type.getId());
+ if (other == null || other == type) {
+ other = getDocumentType(docs, type.getId());
+ }
+ // maybe warning if null here?
+ if (other != null) {
+ type = other;
+ }
+ } else if (type instanceof DocumentType || type instanceof NewDocumentType) {
+ DataType other = getDocumentType(docs, type.getId());
+ // maybe warning if null here?
+ if (other != null) {
+ type = other;
+ }
+ } else if (type instanceof StructDataType) {
StructDataType dt = (StructDataType) type;
for (com.yahoo.document.Field field : dt.getFields()) {
if (field.getDataType() != type) {