Program: 113411
Project: 113411
Buggy source:
@Test public void testROnlyReplicatedFileWithWrongChecksum() throws Exception {
  final String VOLUME_NAME="String_Node_Str";
  final String FILE_NAME="String_Node_Str";
  client.createVolume(mrc1Address.getHostName() + "String_Node_Str" + mrc1Address.getPort(),RPCAuthentication.authNone,userCredentials,VOLUME_NAME);
  AdminVolume volume=client.openVolume(VOLUME_NAME,null,new Options());
  volume.start();
  int replicationFlags=ReplicationFlags.setRarestFirstStrategy(0);
  replicationFlags=ReplicationFlags.setFullReplica(replicationFlags);
  volume.setDefaultReplicationPolicy(userCredentials,"String_Node_Str",ReplicaUpdatePolicies.REPL_UPDATE_PC_RONLY,3,replicationFlags);
  AdminFileHandle file=volume.openFile(userCredentials,FILE_NAME,SYSTEM_V_FCNTL.SYSTEM_V_FCNTL_H_O_CREAT.getNumber() | SYSTEM_V_FCNTL.SYSTEM_V_FCNTL_H_O_RDWR.getNumber(),accessMode);
  int contentSize=file.getStripingPolicy().getStripeSize() * 1024;
  file.write(userCredentials,content,contentSize,0);
  file.close();
  file=volume.openFile(userCredentials,FILE_NAME,SYSTEM_V_FCNTL.SYSTEM_V_FCNTL_H_O_RDONLY.getNumber());
  Thread.sleep(5000);
  File objFile=openObjectFile(file,1,0);
  FileWriter fw=new FileWriter(objFile,false);
  fw.write("String_Node_Str");
  fw.close();
  xtfs_scrub scrubber=new xtfs_scrub(client,volume,3,true,true,true);
  scrubber.scrub();
  Thread.sleep(5000);
  objFile=openObjectFile(file,1,0);
  assertEquals(contentSize,objFile.length());
  client.deleteVolume(mrc1Address.getHostName() + "String_Node_Str" + mrc1Address.getPort(),RPCAuthentication.authNone,userCredentials,VOLUME_NAME);
}

Fixed version (ground truth):
@Test public void testROnlyReplicatedFileWithWrongChecksum() throws Exception {
  final String VOLUME_NAME="String_Node_Str";
  final String FILE_NAME="String_Node_Str";
  client.createVolume(mrc1Address.getHostName() + "String_Node_Str" + mrc1Address.getPort(),RPCAuthentication.authNone,userCredentials,VOLUME_NAME);
  AdminVolume volume=client.openVolume(VOLUME_NAME,null,new Options());
  volume.start();
  int replicationFlags=ReplicationFlags.setRarestFirstStrategy(0);
  replicationFlags=ReplicationFlags.setFullReplica(replicationFlags);
  volume.setDefaultReplicationPolicy(userCredentials,"String_Node_Str",ReplicaUpdatePolicies.REPL_UPDATE_PC_RONLY,3,replicationFlags);
  AdminFileHandle file=volume.openFile(userCredentials,FILE_NAME,SYSTEM_V_FCNTL.SYSTEM_V_FCNTL_H_O_CREAT.getNumber() | SYSTEM_V_FCNTL.SYSTEM_V_FCNTL_H_O_RDWR.getNumber(),accessMode);
  int contentSize=file.getStripingPolicy().getStripeSize() * 1024;
  file.write(userCredentials,content,contentSize,0);
  file.close();
  file=volume.openFile(userCredentials,FILE_NAME,SYSTEM_V_FCNTL.SYSTEM_V_FCNTL_H_O_RDONLY.getNumber());
  Thread.sleep(5000);
  File objFile=openObjectFile(file,1,0);
  FileWriter fw=new FileWriter(objFile,false);
  fw.write("String_Node_Str");
  fw.close();
  xtfs_scrub scrubber=new xtfs_scrub(client,volume,3,true,true,true);
  scrubber.scrub();
  Thread.sleep(5000);
  objFile=openObjectFile(file,1,0);
  assertEquals(contentSize,objFile.length());
  file.close();
  client.deleteVolume(mrc1Address.getHostName() + "String_Node_Str" + mrc1Address.getPort(),RPCAuthentication.authNone,userCredentials,VOLUME_NAME);
}