From d253aadca678b72bf70952adf6f6d78fb6668355 Mon Sep 17 00:00:00 2001 From: Arne H Juul Date: Thu, 7 Apr 2022 19:59:40 +0000 Subject: just register document types --- .../yahoo/document/DocumentTypeManagerConfigurer.java | 9 ++++----- .../com/yahoo/document/DocumentTypeManagerTestCase.java | 16 ++++++++++------ 2 files changed, 14 insertions(+), 11 deletions(-) (limited to 'document') diff --git a/document/src/main/java/com/yahoo/document/DocumentTypeManagerConfigurer.java b/document/src/main/java/com/yahoo/document/DocumentTypeManagerConfigurer.java index f84c979c79a..76dac2bdc20 100644 --- a/document/src/main/java/com/yahoo/document/DocumentTypeManagerConfigurer.java +++ b/document/src/main/java/com/yahoo/document/DocumentTypeManagerConfigurer.java @@ -274,6 +274,7 @@ public class DocumentTypeManagerConfigurer implements ConfigSubscriber.SingleSub } } + @SuppressWarnings("deprecation") private void apply(DocumentmanagerConfig config) { splitConfig(config); setupAnnotationTypesWithoutPayloads(config); @@ -453,10 +454,8 @@ public class DocumentTypeManagerConfigurer implements ConfigSubscriber.SingleSub if (isPositionStruct(typeconf)) { int geoVersion = usev8geopositions ? 8 : 7; addNewType(typeconf.idx(), new GeoPosType(geoVersion)); - } else if (typeconf.name().equals(docName + ".header")) { - addNewType(typeconf.idx(), new StructDataType(typeconf.name())); } else { - addNewType(typeconf.idx(), new StructDataType(typeconf.name() + "@" + docName)); + addNewType(typeconf.idx(), new StructDataType(typeconf.name())); } } } @@ -606,8 +605,8 @@ public class DocumentTypeManagerConfigurer implements ConfigSubscriber.SingleSub for (int idx : proxyRefs) { typesByIdx.remove(idx); } - for (DataType type : typesByIdx.values()) { - manager.register(type); + for (var docTypeData : inProgressByName.values()) { + manager.registerSingleType(docTypeData.docType); } } diff --git a/document/src/test/java/com/yahoo/document/DocumentTypeManagerTestCase.java b/document/src/test/java/com/yahoo/document/DocumentTypeManagerTestCase.java index aa9828f7457..a455fa4818e 100644 --- a/document/src/test/java/com/yahoo/document/DocumentTypeManagerTestCase.java +++ b/document/src/test/java/com/yahoo/document/DocumentTypeManagerTestCase.java @@ -665,12 +665,16 @@ search annotationsimplicitstruct { assertNotNull(struct); assertNotNull(struct.getField("f0")); - assertNotNull(manager.getDataTypeInternal("mystruct@common")); - assertNotNull(manager.getDataTypeInternal("mystructinfoo@foo")); - assertNotNull(manager.getDataTypeInternal("mystructinbar@bar")); - assertNotNull(manager.getDataTypeInternal("mystructinfoobar@foobar")); - assertNotNull(manager.getDataTypeInternal("foo.header")); - assertNotNull(manager.getDataTypeInternal("position")); + assertNull(manager.getDataTypeInternal("mystruct@common")); + assertNull(manager.getDataTypeInternal("mystructinfoo@foo")); + assertNull(manager.getDataTypeInternal("mystructinbar@bar")); + assertNull(manager.getDataTypeInternal("mystructinfoobar@foobar")); + assertNull(manager.getDataTypeInternal("mystruct")); + assertNull(manager.getDataTypeInternal("mystructinfoo")); + assertNull(manager.getDataTypeInternal("mystructinbar")); + assertNull(manager.getDataTypeInternal("mystructinfoobar")); + assertNull(manager.getDataTypeInternal("foo.header")); + assertNull(manager.getDataTypeInternal("position")); } // TODO test clone(). Also fieldSets not part of clone()..! -- cgit v1.2.3