src/main/java/org/apache/sling/api/request/builder/impl/SlingHttpServletResponseResultImpl.java [77:132]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        this.reset();
    }

    private void checkCommitted() {
        if (isCommitted()) {
            throw new IllegalStateException("Response already committed.");
        }
    }

    @Override
    public String getCharacterEncoding() {
        return this.characterEncoding;
    }

    @Override
    public void setCharacterEncoding(final String encoding) {
        this.characterEncoding = encoding;
    }

    @Override
    public String getContentType() {
        if (this.contentType == null) {
            return null;
        } else if (this.characterEncoding == null) {
            return this.contentType;
        }
        return this.contentType
                .concat(SlingHttpServletRequestBuilderImpl.CHARSET_SEPARATOR)
                .concat(this.characterEncoding);
    }

    @Override
    public void setContentType(final String type) {
        if (this.printWriter == null) {
            final int pos = type == null ? -1 : type.indexOf(SlingHttpServletRequestBuilderImpl.CHARSET_SEPARATOR);
            if (pos != -1) {
                this.contentType = type.substring(0, pos);
                this.characterEncoding =
                        type.substring(pos + SlingHttpServletRequestBuilderImpl.CHARSET_SEPARATOR.length());
            } else {
                this.contentType = type;
            }
        }
    }

    @Override
    public void setContentLength(final int len) {
        this.contentLength = len;
    }

    @Override
    public void setContentLengthLong(final long len) {
        this.contentLength = len;
    }

    @Override
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



src/main/java/org/apache/sling/api/request/builder/impl/SlingJakartaHttpServletResponseResultImpl.java [75:130]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        this.reset();
    }

    private void checkCommitted() {
        if (isCommitted()) {
            throw new IllegalStateException("Response already committed.");
        }
    }

    @Override
    public String getCharacterEncoding() {
        return this.characterEncoding;
    }

    @Override
    public void setCharacterEncoding(final String encoding) {
        this.characterEncoding = encoding;
    }

    @Override
    public String getContentType() {
        if (this.contentType == null) {
            return null;
        } else if (this.characterEncoding == null) {
            return this.contentType;
        }
        return this.contentType
                .concat(SlingHttpServletRequestBuilderImpl.CHARSET_SEPARATOR)
                .concat(this.characterEncoding);
    }

    @Override
    public void setContentType(final String type) {
        if (this.printWriter == null) {
            final int pos = type == null ? -1 : type.indexOf(SlingHttpServletRequestBuilderImpl.CHARSET_SEPARATOR);
            if (pos != -1) {
                this.contentType = type.substring(0, pos);
                this.characterEncoding =
                        type.substring(pos + SlingHttpServletRequestBuilderImpl.CHARSET_SEPARATOR.length());
            } else {
                this.contentType = type;
            }
        }
    }

    @Override
    public void setContentLength(final int len) {
        this.contentLength = len;
    }

    @Override
    public void setContentLengthLong(final long len) {
        this.contentLength = len;
    }

    @Override
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



