<commit_before><commit_msg>Refs #1484/OFBIZ patch: renderer: targeted rendering: commit RenderDummyWriter needed for FTL boundary crossing (NOTE: guaranteed this is needed so committing, but so far have failed to make it work)<commit_after>package org.ofbiz.base.util.template;

import java.io.IOException;
import java.io.Writer;

/**
 * SCIPIO: A Writer that discards all output, specific for rendering purposes.
 * <p>
 * We use a rendering-specific class in case we need to handle or log this output
 * differently.
 */
public class RenderDummyWriter extends Writer {

    private static final RenderDummyWriter INSTANCE = new RenderDummyWriter();

    /**
     * Default constructor.
     * NOTE: Usually preferable to use {@link #getSharedInstance()}.
     */
    public RenderDummyWriter() {
    }

    /**
     * Default constructor.
     * NOTE: Usually preferable to use {@link #getSharedInstance()}.
     */
    public RenderDummyWriter(Object lock) {
        super(lock);
    }
    
    /**
     * Returns a singleton-like shared instance. Usually this is preferable
     * to creating new instances, but it is valid to create separate instances where needed
     * in case the instances is needed like a sort of ID.
     */
    public static RenderDummyWriter getSharedInstance() {
        return INSTANCE;
    }

    @Override
    public void write(char[] cbuf, int off, int len) throws IOException {
    }

    @Override
    public void flush() throws IOException {
    }

    @Override
    public void close() throws IOException {
    }

    @Override
    public void write(int c) throws IOException {
    }

    @Override
    public void write(char[] cbuf) throws IOException {
    }

    @Override
    public void write(String str) throws IOException {
    }

    @Override
    public void write(String str, int off, int len) throws IOException {
    }

    @Override
    public Writer append(CharSequence csq) throws IOException {
        return this;
    }

    @Override
    public Writer append(CharSequence csq, int start, int end) throws IOException {
        return this;
    }

    @Override
    public Writer append(char c) throws IOException {
        return this;
    }

}
{'fraction_non_alphanumeric': 0.07772727272727273, 'fraction_numerical': 0.0018181818181818182, 'mean_word_length': 2.827826086956522, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, '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': '6542297', 'n_tokens_mistral': 593, 'n_tokens_neox': 576, 'n_words': 224}