Program: 14181
Project: 14181
Buggy source:
@Override public ListVersionsResponseType listVersions(ListVersionsType request) throws S3Exception {
  Bucket bucket=getBucketAndCheckAuthorization(request);
  int maxKeys=ObjectStorageProperties.MAX_KEYS;
  if (!Strings.isNullOrEmpty(request.getMaxKeys())) {
    try {
      maxKeys=Integer.parseInt(request.getMaxKeys());
      if (maxKeys < 0 || maxKeys > ObjectStorageProperties.MAX_KEYS) {
        throw new InvalidArgumentException(request.getMaxKeys());
      }
    }
 catch (    NumberFormatException e) {
      throw new InvalidArgumentException(request.getMaxKeys());
    }
  }
  try {
    PaginatedResult<ObjectEntity> versionListing=ObjectMetadataManagers.getInstance().listVersionsPaginated(bucket,maxKeys,request.getPrefix(),request.getDelimiter(),request.getKeyMarker(),request.getVersionIdMarker(),false);
    ListVersionsResponseType reply=request.getReply();
    reply.setName(bucket.getBucketName());
    reply.setMaxKeys(maxKeys);
    reply.setKeyMarker(request.getKeyMarker());
    reply.setDelimiter(request.getDelimiter());
    reply.setPrefix(request.getPrefix());
    reply.setIsTruncated(versionListing.getIsTruncated());
    for (    ObjectEntity ent : versionListing.getEntityList()) {
      reply.getKeyEntries().add(ent.toVersionEntry());
    }
    if (versionListing.getLastEntry() instanceof ObjectEntity) {
      reply.setNextKeyMarker(((ObjectEntity)versionListing.getLastEntry()).getObjectKey());
      reply.setNextVersionIdMarker(((ObjectEntity)versionListing.getLastEntry()).getVersionId());
    }
 else     if (versionListing.getLastEntry() instanceof String) {
      reply.setNextKeyMarker(((String)versionListing.getLastEntry()));
    }
    for (    String s : versionListing.getCommonPrefixes()) {
      reply.getCommonPrefixesList().add(new CommonPrefixesEntry(s));
    }
    return reply;
  }
 catch (  S3Exception e) {
    throw e;
  }
catch (  Exception e) {
    LOG.warn("String_Node_Str" + request.getBucket());
    throw new InternalErrorException(e);
  }
}

Fixed version (ground truth):
@Override public ListVersionsResponseType listVersions(ListVersionsType request) throws S3Exception {
  Bucket bucket=getBucketAndCheckAuthorization(request);
  int maxKeys=ObjectStorageProperties.MAX_KEYS;
  if (!Strings.isNullOrEmpty(request.getMaxKeys())) {
    try {
      maxKeys=Integer.parseInt(request.getMaxKeys());
      if (maxKeys < 0 || maxKeys > ObjectStorageProperties.MAX_KEYS) {
        throw new InvalidArgumentException(request.getMaxKeys());
      }
    }
 catch (    NumberFormatException e) {
      throw new InvalidArgumentException(request.getMaxKeys());
    }
  }
  try {
    PaginatedResult<ObjectEntity> versionListing=ObjectMetadataManagers.getInstance().listVersionsPaginated(bucket,maxKeys,request.getPrefix(),request.getDelimiter(),request.getKeyMarker(),request.getVersionIdMarker(),false);
    ListVersionsResponseType reply=request.getReply();
    reply.setName(bucket.getBucketName());
    reply.setMaxKeys(maxKeys);
    reply.setKeyMarker(request.getKeyMarker());
    reply.setDelimiter(request.getDelimiter());
    reply.setPrefix(request.getPrefix());
    reply.setIsTruncated(versionListing.getIsTruncated());
    for (    ObjectEntity ent : versionListing.getEntityList()) {
      reply.getKeyEntries().add(ent.toVersionEntry());
    }
    if (reply.getIsTruncated()) {
      if (versionListing.getLastEntry() instanceof ObjectEntity) {
        reply.setNextKeyMarker(((ObjectEntity)versionListing.getLastEntry()).getObjectKey());
        reply.setNextVersionIdMarker(((ObjectEntity)versionListing.getLastEntry()).getVersionId());
      }
 else       if (versionListing.getLastEntry() instanceof String) {
        reply.setNextKeyMarker(((String)versionListing.getLastEntry()));
      }
    }
    for (    String s : versionListing.getCommonPrefixes()) {
      reply.getCommonPrefixesList().add(new CommonPrefixesEntry(s));
    }
    return reply;
  }
 catch (  S3Exception e) {
    throw e;
  }
catch (  Exception e) {
    LOG.warn("String_Node_Str" + request.getBucket());
    throw new InternalErrorException(e);
  }
}