nus-yam/ex-repair huggingface dataset:
Program: 20065
Project: 20065
Buggy source:
/** 
 * Format the method documentation for Nuxeo registry, especially by adding doclets (eg : @param) ommitted by qdox
 * @param method Java method
 * @return formatted comment bloc with doctlets tags
 */
protected String formatDoc(JavaMethod method){
  StringBuilder formattedDoc=new StringBuilder();
  if (method.getComment() != null) {
    formattedDoc.append(method.getComment());
  }
  for (  JavaParameter param : method.getParameters()) {
    if (formattedDoc.length() > 0) {
      formattedDoc.append("String_Node_Str");
    }
    formattedDoc.append("String_Node_Str");
    formattedDoc.append(param.getName());
  }
  return formattedDoc.toString();
}

Fixed version (ground truth):
/** 
 * Format the method documentation for Nuxeo registry, especially by adding doclets (eg : @param) ommitted by qdox
 * @param method Java method
 * @return formatted comment bloc with doctlets tags
 */
protected String formatDoc(JavaMethod method){
  StringBuilder formattedDoc=new StringBuilder();
  if (method.getComment() != null) {
    formattedDoc.append(method.getComment());
  }
  for (  DocletTag tag : method.getTags()) {
    if (formattedDoc.length() > 0) {
      formattedDoc.append("String_Node_Str");
    }
    formattedDoc.append("String_Node_Str");
    formattedDoc.append(tag.getName());
    formattedDoc.append("String_Node_Str");
    formattedDoc.append(tag.getValue());
  }
  return formattedDoc.toString();
}
Program: 20066
Project: 20066
Buggy source:
@Override public ResourceDownloadInfo get(ResourceDownloadInfo rdi) throws Exception {
  return get(new URL(rdi.getDownloadableUrl()));
}

Fixed version (ground truth):
@Override public ResourceDownloadInfo get(ResourceDownloadInfo rdi) throws Exception {
  rdi=get(new URL(rdi.getDownloadableUrl()));
  return rdi;
}
Program: 20067
Project: 20067
Buggy source:
/** 
 * @param url
 * @return
 * @throws Exception
 */
private File delegatedDownload(URL url) throws Exception {
  WebResource webResource=client.resource(delegateResourceDownloadServiceUrl);
  String callback=url.toString().substring(url.toString().indexOf("String_Node_Str"));
  String urlWithoutCallback=url.toString().substring(0,url.toString().indexOf("String_Node_Str"));
  webResource=webResource.queryParam("String_Node_Str",URLEncoder.encode(urlWithoutCallback,"String_Node_Str"));
  File resourceFile=webResource.get(File.class);
  return resourceFile;
}

Fixed version (ground truth):
/** 
 * @param url
 * @return
 * @throws Exception
 */
private File delegatedDownload(URL url) throws Exception {
  WebResource webResource=client.resource(delegateResourceDownloadServiceUrl);
  String urlString=url.toString();
  String urlWithoutCallback=urlString;
  if (urlString.contains("String_Node_Str")) {
    urlWithoutCallback=urlString.substring(0,urlString.indexOf("String_Node_Str"));
  }
  webResource=webResource.queryParam("String_Node_Str",URLEncoder.encode(urlWithoutCallback,"String_Node_Str"));
  File resourceFile=webResource.get(File.class);
  return resourceFile;
}
Program: 20068
Project: 20068
Buggy source:
/** 
 * @param session
 * @param subprojectId
 * @return 
 */
public final static ContextData getVersionData(CoreSession session,String subprojectId) throws ClientException {
  ContextData versionData=new ContextData();
  DocumentModel contextInfo=SubprojectServiceImpl.getSubprojectById(session,subprojectId);
  DocumentModel liveVersion=session.getWorkingCopy(contextInfo.getRef());
  String versionPath=liveVersion.getPathAsString();
  DocumentModelList documentList=session.query(DocumentService.NXQL_SELECT_FROM + Project.DOCTYPE);
  for (  DocumentModel project : documentList) {
    if (versionPath.startsWith(project.getPathAsString())) {
      versionData.setProject(project.getName());
      break;
    }
  }
  versionData.setPhase(contextInfo.getName());
  if (contextInfo.isVersion()) {
    versionData.setVersion(contextInfo.getProperty("String_Node_Str").getValue() + "String_Node_Str" + contextInfo.getProperty("String_Node_Str").getValue());
  }
  return versionData;
}

Fixed version (ground truth):
/** 
 * @param session
 * @param subprojectId
 * @return
 */
public final static ContextData getVersionData(CoreSession session,String subprojectId) throws ClientException {
  ContextData versionData=new ContextData();
  DocumentModel contextInfo=SubprojectServiceImpl.getSubprojectById(session,subprojectId);
  if (contextInfo == null) {
    throw new ClientException("String_Node_Str" + subprojectId);
  }
  DocumentModel liveVersion=session.getWorkingCopy(contextInfo.getRef());
  String versionPath=liveVersion.getPathAsString();
  DocumentModelList documentList=session.query(DocumentService.NXQL_SELECT_FROM + Project.DOCTYPE);
  for (  DocumentModel project : documentList) {
    if (versionPath.startsWith(project.getPathAsString())) {
      versionData.setProject(project.getName());
      break;
    }
  }
  versionData.setPhase(contextInfo.getTitle());
  if (contextInfo.isVersion()) {
    versionData.setVersion(contextInfo.getProperty("String_Node_Str").getValue() + "String_Node_Str" + contextInfo.getProperty("String_Node_Str").getValue());
  }
  return versionData;
}
Program: 20069
Project: 20069
Buggy source:
/** 
 * @param url
 * @return
 * @throws Exception 
 */
private File localDownload(URL url) throws Exception {
  HttpDownloaderService httpDownloaderService=new HttpDownloaderServiceImpl();
  HttpDownloader fileDownloader=httpDownloaderService.createHttpDownloader(url);
  fileDownloader.download();
  return fileDownloader.getFile();
}

Fixed version (ground truth):
/** 
 * @param url
 * @return
 * @throws Exception
 */
private File localDownload(URL url) throws Exception {
  HttpDownloaderService httpDownloaderService=new HttpDownloaderServiceImpl();
  HttpDownloader fileDownloader=httpDownloaderService.createHttpDownloader(url);
  fileDownloader.download();
  return fileDownloader.getFile();
}
Program: 20070
Project: 20070
Buggy source:
@Override public ResourceDownloadInfo get(URL url) throws Exception {
  ResourceDownloadInfoImpl resourceDownloadInfo=new ResourceDownloadInfoImpl();
  File file=null;
  if (!isDelegatedDownloadDisabled) {
    try {
      file=delegatedDownload(url);
    }
 catch (    Exception ex) {
      isDelegatedDownloadDisabled=true;
    }
  }
 else {
    file=localDownload(url);
  }
  if (file != null) {
    Date date=new Date();
    SimpleDateFormat sdf=new SimpleDateFormat(ResourceDownloadInfo.TIMESTAMP_DATETIME_PATTERN);
    resourceDownloadInfo.setTimestamp(sdf.format(date));
    resourceDownloadInfo.setFile(file);
  }
  return resourceDownloadInfo;
}

