<commit_before>package org.xcolab.utils;

import com.ext.portlet.model.ContestType;
import com.ext.portlet.service.ContestTypeLocalServiceUtil;
import com.liferay.portal.kernel.exception.PortalException;
import com.liferay.portal.kernel.exception.SystemException;

import org.xcolab.enums.ConfigurationAttributeKey;

import java.io.UnsupportedEncodingException;

public final class TemplateReplacementUtil {

    public final static String COLAB_NAME_PLACEHOLDER = "<colab-name/>";
    public final static String COLAB_SHORT_NAME_PLACEHOLDER = "<colab-short-name/>";
    public final static String COLAB_URL = "<colab-url/>";

    public final static String ADMIN_EMAIL_PLACEHOLDER = "<admin-email/>";
    public final static String ADMIN_FROM_EMAIL_PLACEHOLDER = "<admin-from-email/>";

    public final static String PROPOSAL_PLACEHOLDER = "<proposal/>";
    public final static String CONTEST_PLACEHOLDER = "<contest/>";
    public final static String PROPOSALS_PLACEHOLDER = "<proposals/>";
    public final static String CONTESTS_PLACEHOLDER = "<contests/>";

    private TemplateReplacementUtil() {
    }

    public static String replacePlatformConstants(String text) throws SystemException {
        final String colabName = ConfigurationAttributeKey.COLAB_NAME.getStringValue();
        final String colabShortName = ConfigurationAttributeKey.COLAB_SHORT_NAME.getStringValue();
        final String colabUrl = ConfigurationAttributeKey.COLAB_URL.getStringValue();
        final String adminEmail = ConfigurationAttributeKey.ADMIN_EMAIL.getStringValue();
        final String adminFromEmail = ConfigurationAttributeKey.ADMIN_FROM_EMAIL.getStringValue();

        return text.replaceAll(COLAB_NAME_PLACEHOLDER, colabName)
                .replaceAll(COLAB_SHORT_NAME_PLACEHOLDER, colabShortName)
                .replaceAll(COLAB_URL, colabUrl)
                .replaceAll(ADMIN_EMAIL_PLACEHOLDER, adminEmail)
                .replaceAll(ADMIN_FROM_EMAIL_PLACEHOLDER, adminFromEmail);<commit_msg>Small bugfix after merge<commit_after>package org.xcolab.utils;

import com.ext.portlet.model.ContestType;
import com.ext.portlet.service.ContestTypeLocalServiceUtil;
import com.liferay.portal.kernel.exception.PortalException;
import com.liferay.portal.kernel.exception.SystemException;

import org.xcolab.enums.ConfigurationAttributeKey;

import java.io.UnsupportedEncodingException;

import javax.mail.internet.InternetAddress;

public final class TemplateReplacementUtil {

    public final static String COLAB_NAME_PLACEHOLDER = "<colab-name/>";
    public final static String COLAB_SHORT_NAME_PLACEHOLDER = "<colab-short-name/>";
    public final static String COLAB_URL = "<colab-url/>";

    public final static String ADMIN_EMAIL_PLACEHOLDER = "<admin-email/>";
    public final static String ADMIN_FROM_EMAIL_PLACEHOLDER = "<admin-from-email/>";

    public final static String PROPOSAL_PLACEHOLDER = "<proposal/>";
    public final static String CONTEST_PLACEHOLDER = "<contest/>";
    public final static String PROPOSALS_PLACEHOLDER = "<proposals/>";
    public final static String CONTESTS_PLACEHOLDER = "<contests/>";

    private TemplateReplacementUtil() {
    }

    public static String replacePlatformConstants(String text) throws SystemException {
        final String colabName = ConfigurationAttributeKey.COLAB_NAME.getStringValue();
        final String colabShortName = ConfigurationAttributeKey.COLAB_SHORT_NAME.getStringValue();
        final String colabUrl = ConfigurationAttributeKey.COLAB_URL.getStringValue();
        final String adminEmail = ConfigurationAttributeKey.ADMIN_EMAIL.getStringValue();
        final String adminFromEmail = ConfigurationAttributeKey.ADMIN_FROM_EMAIL.getStringValue();

        return text.replaceAll(COLAB_NAME_PLACEHOLDER, colabName)
                .replaceAll(COLAB_SHORT_NAME_PLACEHOLDER, colabShortName)
                .replaceAll(COLAB_URL, colabUrl)
                .replaceAll(ADMIN_EMAIL_PLACEHOLDER, adminEmail)
                .replaceAll(ADMIN_FROM_EMAIL_PLACEHOLDER, adminFromEmail);
{'fraction_non_alphanumeric': 0.08173313638601674, 'fraction_numerical': 0.0, 'mean_word_length': 4.643055555555556, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 21, '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': '4270235', 'n_tokens_mistral': 1185, 'n_tokens_neox': 1165, 'n_words': 228}