Program: 113335
Project: 113335
Buggy source:
@Override public void startRequest(MRCRequest rq) throws Throwable {
  final xtreemfs_get_file_credentialsRequest rqArgs=(xtreemfs_get_file_credentialsRequest)rq.getRequestArgs();
  final VolumeManager vMan=master.getVolumeManager();
  final FileAccessManager faMan=master.getFileAccessManager();
  validateContext(rq);
  GlobalFileIdResolver gfr=new GlobalFileIdResolver(rqArgs.getFileId());
  final String volId=gfr.getVolumeId();
  final Long localFileID=gfr.getLocalFileId();
  StorageManager sMan=vMan.getStorageManager(volId);
  VolumeInfo volume=sMan.getVolumeInfo();
  FileMetadata file=sMan.getMetadata(localFileID);
  if (file == null)   throw new UserException(POSIXErrno.POSIX_ERROR_ENOENT,"String_Node_Str" + rqArgs.getFileId() + "String_Node_Str");
  faMan.checkPrivilegedPermissions(sMan,file,rq.getDetails().userId,rq.getDetails().superUser,rq.getDetails().groupIds);
  boolean enableTracing=volume.isTracingEnabled();
  String traceTarget=volume.getTraceTarget();
  String tracingPolicy=volume.getTracingPolicy();
  Capability cap=new Capability(MRCHelper.createGlobalFileId(volume,file),FileAccessManager.O_RDONLY,master.getConfig().getCapabilityTimeout(),TimeSync.getGlobalTime() / 1000 + master.getConfig().getCapabilityTimeout(),((InetSocketAddress)rq.getRPCRequest().getSenderAddress()).getAddress().getHostAddress(),file.getEpoch(),false,!volume.isSnapshotsEnabled() ? SnapConfig.SNAP_CONFIG_SNAPS_DISABLED : volume.isSnapVolume() ? SnapConfig.SNAP_CONFIG_ACCESS_SNAP : SnapConfig.SNAP_CONFIG_ACCESS_CURRENT,volume.getCreationTime(),enableTracing,traceTarget,tracingPolicy,master.getConfig().getCapabilitySecret());
  XLocSet newXlocSet=null;
  if (file.isReadOnly()) {
    newXlocSet=Converter.xLocListToXLocSet(file.getXLocList()).setReadOnlyFileSize(file.getSize()).build();
  }
 else {
    newXlocSet=Converter.xLocListToXLocSet(file.getXLocList()).build();
  }
  FileCredentials fc=FileCredentials.newBuilder().setXcap(cap.getXCap()).setXlocs(newXlocSet).build();
  rq.setResponse(fc);
  finishRequest(rq);
}

Fixed version (ground truth):
@Override public void startRequest(MRCRequest rq) throws Throwable {
  final xtreemfs_get_file_credentialsRequest rqArgs=(xtreemfs_get_file_credentialsRequest)rq.getRequestArgs();
  final VolumeManager vMan=master.getVolumeManager();
  final FileAccessManager faMan=master.getFileAccessManager();
  validateContext(rq);
  GlobalFileIdResolver gfr=new GlobalFileIdResolver(rqArgs.getFileId());
  final String volId=gfr.getVolumeId();
  final Long localFileID=gfr.getLocalFileId();
  StorageManager sMan=vMan.getStorageManager(volId);
  VolumeInfo volume=sMan.getVolumeInfo();
  FileMetadata file=sMan.getMetadata(localFileID);
  if (file == null)   throw new UserException(POSIXErrno.POSIX_ERROR_ENOENT,"String_Node_Str" + rqArgs.getFileId() + "String_Node_Str");
  faMan.checkPrivilegedPermissions(sMan,file,rq.getDetails().userId,rq.getDetails().superUser,rq.getDetails().groupIds);
  boolean enableTracing=volume.isTracingEnabled();
  String traceTarget=volume.getTraceTarget();
  String tracingPolicy=volume.getTracingPolicy();
  Capability cap=new Capability(MRCHelper.createGlobalFileId(volume,file),FileAccessManager.O_RDONLY,master.getConfig().getCapabilityTimeout(),TimeSync.getGlobalTime() / 1000 + master.getConfig().getCapabilityTimeout(),((InetSocketAddress)rq.getRPCRequest().getSenderAddress()).getAddress().getHostAddress(),file.getEpoch(),false,!volume.isSnapshotsEnabled() ? SnapConfig.SNAP_CONFIG_SNAPS_DISABLED : volume.isSnapVolume() ? SnapConfig.SNAP_CONFIG_ACCESS_SNAP : SnapConfig.SNAP_CONFIG_ACCESS_CURRENT,volume.getCreationTime(),enableTracing,traceTarget,tracingPolicy,QuotaConstants.UNLIMITED_VOUCHER,0L,master.getConfig().getCapabilitySecret());
  XLocSet newXlocSet=null;
  if (file.isReadOnly()) {
    newXlocSet=Converter.xLocListToXLocSet(file.getXLocList()).setReadOnlyFileSize(file.getSize()).build();
  }
 else {
    newXlocSet=Converter.xLocListToXLocSet(file.getXLocList()).build();
  }
  FileCredentials fc=FileCredentials.newBuilder().setXcap(cap.getXCap()).setXlocs(newXlocSet).build();
  rq.setResponse(fc);
  finishRequest(rq);
}