private void writeExternalBase(
            @NotNull Element element,
            @NotNull CommonCodeStyleSettings defaultSettings,
            @NotNull LanguageCodeStyleProvider provider
    ) {
        Set<String> supportedFields = provider.getSupportedFields();
        if (supportedFields != null) {
            supportedFields.add("FORCE_REARRANGE_MODE");
            supportedFields.add("CODE_STYLE_DEFAULTS");
        } else {
            return;
        }

        //noinspection deprecation
        DefaultJDOMExternalizer.write(this, element, new SupportedFieldsDiffFilter(this, supportedFields, defaultSettings));
        List<Integer> softMargins = getSoftMargins();
        serializeInto(softMargins, element);

        IndentOptions myIndentOptions = getIndentOptions();
        if (myIndentOptions != null) {
            IndentOptions defaultIndentOptions = defaultSettings.getIndentOptions();
            Element indentOptionsElement = new Element(INDENT_OPTIONS_TAG);
            myIndentOptions.serialize(indentOptionsElement, defaultIndentOptions);
            if (!indentOptionsElement.getChildren().isEmpty()) {
                element.addContent(indentOptionsElement);
            }
        }

        ArrangementSettings myArrangementSettings = getArrangementSettings();
        if (myArrangementSettings != null) {
            Element container = new Element(ARRANGEMENT_ELEMENT_NAME);
            ArrangementUtil.writeExternal(container, myArrangementSettings, provider.getLanguage());
            if (!container.getChildren().isEmpty()) {
                element.addContent(container);
            }
        }
    }
private void writeExternalBase(
            @NotNull Element element,
            @NotNull CommonCodeStyleSettings defaultSettings,
            @NotNull LanguageCodeStyleProvider provider
    )