summaryrefslogtreecommitdiffstats
path: root/document
diff options
context:
space:
mode:
authorArne H Juul <arnej@yahooinc.com>2022-04-07 19:59:40 +0000
committerArne H Juul <arnej@yahooinc.com>2022-04-08 06:17:23 +0000
commitd253aadca678b72bf70952adf6f6d78fb6668355 (patch)
tree600102db3cc1ef6b6affdb431bf689e7895e2619 /document
parent23f86f8016972798db4df5468ec8d37fe6e0f7d6 (diff)
just register document types
Diffstat (limited to 'document')
-rw-r--r--document/src/main/java/com/yahoo/document/DocumentTypeManagerConfigurer.java9
-rw-r--r--document/src/test/java/com/yahoo/document/DocumentTypeManagerTestCase.java16
2 files changed, 14 insertions, 11 deletions
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()..!