Fixed version (ground truth):
@Override public ResourceDownloadInfo get(URL url) throws Exception {
  ResourceDownloadInfoImpl resourceDownloadInfo=new ResourceDownloadInfoImpl();
  File file=null;
  if (!isDelegatedDownloadDisabled) {
    try {
      file=delegatedDownload(url);
    }
 catch (    Exception ex) {
      isDelegatedDownloadDisabled=true;
    }
  }
  if (file == null) {
    file=localDownload(url);
  }
  if (file != null) {
    Date date=new Date();
    SimpleDateFormat sdf=new SimpleDateFormat(ResourceDownloadInfo.TIMESTAMP_DATETIME_PATTERN);
    resourceDownloadInfo.setTimestamp(sdf.format(date));
    resourceDownloadInfo.setFile(file);
  }
  return resourceDownloadInfo;
}
Program: 20071
Project: 20071
Buggy source:
/** 
 * @param url
 * @return
 * @throws Exception 
 */
private File delegatedDownload(URL url) throws Exception {
  WebResource webResource=client.resource(delegateResourceDownloadServiceUrl);
  webResource.setProperty("String_Node_Str",url.toURI().toString());
  File resourceFile=webResource.get(File.class);
  return resourceFile;
}

Fixed version (ground truth):
/** 
 * @param url
 * @return
 * @throws Exception
 */
private File delegatedDownload(URL url) throws Exception {
  WebResource webResource=client.resource(delegateResourceDownloadServiceUrl);
  webResource.setProperty("String_Node_Str",url.toURI().toString());
  File resourceFile=webResource.get(File.class);
  return resourceFile;
}
Program: 20072
Project: 20072
Buggy source:
/** 
 * Read data from File
 * @param file
 * @return 
 */
@Override public String getData(File file) throws Exception {
  String data;
  FileInputStream fis=null;
  try {
    if (file == null) {
      return "String_Node_Str";
    }
    fis=new FileInputStream(file);
    StringBuilder dataBuffer=new StringBuilder();
    int c;
    while ((c=fis.read()) != -1) {
      dataBuffer.append((char)c);
    }
    data=dataBuffer.toString();
  }
 catch (  Exception e) {
    data=null;
  }
 finally {
    if (fis != null) {
      fis.close();
    }
  }
  return data;
}

Fixed version (ground truth):
/** 
 * Read data from File
 * @param file
 * @return
 */
@Override public String getData(File file) throws Exception {
  String data;
  FileInputStream fis=null;
  try {
    if (file == null) {
      return "String_Node_Str";
    }
    fis=new FileInputStream(file);
    StringBuilder dataBuffer=new StringBuilder();
    int c;
    while ((c=fis.read()) != -1) {
      dataBuffer.append((char)c);
    }
    data=dataBuffer.toString();
  }
 catch (  Exception e) {
    data=null;
  }
 finally {
    if (fis != null) {
      fis.close();
    }
  }
  return data;
}
Program: 20073
Project: 20073
Buggy source:
@Override public ResourceDownloadInfo get(URL url) throws Exception {
  ResourceDownloadInfoImpl resourceDownloadInfo=new ResourceDownloadInfoImpl();
  File file=null;
  if (!isDelegatedDownloadDisabled) {
    try {
      file=delegatedDownload(url);
    }
 catch (    Exception ex) {
      isDelegatedDownloadDisabled=true;
      file=localDownload(url);
    }
  }
  Date date=new Date();
  SimpleDateFormat sdf=new SimpleDateFormat(ResourceDownloadInfo.TIMESTAMP_DATETIME_PATTERN);
  resourceDownloadInfo.setTimestamp(sdf.format(date));
  resourceDownloadInfo.setFile(file);
  return resourceDownloadInfo;
}

Fixed version (ground truth):
@Override public ResourceDownloadInfo get(URL url) throws Exception {
  ResourceDownloadInfoImpl resourceDownloadInfo=new ResourceDownloadInfoImpl();
  File file=null;
  if (!isDelegatedDownloadDisabled) {
    try {
      file=delegatedDownload(url);
    }
 catch (    Exception ex) {
      isDelegatedDownloadDisabled=true;
    }
  }
 else {
    file=localDownload(url);
  }
  if (file != null) {
    Date date=new Date();
    SimpleDateFormat sdf=new SimpleDateFormat(ResourceDownloadInfo.TIMESTAMP_DATETIME_PATTERN);
    resourceDownloadInfo.setTimestamp(sdf.format(date));
    resourceDownloadInfo.setFile(file);
  }
  return resourceDownloadInfo;
}
Program: 20077
Project: 20077
Buggy source:
@Override public IndicatorValue compute(CoreSession session,String subprojectId,Map<String,IndicatorValue> computedIndicators,String visibility) throws ClientException {
  String subprojectPathCriteria;
  if (subprojectId == null) {
    subprojectPathCriteria="String_Node_Str";
  }
 else {
    if (ContextVisibility.STRICT.getValue().equals(visibility)) {
      subprojectPathCriteria=DocumentService.NXQL_AND + SubprojectServiceImpl.buildCriteriaInSubproject(subprojectId);
    }
 else {
      subprojectPathCriteria=DocumentService.NXQL_AND + SubprojectServiceImpl.buildCriteriaSeenFromSubproject(SubprojectServiceImpl.getSubprojectById(session,subprojectId));
    }
  }
  IterableQueryResult queryResult=session.queryAndFetch(valueQuery + subprojectPathCriteria,NXQL.NXQL);
  try {
    if (this.totalQuery == null) {
      return new IndicatorValue((int)queryResult.size(),-1);
    }
 else {
      IterableQueryResult totalQueryResult=null;
      try {
        totalQueryResult=session.queryAndFetch(totalQuery,NXQL.NXQL);
        return new IndicatorValue((int)queryResult.size(),(int)totalQueryResult.size());
      }
  finally {
        if (totalQueryResult != null) {
          totalQueryResult.close();
        }
      }
    }
  }
  finally {
    queryResult.close();
  }
}

Fixed version (ground truth):
@Override public IndicatorValue compute(CoreSession session,String subprojectId,Map<String,IndicatorValue> computedIndicators,String visibility) throws ClientException {
  String subprojectPathCriteria;
  if (subprojectId == null) {
    subprojectPathCriteria="String_Node_Str";
  }
 else {
    if (ContextVisibility.STRICT.getValue().equals(visibility)) {
      subprojectPathCriteria=DocumentService.NXQL_AND + SubprojectServiceImpl.buildCriteriaInSubproject(subprojectId);
    }
 else {
      subprojectPathCriteria=DocumentService.NXQL_AND + SubprojectServiceImpl.buildCriteriaSeenFromSubproject(SubprojectServiceImpl.getSubprojectById(session,subprojectId));
    }
  }
  IterableQueryResult queryResult=session.queryAndFetch(valueQuery + subprojectPathCriteria,NXQL.NXQL);
  try {
    if (this.totalQuery == null) {
      return new IndicatorValue((int)queryResult.size(),-1);
    }
 else {
      IterableQueryResult totalQueryResult=null;
      try {
        totalQueryResult=session.queryAndFetch(totalQuery,NXQL.NXQL);
        int percentage=Math.round(queryResult.size() * 100 / totalQueryResult.size());
        return new IndicatorValue((int)queryResult.size(),percentage);
      }
  finally {
        if (totalQueryResult != null) {
          totalQueryResult.close();
        }
      }
    }
  }
  finally {
    queryResult.close();
  }
}
Program: 20078
Project: 20078
Buggy source:
public static String getName(String doctype){
  return doctype + "String_Node_Str";
}

