Program: 105201
Project: 105201
Buggy source:
@Override public SnapshotResponse createSnapshotResponse(Snapshot snapshot){
  SnapshotResponse snapshotResponse=new SnapshotResponse();
  snapshotResponse.setId(snapshot.getUuid());
  populateOwner(snapshotResponse,snapshot);
  VolumeVO volume=findVolumeById(snapshot.getVolumeId());
  String snapshotTypeStr=snapshot.getRecurringType().name();
  snapshotResponse.setSnapshotType(snapshotTypeStr);
  if (volume != null) {
    snapshotResponse.setVolumeId(volume.getUuid());
    snapshotResponse.setVolumeName(volume.getName());
    snapshotResponse.setVolumeType(volume.getVolumeType().name());
    DataCenter zone=ApiDBUtils.findZoneById(volume.getDataCenterId());
    if (zone != null) {
      snapshotResponse.setZoneId(zone.getUuid());
    }
  }
  snapshotResponse.setCreated(snapshot.getCreated());
  snapshotResponse.setName(snapshot.getName());
  snapshotResponse.setIntervalType(ApiDBUtils.getSnapshotIntervalTypes(snapshot.getId()));
  snapshotResponse.setState(snapshot.getState());
  SnapshotInfo snapshotInfo=null;
  if (snapshot instanceof SnapshotInfo) {
    snapshotInfo=(SnapshotInfo)snapshot;
  }
 else {
    DataStoreRole dataStoreRole=getDataStoreRole(snapshot,_snapshotStoreDao,_dataStoreMgr);
    snapshotInfo=snapshotfactory.getSnapshot(snapshot.getId(),dataStoreRole);
  }
  if (snapshotInfo == null) {
    s_logger.debug("String_Node_Str" + snapshot.getUuid());
    snapshotResponse.setRevertable(false);
  }
 else {
    snapshotResponse.setRevertable(snapshotInfo.isRevertable());
    snapshotResponse.setPhysicaSize(snapshotInfo.getPhysicalSize());
  }
  List<? extends ResourceTag> tags=ApiDBUtils.listByResourceTypeAndId(ResourceObjectType.Snapshot,snapshot.getId());
  List<ResourceTagResponse> tagResponses=new ArrayList<ResourceTagResponse>();
  for (  ResourceTag tag : tags) {
    ResourceTagResponse tagResponse=createResourceTagResponse(tag,true);
    tagResponses.add(tagResponse);
  }
  snapshotResponse.setTags(tagResponses);
  snapshotResponse.setObjectName("String_Node_Str");
  return snapshotResponse;
}

Fixed version (ground truth):
@Override public SnapshotResponse createSnapshotResponse(Snapshot snapshot){
  SnapshotResponse snapshotResponse=new SnapshotResponse();
  snapshotResponse.setId(snapshot.getUuid());
  populateOwner(snapshotResponse,snapshot);
  VolumeVO volume=findVolumeById(snapshot.getVolumeId());
  String snapshotTypeStr=snapshot.getRecurringType().name();
  snapshotResponse.setSnapshotType(snapshotTypeStr);
  if (volume != null) {
    snapshotResponse.setVolumeId(volume.getUuid());
    snapshotResponse.setVolumeName(volume.getName());
    snapshotResponse.setVolumeType(volume.getVolumeType().name());
    DataCenter zone=ApiDBUtils.findZoneById(volume.getDataCenterId());
    if (zone != null) {
      snapshotResponse.setZoneId(zone.getUuid());
    }
  }
  snapshotResponse.setCreated(snapshot.getCreated());
  snapshotResponse.setName(snapshot.getName());
  snapshotResponse.setIntervalType(ApiDBUtils.getSnapshotIntervalTypes(snapshot.getId()));
  snapshotResponse.setState(snapshot.getState());
  SnapshotInfo snapshotInfo=null;
  if (snapshot instanceof SnapshotInfo) {
    snapshotInfo=(SnapshotInfo)snapshot;
  }
 else {
    DataStoreRole dataStoreRole=getDataStoreRole(snapshot,_snapshotStoreDao,_dataStoreMgr);
    snapshotInfo=snapshotfactory.getSnapshot(snapshot.getId(),dataStoreRole);
  }
  if (snapshotInfo == null) {
    s_logger.debug("String_Node_Str" + snapshot.getUuid());
    snapshotResponse.setRevertable(false);
  }
 else {
    snapshotResponse.setRevertable(snapshotInfo.isRevertable());
    snapshotResponse.setPhysicaSize(snapshotInfo.getPhysicalSize());
  }
  List<? extends ResourceTag> tags=ApiDBUtils.listByResourceTypeAndId(ResourceObjectType.Snapshot,snapshot.getId());
  List<ResourceTagResponse> tagResponses=new ArrayList<ResourceTagResponse>();
  for (  ResourceTag tag : tags) {
    ResourceTagResponse tagResponse=createResourceTagResponse(tag,true);
    CollectionUtils.addIgnoreNull(tagResponses,tagResponse);
  }
  snapshotResponse.setTags(tagResponses);
  snapshotResponse.setObjectName("String_Node_Str");
  return snapshotResponse;
}