Program: 14183
Project: 14183
Buggy source:
@Override public void cleanupInvalidObjects(final Bucket bucket,final String objectKey) throws Exception {
  ObjectEntity searchExample=new ObjectEntity(bucket,objectKey,null);
  final Predicate<ObjectEntity> repairPredicate=new Predicate<ObjectEntity>(){
    public boolean apply(    ObjectEntity example){
      try {
        ObjectEntity searchExample=new ObjectEntity().withKey(example.getObjectKey()).withBucket(example.getBucket()).withState(ObjectState.extant).withVersionId(ObjectStorageProperties.NULL_VERSION_ID);
        Criteria searchCriteria=Entities.createCriteria(ObjectEntity.class);
        searchCriteria.add(Example.create(searchExample)).addOrder(Order.desc("String_Node_Str"));
        searchCriteria=getSearchByBucket(searchCriteria,example.getBucket());
        List<ObjectEntity> results=searchCriteria.list();
        if (results.size() <= 1) {
          return true;
        }
        results.get(0).setIsLatest(true);
        for (        ObjectEntity obj : results.subList(1,results.size())) {
          LOG.trace("String_Node_Str" + obj.getObjectUuid() + "String_Node_Str");
          obj.setIsLatest(false);
          obj=transitionObjectToState(obj,ObjectState.deleting);
        }
      }
 catch (      NoSuchElementException e) {
      }
catch (      Exception e) {
        LOG.error("String_Node_Str" + example.getBucket().getBucketName() + "String_Node_Str"+ example.getObjectKey());
        return false;
      }
      return true;
    }
  }
;
  try {
    Entities.asTransaction(repairPredicate).apply(searchExample);
  }
 catch (  final Throwable f) {
    LOG.error("String_Node_Str",f);
  }
}

Fixed version (ground truth):
@Override public void cleanupInvalidObjects(final Bucket bucket,final String objectKey) throws Exception {
  ObjectEntity searchExample=new ObjectEntity(bucket,objectKey,null);
  final Predicate<ObjectEntity> repairPredicate=new Predicate<ObjectEntity>(){
    public boolean apply(    ObjectEntity example){
      try {
        ObjectEntity searchExample=new ObjectEntity().withKey(example.getObjectKey()).withBucket(example.getBucket()).withState(ObjectState.extant);
        Criteria searchCriteria=Entities.createCriteria(ObjectEntity.class);
        searchCriteria.add(Example.create(searchExample));
        searchCriteria.add(Restrictions.or(Restrictions.eq("String_Node_Str",ObjectStorageProperties.NULL_VERSION_ID),Restrictions.eq("String_Node_Str",Boolean.TRUE)));
        searchCriteria.addOrder(Order.desc("String_Node_Str"));
        searchCriteria=getSearchByBucket(searchCriteria,example.getBucket());
        List<ObjectEntity> results=searchCriteria.list();
        if (results.size() <= 1) {
          return true;
        }
        ObjectEntity latest=results.get(0);
        latest.setIsLatest(Boolean.TRUE);
        for (        ObjectEntity obj : results.subList(1,results.size())) {
          LOG.trace("String_Node_Str" + obj.getObjectUuid() + "String_Node_Str");
          obj.setIsLatest(Boolean.FALSE);
          if (latest.getVersionId() != null && ObjectStorageProperties.NULL_VERSION_ID.equals(latest.getVersionId()) && obj.getVersionId() != null && ObjectStorageProperties.NULL_VERSION_ID.equals(obj.getVersionId())) {
            transitionObjectToState(obj,ObjectState.deleting);
          }
        }
      }
 catch (      NoSuchElementException e) {
      }
catch (      Exception e) {
        LOG.error("String_Node_Str" + example.getBucket().getBucketName() + "String_Node_Str"+ example.getObjectKey());
        return false;
      }
      return true;
    }
  }
;
  try {
    Entities.asTransaction(repairPredicate).apply(searchExample);
  }
 catch (  final Throwable f) {
    LOG.error("String_Node_Str",f);
  }
}