Fixed version (ground truth):
public static String getName(String doctype){
  return doctype;
}
Program: 20081
Project: 20081
Buggy source:
@Override public ServiceInformations queryServicesWithEndpoints(String search,String subProjectId,String visibility) throws Exception {
  ServiceInformations serviceInformations=this.queryWSDLInterfaces(search,subProjectId,visibility);
  for (  ServiceInformation serviceInformation : serviceInformations.getServiceInformationList()) {
    EndpointInformations endpoints=this.queryServiceEndpoints(serviceInformation.getNuxeoID());
    serviceInformation.setEndpoints(endpoints);
  }
  return serviceInformations;
}

Fixed version (ground truth):
public ServiceInformations queryServicesWithEndpoints(String search,String subProjectId) throws Exception {
  ServiceInformations serviceInformations=this.queryWSDLInterfaces(search,subProjectId);
  for (  ServiceInformation serviceInformation : serviceInformations.getServiceInformationList()) {
    EndpointInformations endpoints=this.queryServiceEndpoints(serviceInformation.getNuxeoID());
    serviceInformation.setEndpoints(endpoints);
  }
  return serviceInformations;
}
Program: 20084
Project: 20084
Buggy source:
@GET @Produces(MediaType.TEXT_HTML) public Object doGetHTML(@QueryParam("String_Node_Str") String subProjectId,@QueryParam("String_Node_Str") String visibility) throws Exception {
  CoreSession session=SessionFactory.getSession(request);
  List<String> envs=new ArrayList<String>();
  DocumentModelList environments=session.query("String_Node_Str" + Endpoint.XPATH_ENDP_ENVIRONMENT + "String_Node_Str"+ Endpoint.DOCTYPE);
  for (  DocumentModel model : environments) {
    envs.add((String)model.getPropertyValue(Endpoint.XPATH_ENDP_ENVIRONMENT));
  }
  CoreSession documentManager=SessionFactory.getSession(request);
  List<EndpointInformation> endpoints=SimpleRegistryServiceImpl.queryEndpoints(documentManager,"String_Node_Str",subProjectId,visibility).getEndpointInformationList();
  return getView("String_Node_Str").arg("String_Node_Str",envs).arg("String_Node_Str",endpoints).arg("String_Node_Str",subProjectId).arg("String_Node_Str",visibility);
}

Fixed version (ground truth):
@GET @Produces(MediaType.TEXT_HTML) public Object doGetHTML(@QueryParam("String_Node_Str") String subProjectId,@QueryParam("String_Node_Str") String visibility) throws Exception {
  CoreSession session=SessionFactory.getSession(request);
  List<String> envs=new ArrayList<String>();
  DocumentModelList environments=session.query("String_Node_Str" + Endpoint.XPATH_ENDP_ENVIRONMENT + "String_Node_Str"+ Endpoint.DOCTYPE);
  for (  DocumentModel model : environments) {
    envs.add((String)model.getPropertyValue(Endpoint.XPATH_ENDP_ENVIRONMENT));
  }
  CoreSession documentManager=SessionFactory.getSession(request);
  List<EndpointInformation> endpoints=SimpleRegistryServiceImpl.queryEndpoints(documentManager,"String_Node_Str",subProjectId).getEndpointInformationList();
  return getView("String_Node_Str").arg("String_Node_Str",envs).arg("String_Node_Str",endpoints).arg("String_Node_Str",subProjectId).arg("String_Node_Str",visibility);
}
Program: 20087
Project: 20087
Buggy source:
@GET @Path("String_Node_Str") @Produces(MediaType.TEXT_HTML) public Object doGetByTagHTML(@PathParam("String_Node_Str") String tagName,@QueryParam("String_Node_Str") String subprojectId) throws Exception {
  CoreSession session=SessionFactory.getSession(request);
  DocumentService docService=Framework.getService(DocumentService.class);
  String subprojectPathCriteria;
  if (subprojectId == null || subprojectId.length() == 0) {
    subprojectPathCriteria="String_Node_Str";
  }
 else {
    subprojectPathCriteria=DocumentService.NXQL_AND + SubprojectServiceImpl.buildCriteriaInSubprojectUsingPathFromId(subprojectId);
  }
  String query=DocumentService.NXQL_SELECT_FROM + InformationService.DOCTYPE + DocumentService.NXQL_WHERE+ InformationService.XPATH_PARENTSIDS+ "String_Node_Str"+ TaggingFolder.DOCTYPE+ "String_Node_Str"+ tagName+ "String_Node_Str"+ subprojectPathCriteria;
  DocumentModelList tagServices=docService.query(session,query,true,false);
  Template view=getView("String_Node_Str");
  return view.arg("String_Node_Str",docService.find(session,new SoaNodeId(subprojectId,TaggingFolder.DOCTYPE,tagName))).arg("String_Node_Str",tagServices).arg("String_Node_Str",subprojectId);
}

Fixed version (ground truth):
@GET @Path("String_Node_Str") @Produces(MediaType.TEXT_HTML) public Object doGetByTagHTML(@PathParam("String_Node_Str") String tagName,@QueryParam("String_Node_Str") String subprojectId,@QueryParam("String_Node_Str") String contextSubprojectId) throws Exception {
  CoreSession session=SessionFactory.getSession(request);
  DocumentService docService=Framework.getService(DocumentService.class);
  String subprojectPathCriteria;
  if (subprojectId == null || subprojectId.length() == 0) {
    subprojectPathCriteria="String_Node_Str";
  }
 else {
    subprojectPathCriteria=DocumentService.NXQL_AND + SubprojectServiceImpl.buildCriteriaInSubprojectUsingPathFromId(subprojectId);
  }
  String query=DocumentService.NXQL_SELECT_FROM + InformationService.DOCTYPE + DocumentService.NXQL_WHERE+ InformationService.XPATH_PARENTSIDS+ "String_Node_Str"+ TaggingFolder.DOCTYPE+ "String_Node_Str"+ tagName+ "String_Node_Str"+ subprojectPathCriteria;
  DocumentModelList tagServices=docService.query(session,query,true,false);
  Template view=getView("String_Node_Str");
  return view.arg("String_Node_Str",docService.find(session,new SoaNodeId(subprojectId,TaggingFolder.DOCTYPE,tagName))).arg("String_Node_Str",tagServices).arg("String_Node_Str",subprojectId).arg("String_Node_Str",contextSubprojectId);
}
Program: 20088
Project: 20088
Buggy source:
@GET @Path("String_Node_Str") @Produces(MediaType.TEXT_HTML) public Object doGetTagsHTML(@PathParam("String_Node_Str") String serviceName,@QueryParam("String_Node_Str") String subprojectId) throws Exception {
  CoreSession session=SessionFactory.getSession(request);
  DocumentService docService=Framework.getService(DocumentService.class);
  String subprojectPathCriteria;
  if (subprojectId == null || subprojectId.length() == 0) {
    subprojectPathCriteria="String_Node_Str";
  }
 else {
    subprojectPathCriteria=DocumentService.NXQL_AND + SubprojectServiceImpl.buildCriteriaInSubprojectUsingPathFromId(subprojectId);
  }
  DocumentModel service=docService.find(session,new SoaNodeId(subprojectId,InformationService.DOCTYPE,serviceName));
  DocumentModelList tags=session.query("String_Node_Str" + "String_Node_Str" + "String_Node_Str" + TaggingFolder.DOCTYPE + DocumentService.NXQL_WHERE_NO_PROXY+ subprojectPathCriteria);
  Template view=getView("String_Node_Str");
  if (service != null) {
    view.arg("String_Node_Str",service);
  }
  return view.arg("String_Node_Str",tags).arg("String_Node_Str",subprojectId);
}

