<commit_before>package jenkins.plugins.http_request;

import java.io.IOException;
import java.io.Serializable;

import org.apache.http.HttpResponse;
import org.apache.http.HttpEntity;
import org.apache.http.util.EntityUtils;

import org.jenkinsci.plugins.scriptsecurity.sandbox.whitelists.Whitelisted;

/**
 * A container for the Http Response.
 * The container is returned as is to the Pipeline. For the normal
 * plugin, the container is consumed internally (since it cannot be returned).
 */
class ResponseContentSupplier implements Serializable {

    private static final long serialVersionUID = 1L;

    private transient HttpResponse response;
    private String content;
    private int status;

    public ResponseContentSupplier(HttpResponse response) {
        this.response = response;
        this.status = response.getStatusLine().getStatusCode();
        this.content = getContent();
    }

    @Whitelisted
    public int getStatus() {
        return status;
    }

    @Whitelisted
    public String getContent() {
        if (content != null) {
            return content;
        }
        try {
            HttpEntity entity = response.getEntity();
            if (entity == null) {
                return null;
            }
            content = EntityUtils.toString(entity);
            EntityUtils.consume(response.getEntity());
            return content;
        } catch (IOException e) {
            return null;
        }
    }

    @Override
    public String toString() {
        return "Status: "+status+", Response: "+content;
    }
}
<commit_msg>Remove HttpResponse member from ResponseContentSupplier<commit_after>package jenkins.plugins.http_request;

import java.io.IOException;
import java.io.Serializable;

import org.apache.http.HttpResponse;
import org.apache.http.HttpEntity;
import org.apache.http.util.EntityUtils;

import org.jenkinsci.plugins.scriptsecurity.sandbox.whitelists.Whitelisted;

/**
 * A container for the Http Response.
 * The container is returned as is to the Pipeline. For the normal
 * plugin, the container is consumed internally (since it cannot be returned).
 */
class ResponseContentSupplier implements Serializable {

    private static final long serialVersionUID = 1L;

    private String content;
    private int status;

    public ResponseContentSupplier(HttpResponse response) {
        this.status = response.getStatusLine().getStatusCode();
        setContent(response);
    }

    @Whitelisted
    public int getStatus() {
        return status;
    }

    @Whitelisted
    public String getContent() {
        return content;
    }

    private void setContent(HttpResponse response) {
        try {
            HttpEntity entity = response.getEntity();
            if (entity == null) {
                return;
            }
            content = EntityUtils.toString(entity);
            EntityUtils.consume(response.getEntity());
        } catch (IOException e) {
            content = "IOException while reading HttpResponse: "+e.getMessage();
        }
    }

    @Override
    public String toString() {
        return "Status: "+status+", Response: "+content;
    }
}

{'fraction_non_alphanumeric': 0.08851522842639593, 'fraction_numerical': 0.0006345177664974619, 'mean_word_length': 2.674825174825175, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6037033', 'n_tokens_mistral': 825, 'n_tokens_neox': 805, 'n_words': 231}