<commit_before>package com.itmill.toolkit.demo.sampler;

import com.itmill.toolkit.ui.Label;

public class CodeLabel extends Label {

    private static final String TAG = "codelabel";

    public CodeLabel() {
        super.setContentMode(CONTENT_PREFORMATTED);
    }

    public CodeLabel(String content) {
        super(content, CONTENT_PREFORMATTED);
    }

    @Override
    public String getTag() {
        return TAG;
    }

    @Override
    public void setContentMode(int contentMode) {
        if (contentMode != Label.CONTENT_PREFORMATTED) {
            throw new UnsupportedOperationException(
                    "Only preformatted content supported");
        }
    }

}<commit_msg>Fixed: In some cases a less-than sign would break the label.<commit_after>package com.itmill.toolkit.demo.sampler;

import com.itmill.toolkit.ui.Label;

public class CodeLabel extends Label {

    private static final String TAG = "codelabel";

    public CodeLabel() {
        super.setContentMode(CONTENT_PREFORMATTED);
    }

    public CodeLabel(String content) {
        super(content, CONTENT_PREFORMATTED);
    }

    @Override
    public String getTag() {
        return TAG;
    }

    @Override
    public void setContentMode(int contentMode) {
        if (contentMode != Label.CONTENT_PREFORMATTED) {
            throw new UnsupportedOperationException(
                    "Only preformatted content supported");
        }
    }

    public String toString() {
        // escape, seems to choke otherwise
        String val = super.toString();
        if (null != val) {
            return val.replaceAll("<", "&lt;");
        } else {
            return null;
        }
    }

}
{'fraction_non_alphanumeric': 0.09010077059869591, 'fraction_numerical': 0.0, 'mean_word_length': 2.3692614770459084, 'pattern_counts': {'":': 0, '<': 4, '<?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': '1080165', 'n_tokens_mistral': 488, 'n_tokens_neox': 467, 'n_words': 118}