Fixed version (ground truth):
@GET @Path("String_Node_Str") @Produces(MediaType.TEXT_HTML) public Object doGetTagsHTML(@PathParam("String_Node_Str") String serviceName,@QueryParam("String_Node_Str") String subprojectId) throws Exception {
  CoreSession session=SessionFactory.getSession(request);
  DocumentService docService=Framework.getService(DocumentService.class);
  String subprojectPathCriteria;
  if (subprojectId == null || subprojectId.length() == 0) {
    subprojectPathCriteria="String_Node_Str";
  }
 else {
    subprojectPathCriteria=DocumentService.NXQL_AND + SubprojectServiceImpl.buildCriteriaInSubprojectUsingPathFromId(subprojectId);
  }
  DocumentModel service=docService.find(session,new SoaNodeId(subprojectId,InformationService.DOCTYPE,serviceName));
  DocumentModelList tags=session.query("String_Node_Str" + "String_Node_Str" + "String_Node_Str" + TaggingFolder.DOCTYPE + DocumentService.NXQL_WHERE_NO_PROXY+ subprojectPathCriteria);
  Template view=getView("String_Node_Str");
  view.arg("String_Node_Str",service);
  return view.arg("String_Node_Str",tags).arg("String_Node_Str",subprojectId);
}
Program: 20089
Project: 20089
Buggy source:
@GET @Path("String_Node_Str") @Produces(MediaType.TEXT_HTML) public Object doGetByPathHTML(@PathParam("String_Node_Str") String serviceName,@QueryParam("String_Node_Str") String subprojectId) throws Exception {
  CoreSession session=SessionFactory.getSession(request);
  DocumentService docService=Framework.getService(DocumentService.class);
  subprojectId=SubprojectServiceImpl.getSubprojectIdOrCreateDefault(session,subprojectId);
  DocumentModel service=docService.find(session,new SoaNodeId(subprojectId,InformationService.DOCTYPE,serviceName));
  Template view=getView("String_Node_Str");
  if (service != null) {
    List<DocumentModel> actualImpls=new java.util.ArrayList<DocumentModel>();
    List<DocumentModel> mockImpls=session.query(DocumentService.NXQL_SELECT_FROM + ServiceImplementation.DOCTYPE + DocumentService.NXQL_WHERE+ "String_Node_Str"+ DocumentService.NXQL_AND+ "String_Node_Str"+ service.getId()+ "String_Node_Str"+ DocumentService.NXQL_AND+ ServiceImplementation.XPATH_ISMOCK+ "String_Node_Str");
    if (!mockImpls.isEmpty()) {
      actualImpls=session.query(DocumentService.NXQL_SELECT_FROM + ServiceImplementation.DOCTYPE + DocumentService.NXQL_WHERE_NO_PROXY+ DocumentService.NXQL_AND+ "String_Node_Str"+ toLiteral(getIds(mockImpls)));
    }
    view=view.arg("String_Node_Str",service).arg("String_Node_Str",actualImpls).arg("String_Node_Str",mockImpls).arg("String_Node_Str",service.getAdapter(SoaNodeAdapter.class)).arg("String_Node_Str",subprojectId);
  }
  return view;
}

Fixed version (ground truth):
@GET @Path("String_Node_Str") @Produces(MediaType.TEXT_HTML) public Object doGetByPathHTML(@PathParam("String_Node_Str") String serviceName,@QueryParam("String_Node_Str") String subprojectId,@QueryParam("String_Node_Str") String contextSubprojectId) throws Exception {
  CoreSession session=SessionFactory.getSession(request);
  DocumentService docService=Framework.getService(DocumentService.class);
  subprojectId=SubprojectServiceImpl.getSubprojectIdOrCreateDefault(session,subprojectId);
  DocumentModel service=docService.find(session,new SoaNodeId(subprojectId,InformationService.DOCTYPE,serviceName));
  Template view=getView("String_Node_Str");
  if (service != null) {
    List<DocumentModel> actualImpls=new java.util.ArrayList<DocumentModel>();
    List<DocumentModel> mockImpls=session.query(DocumentService.NXQL_SELECT_FROM + ServiceImplementation.DOCTYPE + DocumentService.NXQL_WHERE+ "String_Node_Str"+ DocumentService.NXQL_AND+ "String_Node_Str"+ service.getId()+ "String_Node_Str"+ DocumentService.NXQL_AND+ ServiceImplementation.XPATH_ISMOCK+ "String_Node_Str");
    if (!mockImpls.isEmpty()) {
      actualImpls=session.query(DocumentService.NXQL_SELECT_FROM + ServiceImplementation.DOCTYPE + DocumentService.NXQL_WHERE_NO_PROXY+ DocumentService.NXQL_AND+ "String_Node_Str"+ toLiteral(getIds(mockImpls)));
    }
    view=view.arg("String_Node_Str",service).arg("String_Node_Str",actualImpls).arg("String_Node_Str",mockImpls).arg("String_Node_Str",service.getAdapter(SoaNodeAdapter.class)).arg("String_Node_Str",subprojectId).arg("String_Node_Str",contextSubprojectId);
  }
  return view;
}
Program: 20090
Project: 20090
Buggy source:
@Override public void handleEvent(Event event) throws ClientException {
  EventContext context=event.getContext();
  if (!(context instanceof DocumentEventContext)) {
    return;
  }
  DocumentEventContext documentContext=(DocumentEventContext)context;
  DocumentModel sourceDocument=documentContext.getSourceDocument();
  CoreSession documentManager=documentContext.getCoreSession();
  if (sourceDocument.isVersion()) {
    return;
  }
  DocumentModel previousDocumentModel=(DocumentModel)documentContext.getProperty("String_Node_Str");
  match(documentManager,sourceDocument,"String_Node_Str");
}

