<commit_before>package com.wizzardo.tools.collections.flow.flows;


import com.wizzardo.tools.collections.flow.Supplier;

/**
 * Created by wizzardo on 16.04.16.
 */
public class FlowOr<A> extends FlowProcessOnEnd<A, A> {

    protected boolean processed = false;

    public FlowOr(A def) {
        result = def;
    }

    public FlowOr(Supplier<A> supplier) {
        this.supplier = supplier;
    }

    @Override
    public void process(A a) {
        processed = true;
        child.process(a);
    }

    @Override
    protected void onEnd() {
        if (!processed)
            super.onEnd();
        else
            onEnd(child);
    }
}<commit_msg>minor improvement<commit_after>package com.wizzardo.tools.collections.flow.flows;


import com.wizzardo.tools.collections.flow.Supplier;

/**
 * Created by wizzardo on 16.04.16.
 */
public class FlowOr<A> extends FlowProcessOnEnd<A, A> {

    protected boolean processed = false;

    public FlowOr(A def) {
        result = def;
    }

    public FlowOr(Supplier<A> supplier) {
        this.supplier = supplier;
    }

    @Override
    public void process(A a) {
        processed = true;
        child.process(a);
    }

    @Override
    protected void onEnd() {
        if (!processed)
            super.onEnd();
        else
            onEnd(child);
    }

    @Override
    public A get() {
        throw new IllegalStateException("Should not be called directly on " + FlowOr.class.getSimpleName());
    }
}
{'fraction_non_alphanumeric': 0.11050847457627119, 'fraction_numerical': 0.008135593220338983, 'mean_word_length': 2.251101321585903, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '3408063', 'n_tokens_mistral': 477, 'n_tokens_neox': 451, 'n_words': 106}