Program: 20074
Project: 20074
Buggy source:
@GET public Template viewDashboard(@QueryParam("String_Node_Str") String subprojectId,@QueryParam("String_Node_Str") String visibility){
  CoreSession session=SessionFactory.getSession(request);
  try {
    DocumentService docService=Framework.getService(DocumentService.class);
    Template view=getView("String_Node_Str");
    String subprojectCriteria="String_Node_Str" + NXQLQueryHelper.buildSubprojectPathCriteria(session,subprojectId,visibility);
    DocumentModelList allInfoServices=docService.query(session,"String_Node_Str" + InformationService.DOCTYPE + subprojectCriteria,true,false);
    Map<String,DocumentModel> infoServicesById=new HashMap<String,DocumentModel>();
    for (    DocumentModel infoService : allInfoServices) {
      infoServicesById.put(infoService.getId(),infoService);
    }
    DocumentModelList matchedImpls=docService.query(session,"String_Node_Str" + ServiceImplementation.DOCTYPE + subprojectCriteria+ "String_Node_Str"+ ServiceImplementation.XPATH_PROVIDED_INFORMATION_SERVICE+ "String_Node_Str",true,false);
    view.arg("String_Node_Str",matchedImpls);
    view.arg("String_Node_Str",infoServicesById);
    Map<String,DocumentModel> unimplementedServsMap=new HashMap<String,DocumentModel>(infoServicesById);
    for (    DocumentModel matchedImpl : matchedImpls) {
      unimplementedServsMap.remove(matchedImpl.getPropertyValue(ServiceImplementation.XPATH_PROVIDED_INFORMATION_SERVICE));
    }
    view.arg("String_Node_Str",unimplementedServsMap.values());
    DocumentModelList unmatchedEndpoints=docService.query(session,"String_Node_Str" + Endpoint.DOCTYPE + subprojectCriteria+ "String_Node_Str"+ Endpoint.XPATH_PARENTSIDS+ "String_Node_Str"+ ServiceImplementation.DOCTYPE+ "String_Node_Str",true,false);
    view.arg("String_Node_Str",unmatchedEndpoints);
    DocumentModelList servWithoutSpecs=docService.query(session,"String_Node_Str" + ServiceImplementation.DOCTYPE + subprojectCriteria+ "String_Node_Str"+ ServiceImplementation.XPATH_PROVIDED_INFORMATION_SERVICE+ "String_Node_Str",true,false);
    view.arg("String_Node_Str",servWithoutSpecs);
    view.arg("String_Node_Str",subprojectId);
    view.arg("String_Node_Str",visibility);
    view.arg("String_Node_Str",ContextData.getVersionData(session,subprojectId));
    return view;
  }
 catch (  Exception e) {
    return getView("String_Node_Str").arg("String_Node_Str",e);
  }
}

Fixed version (ground truth):
@GET public Template viewDashboard(@QueryParam("String_Node_Str") String subprojectId,@QueryParam("String_Node_Str") String visibility){
  CoreSession session=SessionFactory.getSession(request);
  try {
    DocumentService docService=Framework.getService(DocumentService.class);
    Template view=getView("String_Node_Str");
    String subprojectCriteria=NXQLQueryHelper.buildSubprojectPathCriteria(session,subprojectId,visibility);
    if (!"String_Node_Str".equals(subprojectCriteria)) {
      subprojectCriteria="String_Node_Str" + subprojectCriteria;
    }
    DocumentModelList allInfoServices=docService.query(session,"String_Node_Str" + InformationService.DOCTYPE + subprojectCriteria,true,false);
    Map<String,DocumentModel> infoServicesById=new HashMap<String,DocumentModel>();
    for (    DocumentModel infoService : allInfoServices) {
      infoServicesById.put(infoService.getId(),infoService);
    }
    DocumentModelList matchedImpls=docService.query(session,"String_Node_Str" + ServiceImplementation.DOCTYPE + subprojectCriteria+ "String_Node_Str"+ ServiceImplementation.XPATH_PROVIDED_INFORMATION_SERVICE+ "String_Node_Str",true,false);
    view.arg("String_Node_Str",matchedImpls);
    view.arg("String_Node_Str",infoServicesById);
    Map<String,DocumentModel> unimplementedServsMap=new HashMap<String,DocumentModel>(infoServicesById);
    for (    DocumentModel matchedImpl : matchedImpls) {
      unimplementedServsMap.remove(matchedImpl.getPropertyValue(ServiceImplementation.XPATH_PROVIDED_INFORMATION_SERVICE));
    }
    view.arg("String_Node_Str",unimplementedServsMap.values());
    DocumentModelList unmatchedEndpoints=docService.query(session,"String_Node_Str" + Endpoint.DOCTYPE + subprojectCriteria+ "String_Node_Str"+ Endpoint.XPATH_PARENTSIDS+ "String_Node_Str"+ ServiceImplementation.DOCTYPE+ "String_Node_Str",true,false);
    view.arg("String_Node_Str",unmatchedEndpoints);
    DocumentModelList servWithoutSpecs=docService.query(session,"String_Node_Str" + ServiceImplementation.DOCTYPE + subprojectCriteria+ "String_Node_Str"+ ServiceImplementation.XPATH_PROVIDED_INFORMATION_SERVICE+ "String_Node_Str",true,false);
    view.arg("String_Node_Str",servWithoutSpecs);
    view.arg("String_Node_Str",subprojectId);
    view.arg("String_Node_Str",visibility);
    view.arg("String_Node_Str",ContextData.getVersionData(session,subprojectId));
    return view;
  }
 catch (  Exception e) {
    return getView("String_Node_Str").arg("String_Node_Str",e);
  }
}