Fixed version (ground truth):
@Override public void handleEvent(Event event) throws ClientException {
  EventContext context=event.getContext();
  if (!(context instanceof DocumentEventContext)) {
    return;
  }
  DocumentEventContext documentContext=(DocumentEventContext)context;
  DocumentModel sourceDocument=documentContext.getSourceDocument();
  CoreSession documentManager=documentContext.getCoreSession();
  if (sourceDocument.isVersion()) {
    return;
  }
  DocumentModel previousDocumentModel=(DocumentModel)documentContext.getProperty("String_Node_Str");
  match(documentManager,sourceDocument,ContextVisibility.DEPTH.getValue());
}
Program: 20091
Project: 20091
Buggy source:
@Test public void testCorrelationDiscovery() throws Exception {
  List<SoaNodeId> parentDocuments=new LinkedList<SoaNodeId>();
  SoaNodeId deliverableId=new SoaNodeId(Deliverable.DOCTYPE,"String_Node_Str");
  parentDocuments.add(deliverableId);
  SoaNodeId serviceImplId=new SoaNodeId(ServiceImplementation.DOCTYPE,"String_Node_Str");
  parentDocuments.add(serviceImplId);
  SoaNodeId softwareCompId=new SoaNodeId(SoftwareComponent.DOCTYPE,"String_Node_Str");
  parentDocuments.add(softwareCompId);
  discoveryService.runDiscovery(documentManager,discoveredEndpointId,null,parentDocuments,"String_Node_Str");
  documentManager.save();
  DocumentModel foundSoftComp=documentService.find(documentManager,softwareCompId);
  Assert.assertTrue(softwareCompId + "String_Node_Str" + deliverableId,documentService.hasChild(documentManager,foundSoftComp,deliverableId));
  DocumentModel foundDeliverable=documentService.find(documentManager,deliverableId);
  Assert.assertTrue(deliverableId + "String_Node_Str" + serviceImplId,documentService.hasChild(documentManager,foundDeliverable,serviceImplId));
  DocumentModel foundServiceImpl=documentService.find(documentManager,serviceImplId);
  Assert.assertTrue(serviceImplId + "String_Node_Str" + discoveredEndpointId,documentService.hasChild(documentManager,foundServiceImpl,discoveredEndpointId));
  Assert.assertFalse(foundSoftComp + "String_Node_Str" + discoveredEndpointId,documentService.hasChild(documentManager,foundSoftComp,discoveredEndpointId));
}

Fixed version (ground truth):
@Test public void testCorrelationDiscovery() throws Exception {
  List<SoaNodeId> parentDocuments=new LinkedList<SoaNodeId>();
  SoaNodeId deliverableId=new SoaNodeId(Deliverable.DOCTYPE,"String_Node_Str");
  parentDocuments.add(deliverableId);
  SoaNodeId serviceImplId=new SoaNodeId(ServiceImplementation.DOCTYPE,"String_Node_Str");
  parentDocuments.add(serviceImplId);
  SoaNodeId softwareCompId=new SoaNodeId(SoftwareComponent.DOCTYPE,"String_Node_Str");
  parentDocuments.add(softwareCompId);
  discoveryService.runDiscovery(documentManager,discoveredEndpointId,null,parentDocuments,ContextVisibility.DEPTH.getValue());
  documentManager.save();
  DocumentModel foundSoftComp=documentService.find(documentManager,softwareCompId);
  Assert.assertTrue(softwareCompId + "String_Node_Str" + deliverableId,documentService.hasChild(documentManager,foundSoftComp,deliverableId));
  DocumentModel foundDeliverable=documentService.find(documentManager,deliverableId);
  Assert.assertTrue(deliverableId + "String_Node_Str" + serviceImplId,documentService.hasChild(documentManager,foundDeliverable,serviceImplId));
  DocumentModel foundServiceImpl=documentService.find(documentManager,serviceImplId);
  Assert.assertTrue(serviceImplId + "String_Node_Str" + discoveredEndpointId,documentService.hasChild(documentManager,foundServiceImpl,discoveredEndpointId));
  Assert.assertFalse(foundSoftComp + "String_Node_Str" + discoveredEndpointId,documentService.hasChild(documentManager,foundSoftComp,discoveredEndpointId));
}
Program: 20092
Project: 20092
Buggy source:
@Test public void testMerge() throws Exception {
  properties=new HashMap<String,Object>();
  properties.put("String_Node_Str","String_Node_Str");
  discoveryService.runDiscovery(documentManager,discoveredEndpointId,properties,null,"String_Node_Str");
  documentManager.save();
  DocumentModel foundEndpoint=documentService.find(documentManager,discoveredEndpointId);
  Assert.assertEquals("String_Node_Str",foundEndpoint.getPropertyValue(Endpoint.XPATH_URL));
  Assert.assertEquals("String_Node_Str",foundEndpoint.getPropertyValue("String_Node_Str"));
}

Fixed version (ground truth):
@Test public void testMerge() throws Exception {
  properties=new HashMap<String,Object>();
  properties.put("String_Node_Str","String_Node_Str");
  discoveryService.runDiscovery(documentManager,discoveredEndpointId,properties,null,ContextVisibility.DEPTH.getValue());
  documentManager.save();
  DocumentModel foundEndpoint=documentService.find(documentManager,discoveredEndpointId);
  Assert.assertEquals("String_Node_Str",foundEndpoint.getPropertyValue(Endpoint.XPATH_URL));
  Assert.assertEquals("String_Node_Str",foundEndpoint.getPropertyValue("String_Node_Str"));
}
Program: 20093
Project: 20093
Buggy source:
@Test public void testSimpleDiscovery() throws Exception {
  discoveredEndpointId=new EndpointId("String_Node_Str","String_Node_Str");
  properties=new HashMap<String,Object>();
  properties.put(Endpoint.XPATH_TITLE,"String_Node_Str");
  discoveryService.runDiscovery(documentManager,discoveredEndpointId,properties,null,"String_Node_Str");
  documentManager.save();
  foundEndpoint=documentService.find(documentManager,discoveredEndpointId);
  Assert.assertNotNull("String_Node_Str",foundEndpoint);
  properties.put(Endpoint.XPATH_URL,"String_Node_Str");
  for (  Entry<String,Object> property : properties.entrySet()) {
    Assert.assertEquals("String_Node_Str" + property.getKey() + "String_Node_Str",property.getValue(),foundEndpoint.getPropertyValue(property.getKey()));
  }
}

Fixed version (ground truth):
@Test public void testSimpleDiscovery() throws Exception {
  discoveredEndpointId=new EndpointId("String_Node_Str","String_Node_Str");
  properties=new HashMap<String,Object>();
  properties.put(Endpoint.XPATH_TITLE,"String_Node_Str");
  discoveryService.runDiscovery(documentManager,discoveredEndpointId,properties,null,ContextVisibility.DEPTH.getValue());
  documentManager.save();
  foundEndpoint=documentService.find(documentManager,discoveredEndpointId);
  Assert.assertNotNull("String_Node_Str",foundEndpoint);
  properties.put(Endpoint.XPATH_URL,"String_Node_Str");
  for (  Entry<String,Object> property : properties.entrySet()) {
    Assert.assertEquals("String_Node_Str" + property.getKey() + "String_Node_Str",property.getValue(),foundEndpoint.getPropertyValue(property.getKey()));
  }
}
Program: 20094
Project: 20094
Buggy source:
@Test public void testInvalidDiscovery() throws Exception {
  properties=new HashMap<String,Object>();
  properties.put(Endpoint.XPATH_URL,"String_Node_Str");
  try {
    discoveryService.runDiscovery(documentManager,endpointId,properties,null,"String_Node_Str");
    Assert.fail("String_Node_Str");
  }
 catch (  ModelIntegrityException e) {
    logger.info("String_Node_Str");
  }
  properties=new HashMap<String,Object>();
  properties.put(Endpoint.XPATH_SOANAME,"String_Node_Str");
  try {
    discoveryService.runDiscovery(documentManager,endpointId,properties,null,"String_Node_Str");
    Assert.fail("String_Node_Str");
  }
 catch (  ModelIntegrityException e) {
    logger.info("String_Node_Str" + e.getMessage());
  }
}

