diff options
author | Arne H Juul <arnej@yahooinc.com> | 2022-06-07 08:36:38 +0000 |
---|---|---|
committer | gjoranv <gv@verizonmedia.com> | 2022-06-08 11:45:30 +0200 |
commit | a3836826938bd0414a611c79beadeedd644c6fb0 (patch) | |
tree | 48d7875df9ab0b4ce2c03b702737bdbf27948181 /document | |
parent | cb830cc2153ecc488eb532784e115e0ba7e37d26 (diff) |
add fieldsets after inheriting
* bad design of DocumentType class (in both Java and C++)
causes silent failures when this is done in the wrong order.
Diffstat (limited to 'document')
-rw-r--r-- | document/src/vespa/document/repo/documenttyperepo.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/document/src/vespa/document/repo/documenttyperepo.cpp b/document/src/vespa/document/repo/documenttyperepo.cpp index 488dfea2fd7..c9473c90934 100644 --- a/document/src/vespa/document/repo/documenttyperepo.cpp +++ b/document/src/vespa/document/repo/documenttyperepo.cpp @@ -819,13 +819,6 @@ private: for (const auto & importD : docT.importedfield) { doc_type->add_imported_field_name(importD.name); } - for (const auto & entry : docT.fieldsets) { - DocumentType::FieldSet::Fields fields; - for (const auto& f : entry.second.fields) { - fields.insert(f); - } - doc_type->addFieldSet(entry.first, fields); - } for (const auto & inheritD : docT.inherits) { const DataType *dt = _made_types[inheritD.idx]; const DocumentType * parent = dynamic_cast<const DocumentType *>(dt); @@ -837,6 +830,13 @@ private: doc_type->inherit(*parent); } } + for (const auto & entry : docT.fieldsets) { + DocumentType::FieldSet::Fields fields; + for (const auto& f : entry.second.fields) { + fields.insert(f); + } + doc_type->addFieldSet(entry.first, fields); + } } void fillAnnotationTypes(DocTypeInProgress & dtInP) { |