<commit_before>package org.mg.javalib.util;

import java.text.MessageFormat;
import java.util.ResourceBundle;

public class ResourceBundleOwner
{
	private String resourceBundleName;

	private ResourceBundle bundle;

	public ResourceBundleOwner(String resourceBundleName)
	{
		this.resourceBundleName = resourceBundleName;
	}

	private ResourceBundle bundle()
	{
		if (bundle == null)
			bundle = ResourceBundle.getBundle(resourceBundleName);
		//		ResourceBundle.clearCache();
		//		bundle = ResourceBundle.getBundle(resourceBundleName);
		return bundle;
	}

	public String text(String key)
	{
		return bundle().getString(key);
	}

	public String text(String key, Object... params)
	{
		return MessageFormat.format(bundle().getString(key), params);
	}
}<commit_msg>add flag to reload bundle properties<commit_after>package org.mg.javalib.util;

import java.text.MessageFormat;
import java.util.ResourceBundle;

public class ResourceBundleOwner
{
	private String resourceBundleName;

	private boolean reload;

	private ResourceBundle bundle;

	public ResourceBundleOwner(String resourceBundleName)
	{
		this(resourceBundleName, false);
	}

	public ResourceBundleOwner(String resourceBundleName, boolean reload)
	{
		this.resourceBundleName = resourceBundleName;
		this.reload = reload;
	}

	private ResourceBundle bundle()
	{
		if (reload)
		{
			ResourceBundle.clearCache();
			return ResourceBundle.getBundle(resourceBundleName);
		}
		else
		{
			if (bundle == null)
				bundle = ResourceBundle.getBundle(resourceBundleName);
			return bundle;
		}
	}

	public String text(String key)
	{
		return bundle().getString(key);
	}

	public String text(String key, Object... params)
	{
		return MessageFormat.format(bundle().getString(key), params);
	}
}
{'fraction_non_alphanumeric': 0.09839816933638444, 'fraction_numerical': 0.0, 'mean_word_length': 4.928813559322034, 'pattern_counts': {'":': 0, '<': 3, '<?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': '414665', 'n_tokens_mistral': 554, 'n_tokens_neox': 505, 'n_words': 116}