summaryrefslogtreecommitdiffstats
path: root/config-model/src/main/java
diff options
context:
space:
mode:
authorArne H Juul <arnej@yahooinc.com>2022-03-08 08:18:10 +0000
committerArne H Juul <arnej@yahooinc.com>2022-03-08 08:18:10 +0000
commit8f6d6802ef621e1bc0c77c6da543520f366204fb (patch)
tree34fc3f5a905af607799a7fcd97c0eb1e607bf69d /config-model/src/main/java
parent6e5a2a1ef37168782c84e9f46a3069f6cabd4228 (diff)
avoid endless recursion
Diffstat (limited to 'config-model/src/main/java')
-rw-r--r--config-model/src/main/java/com/yahoo/searchdefinition/DocumentModelBuilder.java6
1 files changed, 5 insertions, 1 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 eacbfb0f669..0db810d5933 100644
--- a/config-model/src/main/java/com/yahoo/searchdefinition/DocumentModelBuilder.java
+++ b/config-model/src/main/java/com/yahoo/searchdefinition/DocumentModelBuilder.java
@@ -334,7 +334,7 @@ public class DocumentModelBuilder {
private final NewDocumentType targetDt;
Map<AnnotationType, String> annotationInheritance = new HashMap<>();
Map<StructDataType, String> structInheritance = new HashMap<>();
- private final Map<Object, Integer> inProgress = new IdentityHashMap<>();
+ private final Map<Object, Object> inProgress = new IdentityHashMap<>();
TypeExtractor(NewDocumentType target) {
this.targetDt = target;
}
@@ -404,6 +404,10 @@ public class DocumentModelBuilder {
}
private void extractNestedTypes(DataType type) {
+ if (inProgress.containsKey(type)) {
+ return;
+ }
+ inProgress.put(type, this);
if (type instanceof StructDataType) {
StructDataType tmp = (StructDataType) type;
extractDataTypesFromFields(tmp.getFieldsThisTypeOnly());