Fixed version (ground truth):
@Test public void testInvalidDiscovery() throws Exception {
  properties=new HashMap<String,Object>();
  properties.put(Endpoint.XPATH_URL,"String_Node_Str");
  try {
    discoveryService.runDiscovery(documentManager,endpointId,properties,null,ContextVisibility.DEPTH.getValue());
    Assert.fail("String_Node_Str");
  }
 catch (  ModelIntegrityException e) {
    logger.info("String_Node_Str");
  }
  properties=new HashMap<String,Object>();
  properties.put(Endpoint.XPATH_SOANAME,"String_Node_Str");
  try {
    discoveryService.runDiscovery(documentManager,endpointId,properties,null,ContextVisibility.DEPTH.getValue());
    Assert.fail("String_Node_Str");
  }
 catch (  ModelIntegrityException e) {
    logger.info("String_Node_Str" + e.getMessage());
  }
}
Program: 20095
Project: 20095
Buggy source:
@GET @Produces(MediaType.TEXT_HTML) public Object doGetHTML(@QueryParam("String_Node_Str") String subprojectId) throws Exception {
  CoreSession session=SessionFactory.getSession(request);
  Map<String,Map<String,IndicatorValue>> indicatorsByCategory=computeIndicators(subprojectId);
  HashMap<String,Integer> nbMap=new HashMap<String,Integer>();
  HashMap<String,Integer> percentMap=new HashMap<String,Integer>();
  for (  Map<String,IndicatorValue> indicatorCategory : indicatorsByCategory.values()) {
    for (    Entry<String,IndicatorValue> indicator : indicatorCategory.entrySet()) {
      if (indicator.getValue().getCount() != -1) {
        nbMap.put(indicator.getKey(),indicator.getValue().getCount());
      }
      if (indicator.getValue().getPercentage() != -1) {
        percentMap.put(indicator.getKey(),indicator.getValue().getPercentage());
      }
    }
  }
  return getView("String_Node_Str").arg("String_Node_Str",nbMap).arg("String_Node_Str",percentMap).arg("String_Node_Str",subprojectId);
}

Fixed version (ground truth):
@GET @Produces(MediaType.TEXT_HTML) public Object doGetHTML(@QueryParam("String_Node_Str") String subprojectId) throws Exception {
  CoreSession session=SessionFactory.getSession(request);
  if ("String_Node_Str".equals(subprojectId)) {
    subprojectId=null;
  }
  Map<String,Map<String,IndicatorValue>> indicatorsByCategory=computeIndicators(subprojectId);
  HashMap<String,Integer> nbMap=new HashMap<String,Integer>();
  HashMap<String,Integer> percentMap=new HashMap<String,Integer>();
  for (  Map<String,IndicatorValue> indicatorCategory : indicatorsByCategory.values()) {
    for (    Entry<String,IndicatorValue> indicator : indicatorCategory.entrySet()) {
      if (indicator.getValue().getCount() != -1) {
        nbMap.put(indicator.getKey(),indicator.getValue().getCount());
      }
      if (indicator.getValue().getPercentage() != -1) {
        percentMap.put(indicator.getKey(),indicator.getValue().getPercentage());
      }
    }
  }
  return getView("String_Node_Str").arg("String_Node_Str",nbMap).arg("String_Node_Str",percentMap).arg("String_Node_Str",subprojectId);
}
Program: 20096
Project: 20096
Buggy source:
@Override public void computeTdb(Tdr tdr){
  TdrTdb tdrTdb=tdr.getTdrTdb();
  tdrTdb.setMontantDisponible(tdrTdb.getDotationGlobale() - tdrTdb.getSommeUtilisee());
  List<Projet> projets=tdr.getProjets();
  double sommeUtilisee=0;
  int nbBeneficiaires=0;
  int nbAdultesIsoles=0;
  int nbEnfants=0;
  int nbJeunes=0;
  int nbSeniors=0;
  for (  Projet projet : projets) {
    if ("String_Node_Str".equals(projet.getStatus())) {
      sommeUtilisee=sommeUtilisee + projet.getTotalBenefs().getMontantApv();
      nbBeneficiaires=nbBeneficiaires + projet.getTotalBenefs().getNbBeneficiaires();
      nbAdultesIsoles=nbAdultesIsoles + projet.getAdultesIsolesBenefs().getNbBeneficiaires();
      nbEnfants=nbEnfants + projet.getEnfantsBenefs().getNbBeneficiaires();
      nbJeunes=nbJeunes + projet.getJeunesBenefs().getNbBeneficiaires();
      nbSeniors=nbSeniors + projet.getSeniorsBenefs().getNbBeneficiaires();
    }
  }
  tdrTdb.setNbAdultesIsoles(nbAdultesIsoles);
  tdrTdb.setNbEnfants(nbEnfants);
  tdrTdb.setNbJeunes(nbJeunes);
  tdrTdb.setNbSeniors(nbSeniors);
  tdrTdb.setSommeUtilisee(sommeUtilisee);
  tdrTdb.setMontantDisponible(tdrTdb.getDotationGlobale() - tdrTdb.getSommeUtilisee());
  tdrTdb.setNbBeneficiairesApv(nbBeneficiaires);
  this.update(tdr);
  this.publish(tdr);
}

