Program: 13262
Project: 13262
Buggy source:
/** 
 * Execute the specified query
 * @param objectSet the object set to query
 * @param query the query parameters
 * @param collectionToPopulate the collection to populate with results
 * @param caseSensitive whether the collection should be populated in casesensitive fashion, or if false it populates as lower case only
 * @return the collection of (unqualified) ids
 * @throws SynchronizationException if retrieving or processing the ids failed
 */
protected Collection<String> query(final String objectSet,JsonValue query,final ReconciliationContext reconContext,Collection<String> collectionToPopulate,final boolean caseSensitive) throws SynchronizationException {
  final Collection<String> ids=collectionToPopulate;
  try {
    QueryRequest r=Requests.newQueryRequest(objectSet);
    r.setQueryId(query.get(QueryRequest.FIELD_QUERY_ID).asString());
    r.setQueryExpression(query.get(QueryRequest.FIELD_QUERY_EXPRESSION).asString());
    for (    Map.Entry<String,Object> e : query.asMap().entrySet()) {
      r.setAdditionalParameter(e.getKey(),String.valueOf(e.getValue()));
    }
    reconContext.getService().getConnectionFactory().getConnection().query(reconContext.getService().getRouter(),r,new QueryResultHandler(){
      @Override public void handleError(      ResourceException error){
      }
      @Override public boolean handleResource(      Resource resource){
        if (resource.getId() == null) {
          logger.warn("String_Node_Str",resource.toString());
        }
 else {
          ids.add(caseSensitive ? resource.getId() : reconContext.getObjectMapping().getLinkType().normalizeId(resource.getId()));
        }
        return true;
      }
      @Override public void handleResult(      QueryResult result){
      }
    }
);
  }
 catch (  JsonValueException jve) {
    throw new SynchronizationException(jve);
  }
catch (  ResourceException ose) {
    throw new SynchronizationException(ose);
  }
  reconContext.checkCanceled();
  return ids;
}

Fixed version (ground truth):
/** 
 * Execute the specified query
 * @param objectSet the object set to query
 * @param query the query parameters
 * @param collectionToPopulate the collection to populate with results
 * @param caseSensitive whether the collection should be populated in casesensitive fashion, or if false it populates as lower case only
 * @return the collection of (unqualified) ids
 * @throws SynchronizationException if retrieving or processing the ids failed
 */
protected Collection<String> query(final String objectSet,JsonValue query,final ReconciliationContext reconContext,Collection<String> collectionToPopulate,final boolean caseSensitive) throws SynchronizationException {
  final Collection<String> ids=collectionToPopulate;
  try {
    QueryRequest r=Requests.newQueryRequest(objectSet);
    r.setQueryId(query.get(QueryRequest.FIELD_QUERY_ID).asString());
    r.setQueryExpression(query.get(QueryRequest.FIELD_QUERY_EXPRESSION).asString());
    JsonValue queryFilter=query.get(QueryRequest.FIELD_QUERY_FILTER);
    if (!queryFilter.isNull()) {
      r.setQueryFilter(QueryFilter.valueOf(queryFilter.asString()));
    }
    for (    Map.Entry<String,Object> e : query.asMap().entrySet()) {
      r.setAdditionalParameter(e.getKey(),String.valueOf(e.getValue()));
    }
    reconContext.getService().getConnectionFactory().getConnection().query(reconContext.getService().getRouter(),r,new QueryResultHandler(){
      @Override public void handleError(      ResourceException error){
      }
      @Override public boolean handleResource(      Resource resource){
        if (resource.getId() == null) {
          logger.warn("String_Node_Str",resource.toString());
        }
 else {
          ids.add(caseSensitive ? resource.getId() : reconContext.getObjectMapping().getLinkType().normalizeId(resource.getId()));
        }
        return true;
      }
      @Override public void handleResult(      QueryResult result){
      }
    }
);
  }
 catch (  JsonValueException jve) {
    throw new SynchronizationException(jve);
  }
catch (  ResourceException ose) {
    throw new SynchronizationException(ose);
  }
  reconContext.checkCanceled();
  return ids;
}