public QueryProfileType unfrozen() {
        if ( ! isFrozen()) return this;

        // Unfreeze inherited query profile references
        List<QueryProfileType> unfrozenInherited = new ArrayList<>();
        for (QueryProfileType inheritedType : inherited) {
            unfrozenInherited.add(inheritedType.unfrozen());
        }

        // Unfreeze nested query profile references
        Map<String, FieldDescription> unfrozenFields = new LinkedHashMap<>();
        for (Map.Entry<String, FieldDescription> field : fields.entrySet()) {
            FieldDescription unfrozenFieldValue = field.getValue();
            if (field.getValue().getType() instanceof QueryProfileFieldType queryProfileFieldType) {
                if (queryProfileFieldType.getQueryProfileType() != null) {
                    QueryProfileFieldType unfrozenType =
                            new QueryProfileFieldType(queryProfileFieldType.getQueryProfileType().unfrozen());
                    unfrozenFieldValue = field.getValue().withType(unfrozenType);
                }
            }
            unfrozenFields.put(field.getKey(), unfrozenFieldValue);
        }

        return new QueryProfileType(getId(), unfrozenFields, unfrozenInherited, strict, matchAsPath, builtin, aliases);
    }
Return this is it is not frozen, returns a modifiable deeply unfrozen copy otherwise
container-search/src/main/java/com/yahoo/search/query/profile/types/QueryProfileType.java