Fixed version (ground truth):
@Override public void computeTdb(Tdr tdr){
  TdrTdb tdrTdb=tdr.getTdrTdb();
  tdrTdb.setMontantDisponible(tdrTdb.getDotationGlobale() - tdrTdb.getSommeUtilisee());
  List<Projet> projets=tdr.getProjets();
  double sommeUtilisee=0;
  int nbBeneficiaires=0;
  int nbAdultesIsoles=0;
  int nbEnfants=0;
  int nbJeunes=0;
  int nbSeniors=0;
  for (  Projet projet : projets) {
    if ("String_Node_Str".equals(projet.getStatus())) {
      sommeUtilisee=sommeUtilisee + projet.getTotalBenefs().getMontantApv();
      nbBeneficiaires=nbBeneficiaires + projet.getTotalBenefs().getNbBeneficiaires();
      nbAdultesIsoles=nbAdultesIsoles + projet.getAdultesIsolesBenefs().getNbBeneficiaires();
      nbEnfants=nbEnfants + projet.getEnfantsBenefs().getNbBeneficiaires();
      nbJeunes=nbJeunes + projet.getJeunesBenefs().getNbBeneficiaires();
      nbSeniors=nbSeniors + projet.getSeniorsBenefs().getNbBeneficiaires();
    }
  }
  tdrTdb.setNbAdultesIsoles(nbAdultesIsoles);
  tdrTdb.setNbEnfants(nbEnfants);
  tdrTdb.setNbJeunes(nbJeunes);
  tdrTdb.setNbSeniors(nbSeniors);
  tdrTdb.setSommeUtilisee(sommeUtilisee);
  tdrTdb.setMontantDisponible(tdrTdb.getDotationGlobale() - tdrTdb.getSommeUtilisee());
  tdrTdb.setNbBeneficiairesApv(nbBeneficiaires);
  tdr.setVille("String_Node_Str");
  tdrDao.update(tdr);
  this.publish(tdr);
}
Program: 20097
Project: 20097
Buggy source:
@Override public void computeTdb(Tdr tdr){
  TdrTdb tdrTdb=tdr.getTdrTdb();
  tdrTdb.setMontantDisponible(tdrTdb.getDotationGlobale() - tdrTdb.getSommeUtilisee());
  List<Projet> projets=tdr.getProjets();
  double sommeUtilisee=0;
  int nbBeneficiaires=0;
  int nbAdultesIsoles=0;
  int nbEnfants=0;
  int nbJeunes=0;
  int nbSeniors=0;
  for (  Projet projet : projets) {
    if ("String_Node_Str".equals(projet.getStatus())) {
      sommeUtilisee=sommeUtilisee + projet.getTotalBenefs().getMontantApv();
      nbBeneficiaires=nbBeneficiaires + projet.getTotalBenefs().getNbBeneficiaires();
      nbAdultesIsoles=nbAdultesIsoles + projet.getAdultesIsolesBenefs().getNbBeneficiaires();
      nbEnfants=nbEnfants + projet.getEnfantsBenefs().getNbBeneficiaires();
      nbJeunes=nbJeunes + projet.getJeunesBenefs().getNbBeneficiaires();
      nbSeniors=nbSeniors + projet.getSeniorsBenefs().getNbBeneficiaires();
    }
  }
  tdrTdb.setNbAdultesIsoles(nbAdultesIsoles);
  tdrTdb.setNbEnfants(nbEnfants);
  tdrTdb.setNbJeunes(nbJeunes);
  tdrTdb.setNbSeniors(nbSeniors);
  tdrTdb.setSommeUtilisee(sommeUtilisee);
  tdrTdb.setMontantDisponible(tdrTdb.getDotationGlobale() - tdrTdb.getSommeUtilisee());
  tdrTdb.setNbBeneficiairesApv(nbBeneficiaires);
  tdr.setVille("String_Node_Str");
  tdrDao.update(tdr);
  this.publish(tdr);
}

