Program: 20698
Project: 20698
Buggy source:
public void testGetMergedMetadata() throws Exception {
  String resourceName="String_Node_Str";
  File dummyInternalResourceFile=new File(repoRootFirst,resourceName);
  dummyInternalResourceFile.getParentFile().mkdirs();
  FileUtils.writeStringToFile(dummyInternalResourceFile,"String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str",null);
  resourceName="String_Node_Str";
  dummyInternalResourceFile=new File(repoRootLast,resourceName);
  dummyInternalResourceFile.getParentFile().mkdirs();
  FileUtils.writeStringToFile(dummyInternalResourceFile,"String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str",null);
  WebRequest request=new GetMethodWebRequest("String_Node_Str" + REPO_GROUP_WITH_VALID_REPOS + "String_Node_Str"+ "String_Node_Str");
  WebResponse response=sc.getResource(request);
  File returnedMetadata=new File("String_Node_Str");
  FileUtils.writeStringToFile(returnedMetadata,response.getText());
  ArchivaRepositoryMetadata metadata=RepositoryMetadataReader.read(returnedMetadata);
  assertResponseOK(response);
  assertEquals("String_Node_Str",4,metadata.getAvailableVersions().size());
  assertTrue("String_Node_Str",metadata.getAvailableVersions().contains("String_Node_Str"));
  assertTrue("String_Node_Str",metadata.getAvailableVersions().contains("String_Node_Str"));
  assertTrue("String_Node_Str",metadata.getAvailableVersions().contains("String_Node_Str"));
  assertTrue("String_Node_Str",metadata.getAvailableVersions().contains("String_Node_Str"));
  File checksumFileSha1=new File(repoRootFirst,resourceName + "String_Node_Str");
  checksumFileSha1.getParentFile().mkdirs();
  FileUtils.writeStringToFile(checksumFileSha1,"String_Node_Str",null);
  File checksumFileMd5=new File(repoRootFirst,resourceName + "String_Node_Str");
  checksumFileMd5.getParentFile().mkdirs();
  FileUtils.writeStringToFile(checksumFileMd5,"String_Node_Str",null);
  request=new GetMethodWebRequest("String_Node_Str" + REPO_GROUP_WITH_VALID_REPOS + "String_Node_Str"+ "String_Node_Str");
  response=sc.getResource(request);
  assertResponseOK(response);
  assertEquals("String_Node_Str",response.getText());
  request=new GetMethodWebRequest("String_Node_Str" + REPO_GROUP_WITH_VALID_REPOS + "String_Node_Str"+ "String_Node_Str");
  response=sc.getResource(request);
  assertResponseOK(response);
  assertEquals("String_Node_Str",response.getText().trim());
}

Fixed version (ground truth):
@Test public void testGetMergedMetadata() throws Exception {
  String resourceName="String_Node_Str";
  File dummyInternalResourceFile=new File(repoRootFirst,resourceName);
  dummyInternalResourceFile.getParentFile().mkdirs();
  FileUtils.writeStringToFile(dummyInternalResourceFile,"String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str",null);
  resourceName="String_Node_Str";
  dummyInternalResourceFile=new File(repoRootLast,resourceName);
  dummyInternalResourceFile.getParentFile().mkdirs();
  FileUtils.writeStringToFile(dummyInternalResourceFile,"String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str",null);
  WebRequest request=new GetMethodWebRequest("String_Node_Str" + REPO_GROUP_WITH_VALID_REPOS + "String_Node_Str"+ "String_Node_Str");
  WebResponse response=sc.getResource(request);
  File returnedMetadata=new File("String_Node_Str");
  FileUtils.writeStringToFile(returnedMetadata,response.getText());
  ArchivaRepositoryMetadata metadata=RepositoryMetadataReader.read(returnedMetadata);
  assertResponseOK(response);
  assertEquals("String_Node_Str",4,metadata.getAvailableVersions().size());
  assertTrue("String_Node_Str",metadata.getAvailableVersions().contains("String_Node_Str"));
  assertTrue("String_Node_Str",metadata.getAvailableVersions().contains("String_Node_Str"));
  assertTrue("String_Node_Str",metadata.getAvailableVersions().contains("String_Node_Str"));
  assertTrue("String_Node_Str",metadata.getAvailableVersions().contains("String_Node_Str"));
  File checksumFileSha1=new File(repoRootFirst,resourceName + "String_Node_Str");
  checksumFileSha1.getParentFile().mkdirs();
  FileUtils.writeStringToFile(checksumFileSha1,"String_Node_Str",null);
  File checksumFileMd5=new File(repoRootFirst,resourceName + "String_Node_Str");
  checksumFileMd5.getParentFile().mkdirs();
  FileUtils.writeStringToFile(checksumFileMd5,"String_Node_Str",null);
  request=new GetMethodWebRequest("String_Node_Str" + REPO_GROUP_WITH_VALID_REPOS + "String_Node_Str"+ "String_Node_Str");
  response=sc.getResource(request);
  assertResponseOK(response);
  assertEquals("String_Node_Str",response.getText());
  request=new GetMethodWebRequest("String_Node_Str" + REPO_GROUP_WITH_VALID_REPOS + "String_Node_Str"+ "String_Node_Str");
  response=sc.getResource(request);
  assertResponseOK(response);
  assertEquals("String_Node_Str",response.getText().trim());
}