Program: 13194
Project: 13194
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
 * @param pageSize the page size if paging
 * @param pagingCookie the cookie to use if paging, null if first page
 * @param reconContext the {@link RconciliationContext} object associated with this recon
 * @param querySide an indicator for which side of a reconciliation (source or target) a query is for
 * @return a {@link ReconQueryResult} containing the collection of (unqualified) ids
 * @throws SynchronizationException if retrieving or processing the ids failed
 */
protected ReconQueryResult query(final String objectSet,final JsonValue query,final ReconciliationContext reconContext,final Collection<String> collectionToPopulate,final boolean caseSensitive,final QuerySide querySide,int pageSize,String pagingCookie) throws SynchronizationException {
  final Collection<String> ids=collectionToPopulate;
  final JsonValue objList=new JsonValue(new ArrayList());
  final ReconQueryResult reconQueryResult=new ReconQueryResult();
  try {
    QueryRequest request=RequestUtil.buildQueryRequestFromParameterMap(objectSet,query.asMap());
    request.setPageSize(pageSize);
    request.setPagedResultsCookie(pagingCookie);
    reconContext.getService().getConnectionFactory().getConnection().query(reconContext.getService().getRouter(),request,new QueryResultHandler(){
      private boolean fullEntriesDetected=false;
      @Override public void handleError(      ResourceException error){
      }
      @Override public boolean handleResource(      Resource resource){
        if (resource.getId() == null) {
          logger.warn("String_Node_Str",resource);
        }
 else {
          if (fullEntriesDetected == false && hasFullEntry(resource.getContent(),querySide)) {
            fullEntriesDetected=true;
            logger.debug("String_Node_Str");
          }
          if (fullEntriesDetected) {
            objList.add(resource.getContent());
          }
          ids.add(caseSensitive ? resource.getId() : reconContext.getObjectMapping().getLinkType().normalizeId(resource.getId()));
        }
        return true;
      }
      @Override public void handleResult(      QueryResult result){
        reconQueryResult.setPagingCookie(result.getPagedResultsCookie());
      }
    }
);
  }
 catch (  JsonValueException jve) {
    throw new SynchronizationException(jve);
  }
catch (  ResourceException ose) {
    throw new SynchronizationException(ose);
  }
  reconContext.checkCanceled();
  reconQueryResult.setResultIterable(new ResultIterable(ids,objList.size() > 0 ? objList : null));
  return reconQueryResult;
}

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
 * @param pageSize the page size if paging
 * @param pagingCookie the cookie to use if paging, null if first page
 * @param reconContext the {@link RconciliationContext} object associated with this recon
 * @param querySide an indicator for which side of a reconciliation (source or target) a query is for
 * @return a {@link ReconQueryResult} containing the collection of (unqualified) ids
 * @throws SynchronizationException if retrieving or processing the ids failed
 */
protected ReconQueryResult query(final String objectSet,final JsonValue query,final ReconciliationContext reconContext,final Collection<String> collectionToPopulate,final boolean caseSensitive,final QuerySide querySide,int pageSize,String pagingCookie) throws SynchronizationException {
  final Collection<String> ids=collectionToPopulate;
  final JsonValue objList=new JsonValue(new LinkedList());
  final ReconQueryResult reconQueryResult=new ReconQueryResult();
  try {
    QueryRequest request=RequestUtil.buildQueryRequestFromParameterMap(objectSet,query.asMap());
    request.setPageSize(pageSize);
    request.setPagedResultsCookie(pagingCookie);
    reconContext.getService().getConnectionFactory().getConnection().query(reconContext.getService().getRouter(),request,new QueryResultHandler(){
      private boolean fullEntriesDetected=false;
      @Override public void handleError(      ResourceException error){
      }
      @Override public boolean handleResource(      Resource resource){
        if (resource.getId() == null) {
          logger.warn("String_Node_Str",resource);
        }
 else {
          if (fullEntriesDetected == false && hasFullEntry(resource.getContent(),querySide)) {
            fullEntriesDetected=true;
            logger.debug("String_Node_Str");
          }
          if (fullEntriesDetected) {
            objList.add(resource.getContent());
          }
          ids.add(caseSensitive ? resource.getId() : reconContext.getObjectMapping().getLinkType().normalizeId(resource.getId()));
        }
        return true;
      }
      @Override public void handleResult(      QueryResult result){
        reconQueryResult.setPagingCookie(result.getPagedResultsCookie());
      }
    }
);
  }
 catch (  JsonValueException jve) {
    throw new SynchronizationException(jve);
  }
catch (  ResourceException ose) {
    throw new SynchronizationException(ose);
  }
  reconContext.checkCanceled();
  reconQueryResult.setResultIterable(new ResultIterable(ids,objList.size() > 0 ? objList : null));
  return reconQueryResult;
}