Fixed version (ground truth):
@Override public void computeTdb(Tdr tdr){
  TdrTdb tdrTdb=tdr.getTdrTdb();
  tdrTdb.setMontantDisponible(tdrTdb.getDotationGlobale() - tdrTdb.getSommeUtilisee());
  List<Projet> projets=tdr.getProjets();
  double sommeUtilisee=0;
  int nbBeneficiaires=0;
  int nbAdultesIsoles=0;
  int nbEnfants=0;
  int nbJeunes=0;
  int nbSeniors=0;
  for (  Projet projet : projets) {
    if ("String_Node_Str".equals(projet.getStatus())) {
      sommeUtilisee=sommeUtilisee + projet.getTotalBenefs().getMontantApv();
      nbBeneficiaires=nbBeneficiaires + projet.getTotalBenefs().getNbBeneficiaires();
      nbAdultesIsoles=nbAdultesIsoles + projet.getAdultesIsolesBenefs().getNbBeneficiaires();
      nbEnfants=nbEnfants + projet.getEnfantsBenefs().getNbBeneficiaires();
      nbJeunes=nbJeunes + projet.getJeunesBenefs().getNbBeneficiaires();
      nbSeniors=nbSeniors + projet.getSeniorsBenefs().getNbBeneficiaires();
    }
  }
  tdrTdb.setNbAdultesIsoles(nbAdultesIsoles);
  tdrTdb.setNbEnfants(nbEnfants);
  tdrTdb.setNbJeunes(nbJeunes);
  tdrTdb.setNbSeniors(nbSeniors);
  tdrTdb.setSommeUtilisee(sommeUtilisee);
  tdrTdb.setMontantDisponible(tdrTdb.getDotationGlobale() - tdrTdb.getSommeUtilisee());
  tdrTdb.setNbBeneficiairesApv(nbBeneficiaires);
  tdrDao.update(tdr);
  this.publish(tdr);
}
Program: 20098
Project: 20098
Buggy source:
@Override public InformationAPV createOrUpdateInformationApv(String identifiantClient,String bilanLibelle,Integer nombre,Integer bilanAnnee) throws Exception {
  if (!InformationAPV.checkBilanLibelleValue(bilanLibelle)) {
    throw new IllegalArgumentException("String_Node_Str" + InformationAPV.BILAN_LIBELLE_ADULTESISOLES + "String_Node_Str"+ InformationAPV.BILAN_LIBELLE_FAMILLES+ "String_Node_Str"+ InformationAPV.BILAN_LIBELLE_JEUNES+ "String_Node_Str"+ InformationAPV.BILAN_LIBELLE_SENIORS);
  }
  if (getClient(identifiantClient) == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  EntityManager entityManager=database.get();
  InformationAPV informationAPV=null;
  informationAPV=this.getInformationAPV(identifiantClient,bilanLibelle,String.valueOf(bilanAnnee));
  if (informationAPV == null) {
    informationAPV=new InformationAPV();
  }
  try {
    informationAPV.setIdentifiantClient(identifiantClient);
    informationAPV.setBilanLibelle(bilanLibelle);
    informationAPV.setNombre(nombre);
    informationAPV.setBilanAnnee(bilanAnnee);
    entityManager.getTransaction().begin();
    entityManager.persist(informationAPV);
    entityManager.getTransaction().commit();
  }
 catch (  Exception ex) {
    entityManager.getTransaction().rollback();
    LOG.log(Level.SEVERE,"String_Node_Str" + ex.getMessage(),ex);
    throw ex;
  }
  return informationAPV;
}

Fixed version (ground truth):
@Override public InformationAPV createOrUpdateInformationApv(String identifiantClient,String bilanLibelle,Integer nombre,Integer bilanAnnee) throws Exception {
  if (!InformationAPV.checkBilanLibelleValue(bilanLibelle)) {
    throw new IllegalArgumentException("String_Node_Str" + InformationAPV.BILAN_LIBELLE_ADULTESISOLES + "String_Node_Str"+ InformationAPV.BILAN_LIBELLE_ENFANTS+ "String_Node_Str"+ InformationAPV.BILAN_LIBELLE_JEUNES+ "String_Node_Str"+ InformationAPV.BILAN_LIBELLE_SENIORS);
  }
  if (getClient(identifiantClient) == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  EntityManager entityManager=database.get();
  InformationAPV informationAPV=null;
  informationAPV=this.getInformationAPV(identifiantClient,bilanLibelle,String.valueOf(bilanAnnee));
  if (informationAPV == null) {
    informationAPV=new InformationAPV();
  }
  try {
    informationAPV.setIdentifiantClient(identifiantClient);
    informationAPV.setBilanLibelle(bilanLibelle);
    informationAPV.setNombre(nombre);
    informationAPV.setBilanAnnee(bilanAnnee);
    entityManager.getTransaction().begin();
    entityManager.persist(informationAPV);
    entityManager.getTransaction().commit();
  }
 catch (  Exception ex) {
    entityManager.getTransaction().rollback();
    LOG.log(Level.SEVERE,"String_Node_Str" + ex.getMessage(),ex);
    throw ex;
  }
  return informationAPV;
}
Program: 20099
Project: 20099
Buggy source:
/** 
 * Check if the value of bilan libelle can be used
 * @param bilanLibelle
 * @return ture if the value can be used, false otherwise
 */
public static boolean checkBilanLibelleValue(String bilanLibelle){
  if (BILAN_LIBELLE_ADULTESISOLES.equals(bilanLibelle) || BILAN_LIBELLE_FAMILLES.equals(bilanLibelle) || BILAN_LIBELLE_JEUNES.equals(bilanLibelle)|| BILAN_LIBELLE_SENIORS.equals(bilanLibelle)) {
    return true;
  }
 else {
    return false;
  }
}

Fixed version (ground truth):
/** 
 * Check if the value of bilan libelle can be used
 * @param bilanLibelle
 * @return ture if the value can be used, false otherwise
 */
public static boolean checkBilanLibelleValue(String bilanLibelle){
  if (BILAN_LIBELLE_ADULTESISOLES.equals(bilanLibelle) || BILAN_LIBELLE_ENFANTS.equals(bilanLibelle) || BILAN_LIBELLE_JEUNES.equals(bilanLibelle)|| BILAN_LIBELLE_SENIORS.equals(bilanLibelle)) {
    return true;
  }
 else {
    return false;
  }
}
Program: 20100
Project: 20100
Buggy source:
@Override public void computeTdb(Tdr tdr){
  TdrTdb tdrTdb=tdr.getTdrTdb();
  tdrTdb.setMontantDisponible(tdrTdb.getDotationGlobale() - tdrTdb.getSommeUtilisee());
  List<Projet> projets=tdr.getProjets();
  double sommeUtilisee=0;
  int nbBeneficiaires=0;
  int nbAdultesIsoles=0;
  int nbEnfants=0;
  int nbJeunes=0;
  int nbSeniors=0;
  for (  Projet projet : projets) {
    if ("String_Node_Str".equals(projet.getStatus())) {
      sommeUtilisee=sommeUtilisee + projet.getTotalBenefs().getMontantApv();
      nbBeneficiaires=nbBeneficiaires + projet.getTotalBenefs().getNbBeneficiaires();
      nbAdultesIsoles=nbAdultesIsoles + projet.getAdultesIsolesBenefs().getNbBeneficiaires();
      nbEnfants=nbEnfants + projet.getEnfantsBenefs().getNbBeneficiaires();
      nbJeunes=nbJeunes + projet.getJeunesBenefs().getNbBeneficiaires();
      nbSeniors=nbSeniors + projet.getSeniorsBenefs().getNbBeneficiaires();
    }
  }
  tdrTdb.setNbAdultesIsoles(nbAdultesIsoles);
  tdrTdb.setNbEnfants(nbEnfants);
  tdrTdb.setNbJeunes(nbJeunes);
  tdrTdb.setNbSeniors(nbSeniors);
  tdrTdb.setSommeUtilisee(sommeUtilisee);
  tdrTdb.setMontantDisponible(tdrTdb.getDotationGlobale() - tdrTdb.getSommeUtilisee());
  tdrTdb.setNbBeneficiairesApv(nbBeneficiaires);
  tdrDao.update(tdr);
  this.publish(tdr);
}

Fixed version (ground truth):
@Override public void computeTdb(Tdr tdr){
  TdrTdb tdrTdb=tdr.getTdrTdb();
  tdrTdb.setMontantDisponible(tdrTdb.getDotationGlobale() - tdrTdb.getSommeUtilisee());
  List<Projet> projets=tdr.getProjets();
  double sommeUtilisee=0;
  int nbBeneficiaires=0;
  int nbAdultesIsoles=0;
  int nbEnfants=0;
  int nbJeunes=0;
  int nbSeniors=0;
  for (  Projet projet : projets) {
    if ("String_Node_Str".equals(projet.getStatus())) {
      sommeUtilisee=sommeUtilisee + projet.getTotalBenefs().getMontantApv();
      nbBeneficiaires=nbBeneficiaires + projet.getTotalBenefs().getNbBeneficiaires();
      nbAdultesIsoles=nbAdultesIsoles + projet.getAdultesIsolesBenefs().getNbBeneficiaires();
      nbEnfants=nbEnfants + projet.getEnfantsBenefs().getNbBeneficiaires();
      nbJeunes=nbJeunes + projet.getJeunesBenefs().getNbBeneficiaires();
      nbSeniors=nbSeniors + projet.getSeniorsBenefs().getNbBeneficiaires();
    }
  }
  tdrTdb.setNbAdultesIsoles(nbAdultesIsoles);
  tdrTdb.setNbEnfants(nbEnfants);
  tdrTdb.setNbJeunes(nbJeunes);
  tdrTdb.setNbSeniors(nbSeniors);
  tdrTdb.setSommeUtilisee(sommeUtilisee);
  tdrTdb.setMontantDisponible(tdrTdb.getDotationGlobale() - tdrTdb.getSommeUtilisee());
  tdrTdb.setNbBeneficiairesApv(nbBeneficiaires);
  this.update(tdr);
  this.publish(tdr);
}
Program: 20101
Project: 20101
Buggy source:
/** 
 * Get the InformationAPV with corresponding id
 * @param id
 * @return The informationAPV or null
 */
private InformationAPV getInformationAPV(String identifiantClient,String bilanLibelle,String bilanAnnee){
  try {
    Query query=this.database.get().createQuery("String_Node_Str");
    query.setParameter("String_Node_Str",identifiantClient);
    query.setParameter("String_Node_Str",bilanLibelle);
    query.setParameter("String_Node_Str",bilanAnnee);
    InformationAPV informationAPV=(InformationAPV)query.getSingleResult();
    return informationAPV;
  }
 catch (  Exception ex) {
    LOG.log(Level.SEVERE,"String_Node_Str" + ex.getMessage(),ex);
    return null;
  }
}

Fixed version (ground truth):
/** 
 * Get the InformationAPV with corresponding id
 * @param id
 * @return The informationAPV or null
 */
private InformationAPV getInformationAPV(String identifiantClient,String bilanLibelle,String bilanAnnee){
  try {
    Query query=this.database.get().createQuery("String_Node_Str");
    query.setParameter("String_Node_Str",identifiantClient);
    query.setParameter("String_Node_Str",bilanLibelle);
    query.setParameter("String_Node_Str",Integer.valueOf(bilanAnnee));
    InformationAPV informationAPV=(InformationAPV)query.getSingleResult();
    return informationAPV;
  }
 catch (  Exception ex) {
    LOG.log(Level.SEVERE,"String_Node_Str" + ex.getMessage(),ex);
    return null;
  }
}