diff options
author | Arne H Juul <arnej@yahooinc.com> | 2022-03-09 19:51:00 +0000 |
---|---|---|
committer | Arne H Juul <arnej@yahooinc.com> | 2022-03-09 19:51:00 +0000 |
commit | e6d05884f93945983c778f2d67315c05db937ea2 (patch) | |
tree | f596938a43febbfacd316e6487a3d380d9faa4dd /config-model/src | |
parent | 248b51e9257e024dea82a22a5e09ff16bfdb585a (diff) |
avoid making new struct when we have it already
Diffstat (limited to 'config-model/src')
-rw-r--r-- | config-model/src/main/java/com/yahoo/searchdefinition/DocumentModelBuilder.java | 10 |
1 files changed, 10 insertions, 0 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 3eef3314b62..784080c6865 100644 --- a/config-model/src/main/java/com/yahoo/searchdefinition/DocumentModelBuilder.java +++ b/config-model/src/main/java/com/yahoo/searchdefinition/DocumentModelBuilder.java @@ -529,7 +529,17 @@ public class DocumentModelBuilder { return null; } + @SuppressWarnings("deprecation") private StructDataType handleStruct(SDDocumentType type) { + if (type.isStruct()) { + var st = type.getStruct(); + if (st.getName().equals(type.getName()) && + (st instanceof StructDataType) && + ! (st instanceof TemporaryStructuredDataType)) + { + return handleStruct((StructDataType) st); + } + } StructDataType s = new StructDataType(type.getName()); for (Field f : type.getDocumentType().contentStruct().getFieldsThisTypeOnly()) { specialHandleAnnotationReference(f); |