private static boolean changedType(StructDataType currentType, StructDataType nextType) {
            for (Field currentField : currentType.getFields()) {
                Field nextField = nextType.getField(currentField.getName());
                if (nextField != null) {
                    if (areStructFields(currentField, nextField)) {
                        if (changedType((StructDataType) currentField.getDataType(),
                                (StructDataType) nextField.getDataType())) {
                            return true;
                        }
                    } else {
                        if (!currentField.getDataType().equals(nextField.getDataType())) {
                            return true;
                        }
                    }
                }
            }
            return false;
        }
Validates the changes between a current and next document type used in a document database.

@author toregge
config-model/src/main/java/com/yahoo/vespa/model/application/validation/change/search/DocumentTypeChangeValidator.java