Program: 6216
Project: 6216
Buggy source:
@Test public void testPlugin() throws Exception {
  File pluginDir=DirUtils.createTempDir(tmpDir);
  Manifest manifest=createManifest(ManifestFields.EXPORT_PACKAGE,TestPlugin.class.getPackage().getName());
  File jarFile=createPluginJar(TestPlugin.class,new File(tmpDir,"String_Node_Str"),manifest);
  Set<ArtifactRange> parents=ImmutableSet.of(new ArtifactRange(APP_ARTIFACT_ID.getNamespace(),APP_ARTIFACT_ID.getName(),new ArtifactVersion("String_Node_Str"),new ArtifactVersion("String_Node_Str")));
  Id.Artifact artifactId=Id.Artifact.from(Id.Namespace.DEFAULT,"String_Node_Str","String_Node_Str");
  artifactRepository.addArtifact(artifactId,jarFile,parents);
  SortedMap<ArtifactDescriptor,List<PluginClass>> plugins=artifactRepository.getPlugins(NamespaceId.DEFAULT,APP_ARTIFACT_ID);
  Assert.assertEquals(1,plugins.size());
  Assert.assertEquals(2,plugins.get(plugins.firstKey()).size());
  ArtifactDescriptor descriptor=plugins.firstKey();
  Files.copy(Locations.newInputSupplier(descriptor.getLocation()),new File(pluginDir,Artifacts.getFileName(descriptor.getArtifactId())));
  try (PluginInstantiator instantiator=new PluginInstantiator(cConf,appClassLoader,pluginDir)){
    for (    Map.Entry<ArtifactDescriptor,List<PluginClass>> entry : plugins.entrySet()) {
      for (      PluginClass pluginClass : entry.getValue()) {
        Plugin pluginInfo=new Plugin(entry.getKey().getArtifactId(),pluginClass,PluginProperties.builder().add("String_Node_Str",TEST_EMPTY_CLASS).add("String_Node_Str","String_Node_Str").build());
        Callable<String> plugin=instantiator.newInstance(pluginInfo);
        Assert.assertEquals(TEST_EMPTY_CLASS,plugin.call());
      }
    }
  }
 }

Fixed version (ground truth):
@Test public void testPlugin() throws Exception {
  File pluginDir=DirUtils.createTempDir(tmpDir);
  Manifest manifest=createManifest(ManifestFields.EXPORT_PACKAGE,TestPlugin.class.getPackage().getName());
  File jarFile=createPluginJar(TestPlugin.class,new File(tmpDir,"String_Node_Str"),manifest);
  Set<ArtifactRange> parents=ImmutableSet.of(new ArtifactRange(APP_ARTIFACT_ID.getNamespace(),APP_ARTIFACT_ID.getName(),new ArtifactVersion("String_Node_Str"),new ArtifactVersion("String_Node_Str")));
  Id.Artifact artifactId=Id.Artifact.from(Id.Namespace.DEFAULT,"String_Node_Str","String_Node_Str");
  artifactRepository.addArtifact(artifactId,jarFile,parents);
  SortedMap<ArtifactDescriptor,Set<PluginClass>> plugins=artifactRepository.getPlugins(NamespaceId.DEFAULT,APP_ARTIFACT_ID);
  Assert.assertEquals(1,plugins.size());
  Assert.assertEquals(2,plugins.get(plugins.firstKey()).size());
  ArtifactDescriptor descriptor=plugins.firstKey();
  Files.copy(Locations.newInputSupplier(descriptor.getLocation()),new File(pluginDir,Artifacts.getFileName(descriptor.getArtifactId())));
  try (PluginInstantiator instantiator=new PluginInstantiator(cConf,appClassLoader,pluginDir)){
    for (    Map.Entry<ArtifactDescriptor,Set<PluginClass>> entry : plugins.entrySet()) {
      for (      PluginClass pluginClass : entry.getValue()) {
        Plugin pluginInfo=new Plugin(entry.getKey().getArtifactId(),pluginClass,PluginProperties.builder().add("String_Node_Str",TEST_EMPTY_CLASS).add("String_Node_Str","String_Node_Str").build());
        Callable<String> plugin=instantiator.newInstance(pluginInfo);
        Assert.assertEquals(TEST_EMPTY_CLASS,plugin.call());
      }
    }
  }
 }