<commit_before>package hudson.remoting;

/**
 * Request/response pattern over {@link Command}.
 *
 * This is layer 1.
 *
 * @author <NAME>
 * @see Request
 */
final class Response<RSP,EXC extends Throwable> extends Command {
    /**
     * ID of the {@link Request} for which
     */
    private final int id;

    final RSP returnValue;
    final EXC exception;

    Response(int id, RSP returnValue) {
        this.id = id;
        this.returnValue = returnValue;
        this.exception = null;
    }

    Response(int id, EXC exception) {
        this.id = id;
        this.returnValue = null;
        this.exception = exception;
    }

    /**
     * Notifies the waiting {@link Request}.
     */
    @Override
    protected void execute(Channel channel) {
        Request req = channel.pendingCalls.get(id);
        if(req==null)
            return; // maybe aborted
        req.onCompleted(this);
    }

    public String toString() {
        return "Response[retVal="+toString(returnValue)+",exception="+toString(exception)+"]";
    }

    private static String toString(Object o) {
        if(o==null) return "null";
        else        return o.toString();
    }
<commit_msg>fixed a horrible horrible memory leak.<commit_after>package hudson.remoting;

/**
 * Request/response pattern over {@link Command}.
 *
 * This is layer 1.
 *
 * @author <NAME>
 * @see Request
 */
final class Response<RSP,EXC extends Throwable> extends Command {
    /**
     * ID of the {@link Request} for which
     */
    private final int id;

    final RSP returnValue;
    final EXC exception;

    Response(int id, RSP returnValue) {
        this.id = id;
        this.returnValue = returnValue;
        this.exception = null;
    }

    Response(int id, EXC exception) {
        this.id = id;
        this.returnValue = null;
        this.exception = exception;
    }

    /**
     * Notifies the waiting {@link Request}.
     */
    @Override
    protected void execute(Channel channel) {
        Request req = channel.pendingCalls.get(id);
        if(req==null)
            return; // maybe aborted
        req.onCompleted(this);
        channel.pendingCalls.remove(id);
    }

    public String toString() {
        return "Response[retVal="+toString(returnValue)+",exception="+toString(exception)+"]";
    }

    private static String toString(Object o) {
        if(o==null) return "null";
        else        return o.toString();
    }

{'fraction_non_alphanumeric': 0.11832374691865243, 'fraction_numerical': 0.0008216926869350862, 'mean_word_length': 2.2816711590296497, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '5990773', 'n_tokens_mistral': 706, 'n_tokens_neox': 695, 'n_words': 192}