<commit_before>package com.atlassian.plugin.loaders;

import com.atlassian.core.util.ClassLoaderUtils;
import com.atlassian.plugin.ModuleDescriptor;
import com.atlassian.plugin.Plugin;
import com.atlassian.plugin.PluginParseException;
import com.atlassian.plugin.DefaultModuleDescriptorFactory;
import com.atlassian.plugin.descriptors.ResourcedModuleDescriptor;
import com.atlassian.plugin.mock.*;
import junit.framework.TestCase;

import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class TestClassPathPluginLoader extends TestCase
{
    public void testAtlassianPlugin() throws Exception
    {
        ClassPathPluginLoader loader = new ClassPathPluginLoader("test-atlassian-plugin.xml");
        DefaultModuleDescriptorFactory moduleDescriptorFactory = new DefaultModuleDescriptorFactory();
        moduleDescriptorFactory.addModuleDescriptor("animal", MockAnimalModuleDescriptor.class);
        moduleDescriptorFactory.addModuleDescriptor("mineral", MockMineralModuleDescriptor.class);
        Collection plugins = loader.getPlugins(moduleDescriptorFactory);

        assertEquals(2, plugins.size());

        Plugin plugin = (Plugin) plugins.iterator().next();
        assertEquals("Test Plugin", plugin.getName());
        assertEquals("test.atlassian.plugin", plugin.getKey());
        assertEquals("This plugin descriptor is just used for test purposes!", plugin.getPluginInformation().getDescription());
        assertEquals(2, plugin.getModuleDescriptors().size());

        assertEquals("Bear Animal", ((ResourcedModuleDescriptor) plugin.getModuleDescriptor("bear")).getName());

    }
}<commit_msg>the plugin was being found twice on the classpath<commit_after>package com.atlassian.plugin.loaders;

import com.atlassian.core.util.ClassLoaderUtils;
import com.atlassian.plugin.ModuleDescriptor;
import com.atlassian.plugin.Plugin;
import com.atlassian.plugin.PluginParseException;
import com.atlassian.plugin.DefaultModuleDescriptorFactory;
import com.atlassian.plugin.descriptors.ResourcedModuleDescriptor;
import com.atlassian.plugin.mock.*;
import junit.framework.TestCase;

import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class TestClassPathPluginLoader extends TestCase
{
    public void testAtlassianPlugin() throws Exception
    {
        ClassPathPluginLoader loader = new ClassPathPluginLoader("test-atlassian-plugin.xml");
        DefaultModuleDescriptorFactory moduleDescriptorFactory = new DefaultModuleDescriptorFactory();
        moduleDescriptorFactory.addModuleDescriptor("animal", MockAnimalModuleDescriptor.class);
        moduleDescriptorFactory.addModuleDescriptor("mineral", MockMineralModuleDescriptor.class);
        Collection plugins = loader.getPlugins(moduleDescriptorFactory);

        assertEquals(1, plugins.size());

        Plugin plugin = (Plugin) plugins.iterator().next();
        assertEquals("Test Plugin", plugin.getName());
        assertEquals("test.atlassian.plugin", plugin.getKey());
        assertEquals("This plugin descriptor is just used for test purposes!", plugin.getPluginInformation().getDescription());
        assertEquals(2, plugin.getModuleDescriptors().size());

        assertEquals("Bear Animal", ((ResourcedModuleDescriptor) plugin.getModuleDescriptor("bear")).getName());

    }
}
{'fraction_non_alphanumeric': 0.1021377672209026, 'fraction_numerical': 0.0011876484560570072, 'mean_word_length': 5.417142857142857, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, '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': '535323', 'n_tokens_mistral': 846, 'n_tokens_neox': 830, 'n_words': 164}