Program: 25843
Project: 25843
Buggy source:
@Override public List<HealthDataEntry> getHealthDataByDateRange(HealthDataKey key,Date startDate,Date endDate) throws BridgeServiceException {
  if (key == null) {
    throw new BridgeServiceException("String_Node_Str");
  }
 else   if (startDate == null) {
    throw new BridgeServiceException("String_Node_Str");
  }
 else   if (endDate == null) {
    throw new BridgeServiceException("String_Node_Str");
  }
  try {
    DynamoDBMapper mapper=getCreateMapper();
    DynamoRecord record=new DynamoRecord(healthDataKeyToAnonimizedKeyString(key));
    AttributeValue endDateWindow=new AttributeValue().withN(Long.toString(endDate.getTime()));
    Condition startDateCondition=new Condition().withComparisonOperator(ComparisonOperator.LE).withAttributeValueList(endDateWindow);
    Map<String,Condition> keyConditions=new HashMap<String,Condition>();
    keyConditions.put("String_Node_Str",startDateCondition);
    DynamoDBQueryExpression<DynamoRecord> query=new DynamoDBQueryExpression<DynamoRecord>().withHashKeyValues(record).withRangeKeyConditions(keyConditions);
    List<DynamoRecord> records1=mapper.query(DynamoRecord.class,query);
    AttributeValue startDateWindow=new AttributeValue().withN(Long.toString(startDate.getTime()));
    Condition endDateCondition=new Condition().withComparisonOperator(ComparisonOperator.GE).withAttributeValueList(startDateWindow);
    query=new DynamoDBQueryExpression<DynamoRecord>().withHashKeyValues(record).withRangeKeyCondition("String_Node_Str",endDateCondition);
    List<DynamoRecord> records2=mapper.query(DynamoRecord.class,query);
    Set<DynamoRecord> intersection=new HashSet<DynamoRecord>(records1);
    intersection.retainAll(new HashSet<DynamoRecord>(records2));
    return toHealthDataEntries(intersection);
  }
 catch (  BridgeServiceException e) {
    throw new BridgeServiceException(e);
  }
}

Fixed version (ground truth):
@Override public List<HealthDataEntry> getHealthDataByDateRange(HealthDataKey key,Date startDate,Date endDate) throws BridgeServiceException {
  if (key == null) {
    throw new BridgeServiceException("String_Node_Str");
  }
 else   if (startDate == null) {
    throw new BridgeServiceException("String_Node_Str");
  }
 else   if (endDate == null) {
    throw new BridgeServiceException("String_Node_Str");
  }
  try {
    DynamoDBMapper mapper=getCreateMapper();
    DynamoRecord record=new DynamoRecord(healthDataKeyToAnonimizedKeyString(key));
    AttributeValue endDateWindow=new AttributeValue().withN(Long.toString(endDate.getTime()));
    Condition startDateCondition=new Condition().withComparisonOperator(ComparisonOperator.LE).withAttributeValueList(endDateWindow);
    Map<String,Condition> keyConditions=new HashMap<String,Condition>();
    keyConditions.put("String_Node_Str",startDateCondition);
    DynamoDBQueryExpression<DynamoRecord> query=new DynamoDBQueryExpression<DynamoRecord>().withHashKeyValues(record).withRangeKeyConditions(keyConditions);
    List<DynamoRecord> records1=mapper.query(DynamoRecord.class,query);
    AttributeValue startDateWindow=new AttributeValue().withN(Long.toString(startDate.getTime()));
    Condition endDateCondition=new Condition().withComparisonOperator(ComparisonOperator.GE).withAttributeValueList(startDateWindow);
    query=new DynamoDBQueryExpression<DynamoRecord>().withHashKeyValues(record).withRangeKeyCondition("String_Node_Str",endDateCondition);
    List<DynamoRecord> records2=mapper.query(DynamoRecord.class,query);
    Set<DynamoRecord> intersection=new HashSet<DynamoRecord>(records1);
    intersection.retainAll(new HashSet<DynamoRecord>(records2));
    return toHealthDataEntries(intersection);
  }
 catch (  Exception e) {
    throw new BridgeServiceException(e);
  }
}