<commit_before>package org.musetest.core.test.plugins;

import org.musetest.core.*;
import org.musetest.core.resource.*;
import org.musetest.core.test.plugin.*;
import org.musetest.core.values.*;

/**
 * @author <NAME> (see LICENSE.txt for license details)
 */
public class CompoundPlugin extends BaseTestPlugin
	{
	public CompoundPlugin(CompoundPluginConfiguration config)
		{
		super(config);
		}

	@Override
	public boolean addToContext(MuseExecutionContext context, boolean automatic) throws MuseExecutionError
		{
		if (automatic && !applyAutomatically(context))
			return false;

		if (!applyToThisTest(context))
			return false;

		MuseValueSource source = BaseValueSource.getValueSource(_configuration.parameters(), CompoundPluginConfiguration.LISTS_PARAM, true, context.getProject());
		String id_list_param = BaseValueSource.getValue(source, context, false, String.class);
		String[] id_list = id_list_param.split(",");

		for (String id : id_list)
			{
			final ResourceToken resource = context.getProject().getResourceStorage().findResource(id);
			if (resource.getResource() instanceof TestPluginConfiguration)
				((TestPluginConfiguration)resource.getResource()).createPlugin().addToContext(context, false);
			}
		return true;
		}

	@Override
	public void initialize(MuseExecutionContext context)
		{
		}
	}
<commit_msg>Enhance CompoundPlugin to accept the list of plugin ids as a single string, a list of strings or a comma-separated list in a string.<commit_after>package org.musetest.core.test.plugins;

import org.musetest.core.*;
import org.musetest.core.resource.*;
import org.musetest.core.test.plugin.*;
import org.musetest.core.values.*;

import java.util.*;

/**
 * @author <NAME> (see LICENSE.txt for license details)
 */
public class CompoundPlugin extends BaseTestPlugin
	{
	public CompoundPlugin(CompoundPluginConfiguration config)
		{
		super(config);
		}

	@Override
	public boolean addToContext(MuseExecutionContext context, boolean automatic) throws MuseExecutionError
		{
		if (automatic && !applyAutomatically(context))
			return false;

		if (!applyToThisTest(context))
			return false;

		MuseValueSource source = BaseValueSource.getValueSource(_configuration.parameters(), CompoundPluginConfiguration.LISTS_PARAM, true, context.getProject());
		Object id_list_obj = BaseValueSource.getValue(source, context, false);
		String[] id_list;
		if (id_list_obj instanceof List)
			{
			final List<String> list = (List) id_list_obj;
			id_list = new String[list.size()];
			for (int i = 0; i < list.size(); i++)
				id_list[i] = ((List) id_list_obj).get(i).toString();
			}
		else if (id_list_obj.toString().contains(","))
			{
			String id_list_param = BaseValueSource.getValue(source, context, false, String.class);
			id_list = id_list_param.split(",");
			}
		else
			{
			id_list = new String[1];
			id_list[0] = id_list_obj.toString();
			}

		for (String id : id_list)
			{
			final ResourceToken resource = context.getProject().getResourceStorage().findResource(id);
			if (resource.getResource() instanceof TestPluginConfiguration)
				((TestPluginConfiguration)resource.getResource()).createPlugin().addToContext(context, false);
			}
		return true;
		}

	@Override
	public void initialize(MuseExecutionContext context)
		{
		}
	}

{'fraction_non_alphanumeric': 0.11644254278728607, 'fraction_numerical': 0.0009168704156479218, 'mean_word_length': 5.027624309392265, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 6, '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': '2277479', 'n_tokens_mistral': 1072, 'n_tokens_neox': 966, 'n_words': 222}