<commit_before>package org.ovirt.engine.ui.common.widget.renderer;

import com.google.gwt.text.shared.AbstractRenderer;

public class BooleanRenderer extends AbstractRenderer<Boolean> {

    String trueText;
    String falseText;

    public BooleanRenderer() {
        super();
    }

    public BooleanRenderer(String trueText, String falseText) {
        this.trueText = trueText;
        this.falseText = falseText;
    }

    @Override
    public String render(Boolean bool) {
        if (trueText == null || falseText == null) {
            return bool.toString();
        }

        return bool != null && bool.booleanValue() ? trueText : falseText;
    }

}<commit_msg>webadmin: fix possible null exception in BooleanRenderer<commit_after>package org.ovirt.engine.ui.common.widget.renderer;

import com.google.gwt.text.shared.AbstractRenderer;

public class BooleanRenderer extends AbstractRenderer<Boolean> {

    String trueText;
    String falseText;

    public BooleanRenderer() {
        super();
    }

    public BooleanRenderer(String trueText, String falseText) {
        this.trueText = trueText;
        this.falseText = falseText;
    }

    @Override
    public String render(Boolean valueToRender) {
        if (valueToRender == null) {
            return "";
        }

        if (trueText == null || falseText == null) {
            return valueToRender.toString();
        }

        return valueToRender.booleanValue() ? trueText : falseText;
    }

}
{'fraction_non_alphanumeric': 0.0973630831643002, 'fraction_numerical': 0.0, 'mean_word_length': 2.7, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '6027778', 'n_tokens_mistral': 405, 'n_tokens_neox': 394, 'n_words': 94}