Skip to content

Commit

Permalink
remove old fixups no longer needed
Browse files Browse the repository at this point in the history
  • Loading branch information
arnej27959 committed Mar 11, 2022
1 parent cb7c08c commit c7d9572
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 39 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ public Application(ApplicationPackage applicationPackage,

List<Schema> schemasSomewhatOrdered = new ArrayList<>(schemas);
for (Schema schema : new SearchOrderer().order(schemasSomewhatOrdered)) {
new FieldOperationApplierForStructs().processSchemaFields(schema);
new FieldOperationApplierForSearch().process(schema); // TODO: Why is this not in the regular list?
new Processing(properties).process(schema,
logger,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,46 +20,8 @@ public void process(SDDocumentType sdoc) {
for (SDDocumentType type : sdoc.getAllTypes()) {
if (type.isStruct()) {
apply(type);
copyFields(type, sdoc);
}
}
}

@SuppressWarnings("deprecation")
private void copyFields(SDDocumentType structType, SDDocumentType sdoc) {
//find all fields in OTHER types that have this type:
List<SDDocumentType> list = new ArrayList<>();
list.add(sdoc);
list.addAll(sdoc.getTypes());
for (SDDocumentType anyType : list) {
Iterator<Field> fields = anyType.fieldIterator();
while (fields.hasNext()) {
SDField field = (SDField) fields.next();
maybePopulateField(sdoc, field, structType);
}
}
}

private void maybePopulateField(SDDocumentType sdoc, SDField field, SDDocumentType structType) {
DataType structUsedByField = field.getFirstStructRecursive();
if (structUsedByField == null) {
return;
}
if (structUsedByField.getName().equals(structType.getName())) {
//this field is using this type!!
// field.populateWithStructFields(sdoc, field.getName(), field.getDataType(), 0);
}
}

public void processSchemaFields(Schema schema) {
var sdoc = schema.getDocument();
if (sdoc == null) return;
for (SDDocumentType type : sdoc.getAllTypes()) {
if (type.isStruct()) {
for (SDField field : schema.allExtraFields()) {
maybePopulateField(sdoc, field, type);
}
}
}
}
}

0 comments on commit c7d9572

Please sign in to comment.