<commit_before>package liqp.tags;

import liqp.Template;
import liqp.nodes.LNode;

import java.io.File;
import java.util.Map;

class Include extends Tag {

    public static File snippetsFolder = new File("snippets");
    public static String extension = ".liquid";

    /*
     * temporarily disable tag processing to avoid syntax conflicts.
     */
    @Override
    public Object render(Map<String, Object> context, LNode... nodes) {

        try {
            String fileNameWithoutExt = String.valueOf(nodes[0].render(context));

            Template include = Template.parse(new File(snippetsFolder, fileNameWithoutExt + extension));

            // check if there's a optional "with expression"
            if(nodes.length > 1) {
                Object value = nodes[1].render(context);
                context.put(fileNameWithoutExt, value);
            }

            return include.render(context);

        } catch(Exception e) {
            return "";
        }
    }
}<commit_msg>Changes String.valueOf(...) to a more safer super.asString(...)<commit_after>package liqp.tags;

import liqp.Template;
import liqp.nodes.LNode;

import java.io.File;
import java.util.Map;

class Include extends Tag {

    public static File snippetsFolder = new File("snippets");
    public static String extension = ".liquid";

    @Override
    public Object render(Map<String, Object> context, LNode... nodes) {

        try {
            String fileNameWithoutExt = super.asString(nodes[0].render(context));

            Template include = Template.parse(new File(snippetsFolder, fileNameWithoutExt + extension));

            // check if there's a optional "with expression"
            if(nodes.length > 1) {
                Object value = nodes[1].render(context);
                context.put(fileNameWithoutExt, value);
            }

            return include.render(context);

        } catch(Exception e) {
            return "";
        }
    }
}
{'fraction_non_alphanumeric': 0.10758196721311475, 'fraction_numerical': 0.0030737704918032786, 'mean_word_length': 2.3384615384615386, 'pattern_counts': {'":': 0, '<': 5, '<?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': '7368346', 'n_tokens_mistral': 533, 'n_tokens_neox': 503, 'n_words': 138}