nus-yam/ex-repair huggingface dataset:
Program: 189389
Project: 189389
Buggy source:
@Override public void copyTo(SearchFilter other){
  other.getIncludedSubmissions().clear();
  other.getIncludedSubmissions().addAll(this.includedSubmissions);
  other.getExcludedSubmissions().clear();
  other.getExcludedSubmissions().addAll(this.excludedSubmissions);
  other.getIncludedActionLogs().clear();
  other.getIncludedActionLogs().addAll(this.includedActionLogs);
  other.getExcludedActionLogs().clear();
  other.getExcludedActionLogs().addAll(this.excludedActionLogs);
  other.getSearchText().clear();
  other.getSearchText().addAll(this.searchText);
  other.getStates().clear();
  other.getStates().addAll(this.states);
  other.getAssignees().clear();
  other.getAssignees().addAll(this.assignees);
  other.getEmbargoTypes().clear();
  other.getEmbargoTypes().addAll(this.embargos);
  other.getGraduationSemesters().clear();
  other.getGraduationSemesters().addAll(this.semesters);
  other.getDegrees().clear();
  other.getDegrees().addAll(this.degrees);
  other.getDepartments().clear();
  other.getDepartments().addAll(this.departments);
  other.getColleges().clear();
  other.getColleges().addAll(this.colleges);
  other.getPrograms().clear();
  other.getPrograms().addAll(this.programs);
  other.getMajors().clear();
  other.getMajors().addAll(this.majors);
  other.getDocumentTypes().clear();
  other.getDocumentTypes().addAll(this.documentTypes);
  other.setUMIRelease(this.umiRelease);
  other.setDateRangeStart(this.rangeStart);
  other.setDateRangeEnd(this.rangeEnd);
}

Fixed version (ground truth):
@Override public void copyTo(SearchFilter other){
  other.getIncludedSubmissions().clear();
  other.getIncludedSubmissions().addAll(this.includedSubmissions);
  other.getExcludedSubmissions().clear();
  other.getExcludedSubmissions().addAll(this.excludedSubmissions);
  other.getIncludedActionLogs().clear();
  other.getIncludedActionLogs().addAll(this.includedActionLogs);
  other.getExcludedActionLogs().clear();
  other.getExcludedActionLogs().addAll(this.excludedActionLogs);
  other.getSearchText().clear();
  other.getSearchText().addAll(this.searchText);
  other.getStates().clear();
  other.getStates().addAll(this.states);
  other.getAssignees().clear();
  for (  Person assignee : this.assignees) {
    other.addAssignee(assignee);
  }
  other.getEmbargoTypes().clear();
  other.getEmbargoTypes().addAll(this.embargos);
  other.getGraduationSemesters().clear();
  other.getGraduationSemesters().addAll(this.semesters);
  other.getDegrees().clear();
  other.getDegrees().addAll(this.degrees);
  other.getDepartments().clear();
  other.getDepartments().addAll(this.departments);
  other.getColleges().clear();
  other.getColleges().addAll(this.colleges);
  other.getPrograms().clear();
  other.getPrograms().addAll(this.programs);
  other.getMajors().clear();
  other.getMajors().addAll(this.majors);
  other.getDocumentTypes().clear();
  other.getDocumentTypes().addAll(this.documentTypes);
  other.setUMIRelease(this.umiRelease);
  other.setDateRangeStart(this.rangeStart);
  other.setDateRangeEnd(this.rangeEnd);
}
Program: 189390
Project: 189390
Buggy source:
/** 
 * Download a back export. This may take a considerable amount of time, so we use play's asynchronous features to suspend the current thread until the next chunk of data is ready to be published.
 * @param packager The packager to use for the export.
 */
@Security(RoleType.REVIEWER) public static void batchExport(String packager){
  ActiveSearchFilter filter=Spring.getBeanOfType(ActiveSearchFilter.class);
  Cookie filterCookie=request.cookies.get(NAMES[SUBMISSION][ACTIVE_FILTER]);
  if (filterCookie != null && filterCookie.value != null && filterCookie.value.trim().length() > 0) {
    try {
      filter.decode(filterCookie.value);
    }
 catch (    RuntimeException re) {
      Logger.warn(re,"String_Node_Str" + filterCookie.value);
    }
  }
  Packager exportPackage=(Packager)Spring.getBean(packager);
  Logger.info("String_Node_Str",context.getPerson().getFormattedName(NameFormat.FIRST_LAST),context.getPerson().getId(),context.getPerson().getEmail(),exportPackage == null ? "String_Node_Str" : exportPackage.getBeanName(),filter == null ? "String_Node_Str" : filter.encode());
  ChunkStream stream=exportService.export(exportPackage,filter);
  response.contentType=stream.getContentType();
  response.setHeader("String_Node_Str",stream.getContentDisposition());
  while (stream.hasNextChunk()) {
    Promise<byte[]> nextChunk=stream.nextChunk();
    byte[] chunk=await(nextChunk);
    response.writeChunk(chunk);
  }
}

Fixed version (ground truth):
/** 
 * Download a back export. This may take a considerable amount of time, so we use play's asynchronous features to suspend the current thread until the next chunk of data is ready to be published.
 * @param packager The packager to use for the export.
 */
@Security(RoleType.REVIEWER) public static void batchExport(String packager){
  ActiveSearchFilter filter=Spring.getBeanOfType(ActiveSearchFilter.class);
  Cookie filterCookie=request.cookies.get(NAMES[SUBMISSION][ACTIVE_FILTER]);
  if (filterCookie != null && filterCookie.value != null && filterCookie.value.trim().length() > 0) {
    try {
      filter.decode(filterCookie.value);
    }
 catch (    RuntimeException re) {
      Logger.warn(re,"String_Node_Str" + filterCookie.value);
    }
  }
  Packager exportPackage=(Packager)Spring.getBean(packager);
  Logger.info("String_Node_Str",context.getPerson().getFormattedName(NameFormat.FIRST_LAST),context.getPerson().getId(),context.getPerson().getEmail(),exportPackage == null ? "String_Node_Str" : exportPackage.getBeanName(),filter == null ? "String_Node_Str" : filter.encode());
  ChunkStream stream=exportService.export(exportPackage,filter);
  response.contentType=stream.getContentType();
  response.setHeader("String_Node_Str",stream.getContentDisposition());
  response.setHeader("String_Node_Str","String_Node_Str");
  response.setHeader("String_Node_Str","String_Node_Str");
  while (stream.hasNextChunk()) {
    Promise<byte[]> nextChunk=stream.nextChunk();
    byte[] chunk=await(nextChunk);
    response.writeChunk(chunk);
  }
}
Program: 189392
Project: 189392
Buggy source:
/** 
 * A method to send the Advisor Approval Email
 * @param id (The submission id)
 */
@Security(RoleType.REVIEWER) public static void sendAdvisorEmail(Long id){
  Submission submission=subRepo.findSubmission(id);
  String advisorEmail=submission.getCommitteeContactEmail();
  EmailTemplate template=settingRepo.findEmailTemplateByName("String_Node_Str");
  VireoEmail email=emailService.createEmail();
  email.getTo().clear();
  email.getCc().clear();
  email.getBcc().clear();
  email.addTo(advisorEmail);
  email.setTemplate(template);
  email.addParameters(submission);
  email.addParameter("String_Node_Str",getAdvisorURL(submission));
  email.setLogOnCompletion(context.getPerson(),submission);
  email.setSuccessLogMessage("String_Node_Str" + advisorEmail);
  email.setFailureLogMessage("String_Node_Str" + advisorEmail);
  emailService.sendEmail(email,false);
  view();
}

Fixed version (ground truth):
/** 
 * A method to send the Advisor Approval Email
 * @param id (The submission id)
 */
@Security(RoleType.REVIEWER) public static void sendAdvisorEmail(Long id){
  Submission submission=subRepo.findSubmission(id);
  String advisorEmail=submission.getCommitteeContactEmail();
  EmailTemplate template=settingRepo.findEmailTemplateByName("String_Node_Str");
  VireoEmail email=emailService.createEmail();
  email.getTo().clear();
  email.getCc().clear();
  email.getBcc().clear();
  email.addTo(advisorEmail);
  email.setFrom(context.getPerson());
  email.setReplyTo(context.getPerson());
  email.setTemplate(template);
  email.addParameters(submission);
  email.addParameter("String_Node_Str",getAdvisorURL(submission));
  email.setLogOnCompletion(context.getPerson(),submission);
  email.setSuccessLogMessage("String_Node_Str" + advisorEmail);
  email.setFailureLogMessage("String_Node_Str" + advisorEmail);
  emailService.sendEmail(email,false);
  view();
}
Program: 189394
Project: 189394
Buggy source:
@Override public void addDocumentSubject(String subject){
  documentSubjects.add(subject);
}

Fixed version (ground truth):
@Override public void addDocumentSubject(String subject){
  documentSubjects.add(subject);
  documentSubjectsChanged=true;
}
Program: 189395
Project: 189395
Buggy source:
@Override public JpaSubmissionImpl save(){
  assertReviewerOrOwner(submitter);
  if (pendingLogs.size() > 0) {
    lastActionLogEntry=pendingLogs.get(pendingLogs.size() - 1).getEntry();
    lastActionLogDate=pendingLogs.get(pendingLogs.size() - 1).getActionDate();
  }
  super.save();
  for (  ActionLog log : pendingLogs) {
    log.save();
  }
  pendingLogs.clear();
  return this;
}

Fixed version (ground truth):
@Override public JpaSubmissionImpl save(){
  assertReviewerOrOwner(submitter);
  if (documentSubjectsChanged) {
    String entry="String_Node_Str";
    if (documentSubjects.size() == 0)     entry="String_Node_Str";
 else {
      for (      String subject : documentSubjects) {
        if (entry.length() != 0)         entry+="String_Node_Str";
        entry+="String_Node_Str" + subject + "String_Node_Str";
      }
      entry="String_Node_Str" + entry;
    }
    generateLog(entry,false);
    documentSubjectsChanged=false;
  }
  if (pendingLogs.size() > 0) {
    lastActionLogEntry=pendingLogs.get(pendingLogs.size() - 1).getEntry();
    lastActionLogDate=pendingLogs.get(pendingLogs.size() - 1).getActionDate();
  }
  super.save();
  for (  ActionLog log : pendingLogs) {
    log.save();
  }
  pendingLogs.clear();
  return this;
}
Program: 189396
Project: 189396
Buggy source:
@Override public void removeDocumentSubject(String subject){
  documentSubjects.remove(subject);
}

Fixed version (ground truth):
@Override public void removeDocumentSubject(String subject){
  documentSubjects.remove(subject);
  documentSubjectsChanged=true;
}
Program: 189399
Project: 189399
Buggy source:
/** 
 * Logged the user out by clearing their session and sending them to the application's index page.
 */
public static void logout(){
  AuthenticationMethod.Implicit method=null;
  try {
    String methodName=session.get("String_Node_Str");
    method=(AuthenticationMethod.Implicit)Spring.getBean(methodName);
  }
 catch (  RuntimeException re) {
  }
  session.clear();
  Logger.info("String_Node_Str",context.getPerson().getFormattedName(NameFormat.FIRST_LAST),context.getPerson().getId(),context.getPerson().getEmail());
  if (method != null) {
    ActionDefinition action=Router.reverse("String_Node_Str");
    action.absolute();
    String redirect=method.logout(request,action.url);
    if (redirect != null)     redirect(redirect);
  }
  Application.index();
}

Fixed version (ground truth):
/** 
 * Logged the user out by clearing their session and sending them to the application's index page.
 */
public static void logout(){
  AuthenticationMethod.Implicit method=null;
  try {
    String methodName=session.get("String_Node_Str");
    method=(AuthenticationMethod.Implicit)Spring.getBean(methodName);
  }
 catch (  RuntimeException re) {
  }
  session.clear();
  if (context != null && context.getPerson() != null)   Logger.info("String_Node_Str",context.getPerson().getFormattedName(NameFormat.FIRST_LAST),context.getPerson().getId(),context.getPerson().getEmail());
  if (method != null) {
    ActionDefinition action=Router.reverse("String_Node_Str");
    action.absolute();
    String redirect=method.logout(request,action.url);
    if (redirect != null)     redirect(redirect);
  }
  Application.index();
}
Program: 189400
Project: 189400
Buggy source:
/** 
 * Determine if the provided roles are valid for this given degree level of the submission.
 * @param sub The submission
 * @param roles The roles to validate.
 * @return True if valid, otherwise false.
 */
protected static boolean isValidRoleType(Submission sub,List<String> roles){
  List<CommitteeMemberRoleType> types=settingRepo.findAllCommitteeMemberRoleTypes(sub.getDegreeLevel());
  for (  String role : roles) {
    boolean found=false;
    for (    CommitteeMemberRoleType type : types) {
      if (type.getName().equals(type)) {
        found=true;
        break;
      }
    }
    if (!found)     return false;
  }
  return true;
}

Fixed version (ground truth):
/** 
 * Determine if the provided roles are valid for this given degree level of the submission.
 * @param sub The submission
 * @param roles The roles to validate.
 * @return True if valid, otherwise false.
 */
protected static boolean isValidRoleType(Submission sub,List<String> roles){
  List<CommitteeMemberRoleType> types=settingRepo.findAllCommitteeMemberRoleTypes(sub.getDegreeLevel());
  for (  String role : roles) {
    boolean found=false;
    for (    CommitteeMemberRoleType type : types) {
      if (type.getName().equals(role)) {
        found=true;
        break;
      }
    }
    if (!found)     return false;
  }
  return true;
}
Program: 189401
Project: 189401
Buggy source:
/** 
 * Validate the transient list for committee members. This method checks that all members have their first and last names
 * @param members List of maps for each committee member.
 */
public static boolean validateCommitteeMembers(Submission sub,List<TransientMember> members){
  boolean atLeastOneMember=false;
  int i=1;
  for (  TransientMember member : members) {
    if (isEmpty(member.firstName) && isEmpty(member.lastName)) {
      validation.addError("String_Node_Str" + i,"String_Node_Str");
    }
 else {
      atLeastOneMember=true;
    }
    if (isValidRoleType(sub,member.roles))     validation.addError("String_Node_Str" + i,"String_Node_Str");
  }
  if (!atLeastOneMember)   validation.addError("String_Node_Str","String_Node_Str");
  return true;
}

Fixed version (ground truth):
/** 
 * Validate the transient list for committee members. This method checks that all members have their first and last names
 * @param members List of maps for each committee member.
 */
public static boolean validateCommitteeMembers(Submission sub,List<TransientMember> members){
  boolean atLeastOneMember=false;
  int i=1;
  for (  TransientMember member : members) {
    if (isEmpty(member.firstName) && isEmpty(member.lastName)) {
      validation.addError("String_Node_Str" + i,"String_Node_Str");
    }
 else {
      atLeastOneMember=true;
    }
    if (!isValidRoleType(sub,member.roles))     validation.addError("String_Node_Str" + i,"String_Node_Str");
  }
  if (!atLeastOneMember)   validation.addError("String_Node_Str","String_Node_Str");
  return true;
}
Program: 189402
Project: 189402
Buggy source:
/** 
 * Construct the transient list for committee members from the html form parameters.
 * @return List of committee member.
 */
public static List<TransientMember> parseCommitteeMembers(){
  List<TransientMember> committee=new ArrayList<TransientMember>();
  int i=1;
  while (params.get("String_Node_Str" + i) != null || params.get("String_Node_Str" + i) != null) {
    String firstName=params.get("String_Node_Str" + i);
    String middleName=params.get("String_Node_Str" + i);
    String lastName=params.get("String_Node_Str" + i);
    String[] roles=params.get("String_Node_Str" + i,String[].class);
    if (roles == null)     roles=new String[0];
    i++;
    if ((firstName == null || firstName.trim().length() == 0) && (lastName == null || lastName.trim().length() == 0))     continue;
    TransientMember member=new TransientMember(firstName,middleName,lastName,roles);
    committee.add(member);
  }
  return committee;
}

Fixed version (ground truth):
/** 
 * Construct the transient list for committee members from the html form parameters.
 * @return List of committee member.
 */
public static List<TransientMember> parseCommitteeMembers(){
  List<TransientMember> committee=new ArrayList<TransientMember>();
  int i=1;
  while (params.get("String_Node_Str" + i) != null || params.get("String_Node_Str" + i) != null) {
    String firstName=params.get("String_Node_Str" + i);
    String middleName=params.get("String_Node_Str" + i);
    String lastName=params.get("String_Node_Str" + i);
    String[] roles=params.get("String_Node_Str" + i,String[].class);
    if (roles == null || (roles.length == 1 && roles[0].trim().length() == 0))     roles=new String[0];
    i++;
    if ((firstName == null || firstName.trim().length() == 0) && (lastName == null || lastName.trim().length() == 0))     continue;
    TransientMember member=new TransientMember(firstName,middleName,lastName,roles);
    committee.add(member);
  }
  return committee;
}
Program: 189403
Project: 189403
Buggy source:
public void doJob(){
  SystemEmailTemplateServiceImpl templateService=Spring.getBeanOfType(SystemEmailTemplateServiceImpl.class);
  templateService.generateAllSystemEmailTemplates();
}

Fixed version (ground truth):
public void doJob(){
  try {
    SystemEmailTemplateServiceImpl templateService=Spring.getBeanOfType(SystemEmailTemplateServiceImpl.class);
    templateService.generateAllSystemEmailTemplates();
  }
 catch (  RuntimeException re) {
    Logger.error(re,"String_Node_Str");
  }
}
Program: 189407
Project: 189407
Buggy source:
/** 
 * Create a new JpaAttachmentIpml from a byte array.
 * @param submission The submission this attachment belongs too.
 * @param type The type of the attachment.
 * @param filename The filename of the attachment.
 * @param content The contents of the attachment.
 */
protected JpaAttachmentImpl(Submission submission,AttachmentType type,String filename,byte[] content) throws IOException {
  this(submission,type);
  if (filename == null || filename.trim().length() == 0)   throw new IllegalArgumentException("String_Node_Str");
  if (content == null || content.length == 0)   throw new IllegalArgumentException("String_Node_Str");
  setName(filename);
  this.data=new Blob();
  this.data.set(new ByteArrayInputStream(content),MimeTypes.getContentType(filename));
  if (AttachmentType.PRIMARY == type)   renamePrimaryDocument();
}

Fixed version (ground truth):
/** 
 * Create a new JpaAttachmentIpml from a byte array.
 * @param submission The submission this attachment belongs too.
 * @param type The type of the attachment.
 * @param filename The filename of the attachment.
 * @param content The contents of the attachment.
 */
protected JpaAttachmentImpl(Submission submission,AttachmentType type,String filename,byte[] content) throws IOException {
  this(submission,type);
  if (filename == null || filename.trim().length() == 0)   throw new IllegalArgumentException("String_Node_Str");
  if (content == null || content.length == 0)   throw new IllegalArgumentException("String_Node_Str");
  setName(filename);
  String mimeType;
  try {
    mimeType=MimeTypes.getContentType(filename);
  }
 catch (  RuntimeException re) {
    mimeType="String_Node_Str";
  }
  this.data=new Blob();
  this.data.set(new ByteArrayInputStream(content),mimeType);
  if (AttachmentType.PRIMARY == type)   renamePrimaryDocument();
}
Program: 189408
Project: 189408
Buggy source:
@Override public List<ActionLog> findActionLogs(List<Long> logIds){
  StringBuilder sql=new StringBuilder();
  sql.append("String_Node_Str");
  for (int i=0; i < logIds.size(); i++) {
    if (i > 0)     sql.append("String_Node_Str");
    sql.append("String_Node_Str" + (i + 1));
  }
  sql.append("String_Node_Str");
  TypedQuery query=JPA.em().createQuery(sql.toString(),JpaActionLogImpl.class);
  for (int i=0; i < logIds.size(); i++) {
    query.setParameter(i + 1,logIds.get(i));
  }
  return query.getResultList();
}

Fixed version (ground truth):
@Override public List<ActionLog> findActionLogs(List<Long> logIds){
  if (logIds == null || logIds.size() == 0)   return new ArrayList<ActionLog>();
  StringBuilder sql=new StringBuilder();
  sql.append("String_Node_Str");
  for (int i=0; i < logIds.size(); i++) {
    if (i > 0)     sql.append("String_Node_Str");
    sql.append("String_Node_Str" + (i + 1));
  }
  sql.append("String_Node_Str");
  TypedQuery query=JPA.em().createQuery(sql.toString(),JpaActionLogImpl.class);
  for (int i=0; i < logIds.size(); i++) {
    query.setParameter(i + 1,logIds.get(i));
  }
  return query.getResultList();
}
Program: 189409
Project: 189409
Buggy source:
@Override public List<Submission> findSubmissions(List<Long> submissionIds){
  StringBuilder sql=new StringBuilder();
  sql.append("String_Node_Str");
  for (int i=0; i < submissionIds.size(); i++) {
    if (i > 0)     sql.append("String_Node_Str");
    sql.append("String_Node_Str" + (i + 1));
  }
  sql.append("String_Node_Str");
  TypedQuery query=JPA.em().createQuery(sql.toString(),JpaSubmissionImpl.class);
  for (int i=0; i < submissionIds.size(); i++) {
    query.setParameter(i + 1,submissionIds.get(i));
  }
  return query.getResultList();
}

Fixed version (ground truth):
@Override public List<Submission> findSubmissions(List<Long> submissionIds){
  if (submissionIds == null || submissionIds.size() == 0)   return new ArrayList<Submission>();
  StringBuilder sql=new StringBuilder();
  sql.append("String_Node_Str");
  for (int i=0; i < submissionIds.size(); i++) {
    if (i > 0)     sql.append("String_Node_Str");
    sql.append("String_Node_Str" + (i + 1));
  }
  sql.append("String_Node_Str");
  TypedQuery query=JPA.em().createQuery(sql.toString(),JpaSubmissionImpl.class);
  for (int i=0; i < submissionIds.size(); i++) {
    query.setParameter(i + 1,submissionIds.get(i));
  }
  return query.getResultList();
}
Program: 189412
Project: 189412
Buggy source:
@Security(RoleType.STUDENT) public static void license(Long subId){
  Submission sub=subRepo.findSubmission(subId);
  if (sub == null) {
    error("String_Node_Str");
  }
 else {
    Person submitter=context.getPerson();
    if (sub.getSubmitter() != submitter)     unauthorized();
    String licenseText=Play.configuration.getProperty("String_Node_Str","String_Node_Str");
    if (params.get("String_Node_Str") != null) {
      if (params.get("String_Node_Str") == null) {
        validation.addError("String_Node_Str","String_Node_Str");
      }
 else {
        docInfo(subId);
      }
    }
    render(subId,licenseText);
  }
}

Fixed version (ground truth):
@Security(RoleType.STUDENT) public static void license(Long subId){
  Submission sub=subRepo.findSubmission(subId);
  if (sub == null) {
    error("String_Node_Str");
  }
 else {
    Person submitter=context.getPerson();
    if (sub.getSubmitter() != submitter)     unauthorized();
    String licenseText=Play.configuration.getProperty("String_Node_Str","String_Node_Str");
    if (params.get("String_Node_Str") != null) {
      if (params.get("String_Node_Str") == null) {
        validation.addError("String_Node_Str","String_Node_Str");
      }
 else {
        sub.setLicenseAgreementDate(new Date());
        docInfo(subId);
      }
    }
    render(subId,licenseText);
  }
}
Program: 189416
Project: 189416
Buggy source:
@Security(RoleType.STUDENT) public static void fileUpload(){
  render("String_Node_Str");
}

Fixed version (ground truth):
@Security(RoleType.STUDENT) public static void fileUpload(Long subId){
  render("String_Node_Str");
}
Program: 189417
Project: 189417
Buggy source:
@Security(RoleType.STUDENT) public static void confirmAndSubmit(Long id){
  SecurityContextImpl context=Spring.getBeanOfType(SecurityContextImpl.class);
  JpaSubmissionRepositoryImpl submissions=Spring.getBeanOfType(JpaSubmissionRepositoryImpl.class);
  if (id != null) {
    Submission submission=submissions.findSubmission(id);
    render(context,submission);
  }
 else {
    render(context);
  }
}

Fixed version (ground truth):
@Security(RoleType.STUDENT) public static void confirmAndSubmit(Long subId){
  render(subId);
}
Program: 189420
Project: 189420
Buggy source:
private void setItems(JSONArray j) throws JSONException {
  if (curLoadPage == 1) {
    ArrayList<JSONObject> jsonObjectArray=new ArrayList<JSONObject>(j.length());
    containedIds.clear();
    for (int i=0; i < j.length(); i++) {
      JSONObject jj=j.getJSONObject(i);
      jsonObjectArray.add(jj);
      containedIds.add(jj.getLong("String_Node_Str"));
    }
    list.setAdapter(new PostListAdapter(getActivity(),jsonObjectArray));
  }
 else {
    PostListAdapter oldContent=getPostListAdapter();
    for (int i=0; i < j.length(); i++) {
      JSONObject jj=j.getJSONObject(i);
      if (containedIds.contains(jj.getLong("String_Node_Str")))       continue;
      oldContent.add(jj);
      containedIds.add(jj.getLong("String_Node_Str"));
    }
    oldContent.notifyDataSetChanged();
    Toast.makeText(getActivity(),"String_Node_Str",Toast.LENGTH_SHORT).show();
  }
  loadFinished=true;
}

Fixed version (ground truth):
private void setItems(JSONArray j) throws JSONException {
  if (curLoadPage == 1 || getPostListAdapter() == null) {
    ArrayList<JSONObject> jsonObjectArray=new ArrayList<JSONObject>(j.length());
    containedIds.clear();
    for (int i=0; i < j.length(); i++) {
      JSONObject jj=j.getJSONObject(i);
      jsonObjectArray.add(jj);
      containedIds.add(jj.getLong("String_Node_Str"));
    }
    list.setAdapter(new PostListAdapter(getActivity(),jsonObjectArray));
  }
 else {
    PostListAdapter oldContent=getPostListAdapter();
    for (int i=0; i < j.length(); i++) {
      JSONObject jj=j.getJSONObject(i);
      if (containedIds.contains(jj.getLong("String_Node_Str")))       continue;
      oldContent.add(jj);
      containedIds.add(jj.getLong("String_Node_Str"));
    }
    oldContent.notifyDataSetChanged();
    Toast.makeText(getActivity(),"String_Node_Str",Toast.LENGTH_SHORT).show();
  }
  loadFinished=true;
}
Program: 189421
Project: 189421
Buggy source:
public void loadTimeline(){
  final TwAjax t=new TwAjax(getActivity(),true,true);
  t.getUrlContent(Max.getServer(getActivity()) + "String_Node_Str" + String.valueOf(ITEMS_PER_PAGE)+ "String_Node_Str"+ String.valueOf(curLoadPage),new Runnable(){
    @Override public void run(){
      try {
        JSONArray j=(JSONArray)t.getJsonResult();
        setItems(j);
      }
 catch (      Exception e) {
        list.setAdapter(new ArrayAdapter<String>(getActivity(),R.layout.pl_error_listitem,android.R.id.text1,new String[]{"String_Node_Str" + e.getMessage(),Max.Hexdump(t.getResult().getBytes())}));
        e.printStackTrace();
      }
      hideProgBar();
    }
  }
);
}

Fixed version (ground truth):
public void loadTimeline(){
  final TwAjax t=new TwAjax(getActivity(),true,true);
  int ipp=ITEMS_PER_PAGE;
  int cp=curLoadPage;
  if (getPostListAdapter() == null) {
    ipp=ITEMS_PER_PAGE * curLoadPage;
    cp=1;
  }
  t.getUrlContent(Max.getServer(getActivity()) + "String_Node_Str" + String.valueOf(ipp)+ "String_Node_Str"+ String.valueOf(cp),new Runnable(){
    @Override public void run(){
      try {
        JSONArray j=(JSONArray)t.getJsonResult();
        setItems(j);
      }
 catch (      Exception e) {
        list.setAdapter(new ArrayAdapter<String>(getActivity(),R.layout.pl_error_listitem,android.R.id.text1,new String[]{t.getURL(),"String_Node_Str" + e.getMessage(),Max.getStackTrace(e),Max.Hexdump(t.getResult().getBytes())}));
        e.printStackTrace();
      }
      hideProgBar();
    }
  }
);
}
Program: 189422
Project: 189422
Buggy source:
protected void writeUnstoreObject(Property prop,Class propType,IndentedWriter iw) throws IOException {
  IndirectPolicy policy=indirectingPolicy(prop,propType);
  if (policy == IndirectPolicy.DEFINITELY_INDIRECT || policy == IndirectPolicy.INDIRECT_ON_EXCEPTION) {
    iw.println("String_Node_Str");
    iw.println("String_Node_Str");
    iw.println("String_Node_Str" + prop.getName() + "String_Node_Str"+ prop.getSimpleTypeName()+ "String_Node_Str");
  }
 else   if (policy == IndirectPolicy.DEFINITELY_DIRECT)   super.writeUnstoreObject(prop,propType,iw);
 else   throw new InternalError("String_Node_Str" + policy);
}

Fixed version (ground truth):
protected void writeUnstoreObject(Property prop,Class propType,IndentedWriter iw) throws IOException {
  IndirectPolicy policy=indirectingPolicy(prop,propType);
  if (policy == IndirectPolicy.DEFINITELY_INDIRECT || policy == IndirectPolicy.INDIRECT_ON_EXCEPTION) {
    iw.println("String_Node_Str");
    iw.println("String_Node_Str");
    iw.upIndent();
    iw.println("String_Node_Str");
    iw.println("String_Node_Str");
    iw.println("String_Node_Str" + prop.getName() + "String_Node_Str"+ prop.getSimpleTypeName()+ "String_Node_Str");
    iw.downIndent();
    iw.println("String_Node_Str");
  }
 else   if (policy == IndirectPolicy.DEFINITELY_DIRECT)   super.writeUnstoreObject(prop,propType,iw);
 else   throw new InternalError("String_Node_Str" + policy);
}
Program: 189424
Project: 189424
Buggy source:
private static PropertiesConfigSource configSource(String identifier) throws Exception {
  boolean hocon=isHoconPath(identifier);
  if (!hocon && !identifier.startsWith("String_Node_Str"))   throw new IllegalArgumentException(String.format("String_Node_Str",identifier));
  if (hocon) {
    try {
      return (PropertiesConfigSource)Class.forName(HOCON_CFG_SRC_CNAME).newInstance();
    }
 catch (    ClassNotFoundException e) {
      int sfx_index=identifier.lastIndexOf('#');
      String resourcePath=sfx_index > 0 ? identifier.substring(HOCON_PFX_LEN,sfx_index) : identifier.substring(HOCON_PFX_LEN);
      if (BasicMultiPropertiesConfig.class.getResource(resourcePath) == null)       throw new FileNotFoundException(String.format("String_Node_Str",resourcePath,identifier));
 else       throw new Exception("String_Node_Str",e);
    }
  }
 else   if ("String_Node_Str".equals(identifier))   return new SystemPropertiesConfigSource();
 else   return new BasicPropertiesConfigSource();
}

Fixed version (ground truth):
private static PropertiesConfigSource configSource(String identifier) throws Exception {
  boolean hocon=isHoconPath(identifier);
  if (!hocon && !identifier.startsWith("String_Node_Str"))   throw new IllegalArgumentException(String.format("String_Node_Str",identifier));
  if (hocon) {
    try {
      return (PropertiesConfigSource)Class.forName(HOCON_CFG_SRC_CNAME).newInstance();
    }
 catch (    ClassNotFoundException e) {
      int sfx_index=identifier.lastIndexOf('#');
      String resourcePath=sfx_index > 0 ? identifier.substring(HOCON_PFX_LEN,sfx_index) : identifier.substring(HOCON_PFX_LEN);
      if (BasicMultiPropertiesConfig.class.getResource(resourcePath) == null)       throw new FileNotFoundException(String.format("String_Node_Str",resourcePath,identifier));
 else       throw new Exception(String.format("String_Node_Str",identifier),e);
    }
  }
 else   if ("String_Node_Str".equals(identifier))   return new SystemPropertiesConfigSource();
 else   return new BasicPropertiesConfigSource();
}
Program: 189426
Project: 189426
Buggy source:
public double increment(KeyType key,final double value,int count){
  final MutableDoubleCount entry=(MutableDoubleCount)this.map.get(key);
  double newValue;
  double delta;
  final double identity=this.isLogScale ? Double.NEGATIVE_INFINITY : 0d;
  if (entry == null) {
    if (value > identity) {
      this.map.put(key,new MutableDoubleCount(value,count));
      delta=value;
    }
 else {
      delta=identity;
    }
    newValue=value;
  }
 else {
    final double sum=this.isLogScale ? LogMath.add(entry.value,value) : entry.value + value;
    if (sum >= identity) {
      delta=value;
      entry.set(sum,entry.count + count);
    }
 else {
      delta=-entry.value;
      entry.set(identity);
    }
    newValue=entry.value;
  }
  if (this.isLogScale) {
    this.total=LogMath.add(this.total,value);
  }
 else {
    this.total+=delta;
  }
  return newValue;
}

Fixed version (ground truth):
@Override public double increment(KeyType key){
  return this.increment(key,isLogScale ? 0d : 1d);
}
Program: 189427
Project: 189427
Buggy source:
@Override public double cost(AStarNode n1,AStarNode n2){
  final BasicDirectedNode dn1=(BasicDirectedNode)n1.getNode();
  final BasicDirectedNode dn2=(BasicDirectedNode)n2.getNode();
  final Edge edgeBetween=dn1.getOutEdge(dn2);
  if (edgeBetween == null) {
    return Double.POSITIVE_INFINITY;
  }
  return 0d;
}

Fixed version (ground truth):
@Override public double cost(AStarNode n1,AStarNode n2){
  final BasicDirectedNode dn1=(BasicDirectedNode)n1.getNode();
  final BasicDirectedNode dn2=(BasicDirectedNode)n2.getNode();
  final List<Edge> edgesBetween=dn1.getOutEdges(dn2);
  if (edgesBetween.isEmpty()) {
    return Double.POSITIVE_INFINITY;
  }
  double[] lengths=new double[edgesBetween.size()];
  for (int i=0; i < lengths.length; i++) {
    lengths[i]=((LineString)edgesBetween.get(i).getObject()).getLength();
  }
  return Doubles.min(lengths);
}
Program: 189428
Project: 189428
Buggy source:
@SuppressWarnings("String_Node_Str") protected Path getPathFromGraph(org.geotools.graph.path.Path path,final DirectedEdge bStartEdge,InferenceGraphSegment startSegment,InferenceGraphSegment endSegment,Set<Node> reachedEndNodes){
  List<PathEdge> pathEdges=Lists.newArrayList();
  double distance=0d;
  for (  InferenceGraphSegment segment : startSegment.getParentEdge().getSegments(startSegment.startDistance,Double.POSITIVE_INFINITY)) {
    pathEdges.add(new PathEdge(segment,distance,false));
    distance+=segment.getLine().getLength();
  }
  Iterator<DirectedNode> rNodes=path.riterator();
  DirectedNode prevNode=rNodes.next();
  while (rNodes.hasNext()) {
    DirectedNode node=rNodes.next();
    Edge outEdge=prevNode.getOutEdge(node);
    if (outEdge == null)     return null;
    final InferenceGraphEdge infEdge=this.getInferenceGraphEdge(outEdge);
    for (    InferenceGraphSegment segment : infEdge.getSegments()) {
      Preconditions.checkState(segment.line.p0.equals(Iterables.getLast(pathEdges).getLine().p1));
      pathEdges.add(new PathEdge(segment,distance,false));
      distance+=segment.getLine().getLength();
    }
    reachedEndNodes.add(node);
  }
  if (!pathEdges.isEmpty()) {
    final Path newPath=new Path(pathEdges,false);
    return newPath;
  }
 else {
    return null;
  }
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") protected Path getPathFromGraph(org.geotools.graph.path.Path path,final DirectedEdge bStartEdge,InferenceGraphSegment startSegment,InferenceGraphSegment endSegment,Set<Node> reachedEndNodes){
  List<PathEdge> pathEdges=Lists.newArrayList();
  double distance=0d;
  for (  InferenceGraphSegment segment : startSegment.getParentEdge().getSegments(startSegment.startDistance,Double.POSITIVE_INFINITY)) {
    pathEdges.add(new PathEdge(segment,distance,false));
    distance+=segment.getLine().getLength();
  }
  Iterator<DirectedNode> rNodes=path.riterator();
  DirectedNode prevNode=rNodes.next();
  while (rNodes.hasNext()) {
    DirectedNode node=rNodes.next();
    Edge outEdge=Preconditions.checkNotNull(prevNode.getOutEdge(node));
    final InferenceGraphEdge infEdge=this.getInferenceGraphEdge(outEdge);
    for (    InferenceGraphSegment segment : infEdge.getSegments()) {
      Preconditions.checkState(segment.line.p0.equals(Iterables.getLast(pathEdges).getLine().p1));
      pathEdges.add(new PathEdge(segment,distance,false));
      distance+=segment.getLine().getLength();
    }
    reachedEndNodes.add(node);
    prevNode=node;
  }
  if (!pathEdges.isEmpty()) {
    final Path newPath=new Path(pathEdges,false);
    return newPath;
  }
 else {
    return null;
  }
}
Program: 189433
Project: 189433
Buggy source:
/** 
 * Truncated normal mixing component.
 * @param beliefPrediction
 * @return
 */
public static double marginalPredictiveLogLikInternal(MultivariateGaussian roadDistribution,PathEdge edge,Coordinate obs,Double startDistance,double deltaTime){
  final Matrix Or=MotionStateEstimatorPredictor.getOr();
  double edgeLength;
  final double distToStartOfEdge;
  LineSegment lineSegment;
  if (startDistance != null && edge.getDistToStartOfEdge() == 0) {
    edgeLength=edge.getLength() - startDistance;
    if (edgeLength < 10d) {
      distToStartOfEdge=Math.max(startDistance - 10d,10d);
      edgeLength=edge.getLength() - distToStartOfEdge;
    }
 else {
      distToStartOfEdge=startDistance;
    }
    lineSegment=new LineSegment(edge.getInferenceGraphSegment().getLine().pointAlong(distToStartOfEdge / edge.getLength()),edge.getInferenceGraphSegment().getLine().p1);
  }
 else {
    edgeLength=edge.getLength();
    distToStartOfEdge=edge.getDistToStartOfEdge();
    lineSegment=edge.getInferenceGraphSegment().getLine();
  }
  final double S=Or.times(roadDistribution.getCovariance()).times(Or.transpose()).getElement(0,0) + Math.pow(edgeLength / Math.sqrt(12),2);
  final double mean;
  if (edgeLength < 1e-5) {
    mean=distToStartOfEdge;
  }
 else {
    mean=lineSegment.segmentFraction(obs) * edgeLength + distToStartOfEdge;
  }
  return UnivariateGaussian.PDF.logEvaluate(roadDistribution.getMean().getElement(0),mean,S);
}

Fixed version (ground truth):
/** 
 * Truncated normal mixing component.
 * @param beliefPrediction
 * @return
 */
public static double marginalPredictiveLogLikInternal(MultivariateGaussian roadDistribution,Matrix stateTransCov,PathEdge edge,Coordinate obs,Double startDistance,double deltaTime){
  final Matrix Or=MotionStateEstimatorPredictor.getOr();
  double edgeLength;
  final double distToStartOfEdge;
  LineSegment lineSegment;
  if (startDistance != null && edge.getDistToStartOfEdge() == 0) {
    edgeLength=edge.getLength() - startDistance;
    if (edgeLength < 10d) {
      distToStartOfEdge=Math.max(startDistance - 10d,10d);
      edgeLength=edge.getLength() - distToStartOfEdge;
    }
 else {
      distToStartOfEdge=startDistance;
    }
    lineSegment=new LineSegment(edge.getInferenceGraphSegment().getLine().pointAlong(distToStartOfEdge / edge.getLength()),edge.getInferenceGraphSegment().getLine().p1);
  }
 else {
    edgeLength=edge.getLength();
    distToStartOfEdge=edge.getDistToStartOfEdge();
    lineSegment=edge.getInferenceGraphSegment().getLine();
  }
  final double S=Or.times(stateTransCov).times(Or.transpose()).getElement(0,0) + Math.pow(edgeLength / Math.sqrt(12),2);
  final double mean;
  if (edgeLength < 1e-5) {
    mean=distToStartOfEdge;
  }
 else {
    mean=lineSegment.segmentFraction(obs) * edgeLength + distToStartOfEdge;
  }
  return UnivariateGaussian.PDF.logEvaluate(roadDistribution.getMean().getElement(0),mean,S);
}
Program: 189436
Project: 189436
Buggy source:
/** 
 * Initialize prior from the given hyper prior parameters, using the hyper prior means (i.e. the given parameters).
 * @param graph
 * @param edgeMotionPriorParams
 * @param freeMotionPriorParams
 * @param rng
 */
public OnOffEdgeTransPriorDistribution(Vector edgeMotionPriorParams,Vector freeMotionPriorParams){
  this.setFreeMotionTransProbPrior(new DirichletDistribution(freeMotionPriorParams));
  this.setEdgeMotionTransProbPrior(new DirichletDistribution(edgeMotionPriorParams));
}

Fixed version (ground truth):
/** 
 * Initialize prior from the given hyper prior parameters, using the hyper prior means (i.e. the given parameters).
 * @param graph
 * @param edgeMotionPriorParams
 * @param freeMotionPriorParams
 * @param rng
 */
public OnOffEdgeTransPriorDistribution(Vector edgeMotionPriorParams,Vector freeMotionPriorParams){
  this.setFreeMotionTransProbPrior(new TwoDDirichletDistribution(freeMotionPriorParams));
  this.setEdgeMotionTransProbPrior(new TwoDDirichletDistribution(edgeMotionPriorParams));
}
Program: 189437
Project: 189437
Buggy source:
public DirichletDistribution getEdgeMotionTransProbPrior(){
  return this.edgeMotionTransProbPrior;
}

Fixed version (ground truth):
public TwoDDirichletDistribution getEdgeMotionTransProbPrior(){
  return this.edgeMotionTransProbPrior;
}
Program: 189438
Project: 189438
Buggy source:
public DirichletDistribution getFreeMotionTransProbPrior(){
  return this.freeMotionTransProbPrior;
}

Fixed version (ground truth):
public TwoDDirichletDistribution getFreeMotionTransProbPrior(){
  return this.freeMotionTransProbPrior;
}
Program: 189439
Project: 189439
Buggy source:
public void setFreeMotionTransProbPrior(DirichletDistribution freeMotionTransProbPrior){
  this.freeMotionTransProbPrior=freeMotionTransProbPrior;
}

Fixed version (ground truth):
public void setFreeMotionTransProbPrior(TwoDDirichletDistribution freeMotionTransProbPrior){
  this.freeMotionTransProbPrior=freeMotionTransProbPrior;
}
Program: 189440
Project: 189440
Buggy source:
public void setEdgeMotionTransProbPrior(DirichletDistribution edgeMotionTransProbPrior){
  this.edgeMotionTransProbPrior=edgeMotionTransProbPrior;
}

Fixed version (ground truth):
public void setEdgeMotionTransProbPrior(TwoDDirichletDistribution edgeMotionTransProbPrior){
  this.edgeMotionTransProbPrior=edgeMotionTransProbPrior;
}
Program: 189441
Project: 189441
Buggy source:
/** 
 * Finds a UTM projection and applies it to all coordinates of the given geom.
 * @param orig
 * @return
 */
public static Geometry projectLonLatGeom(Geometry orig){
  final Geometry geom=(Geometry)orig.clone();
  geom.apply(new CoordinateFilter(){
    @Override public void filter(    Coordinate coord){
      final ProjectedCoordinate converted=GeoUtils.convertToEuclidean(coord);
      coord.setCoordinate(converted);
    }
  }
);
  geom.geometryChanged();
  return geom;
}

Fixed version (ground truth):
/** 
 * Finds a UTM projection and applies it to all coordinates of the given geom. TODO FIXME XXX: what about when the geoms cross zones?
 * @param orig
 * @return
 */
public static Geometry projectLonLatGeom(Geometry orig){
  final Geometry geom=(Geometry)orig.clone();
  geom.apply(new CoordinateFilter(){
    @Override public void filter(    Coordinate coord){
      final ProjectedCoordinate converted=GeoUtils.convertToEuclidean(coord);
      coord.setCoordinate(converted);
    }
  }
);
  geom.geometryChanged();
  return geom;
}
Program: 189442
Project: 189442
Buggy source:
public static MathTransform getTransform(Coordinate refLatLon){
  try {
    final CRSAuthorityFactory crsAuthorityFactory=CRS.getAuthorityFactory(false);
    final GeographicCRS geoCRS=crsAuthorityFactory.createGeographicCRS("String_Node_Str");
    final CoordinateReferenceSystem dataCRS=crsAuthorityFactory.createCoordinateReferenceSystem("String_Node_Str" + GeoUtils.getEPSGCodefromUTS(refLatLon));
    final MathTransform transform=CRS.findMathTransform(geoCRS,dataCRS);
    return transform;
  }
 catch (  final NoSuchIdentifierException e) {
    e.printStackTrace();
  }
catch (  final FactoryException e) {
    e.printStackTrace();
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Get the transform to a local euclidean projection for the area that contains the given reference (lat, lon) coordinate. 
 * @param refLatLon
 * @return
 */
public static MathTransform getTransform(Coordinate refLatLon){
  try {
    final CoordinateReferenceSystem dataCRS=crsAuthorityFactory.createCoordinateReferenceSystem("String_Node_Str" + GeoUtils.getEPSGCodefromUTS(refLatLon));
    final MathTransform transform=CRS.findMathTransform(geoCRS,dataCRS);
    return transform;
  }
 catch (  final NoSuchIdentifierException e) {
    e.printStackTrace();
  }
catch (  final FactoryException e) {
    e.printStackTrace();
  }
  return null;
}
Program: 189444
Project: 189444
Buggy source:
@Override public Vector convertToVector(){
  return this.distribution.convertToVector();
}

Fixed version (ground truth):
@Override public Vector convertToVector(){
  return this.motionDistribution.convertToVector();
}
Program: 189445
Project: 189445
Buggy source:
public void setMean(Vector mean){
  this.distribution.setMean(mean);
  this.groundBelief=null;
  this.pathState=new PathState(this.path,mean);
}

Fixed version (ground truth):
public void setMean(Vector mean){
  this.motionDistribution.setMean(mean);
  this.edgeDistribution=null;
  this.groundDistribution=null;
  this.pathState=new PathState(this.path,mean);
}
Program: 189446
Project: 189446
Buggy source:
public Matrix getCovariance(){
  return this.distribution.getCovariance();
}

Fixed version (ground truth):
public Matrix getCovariance(){
  return this.motionDistribution.getCovariance();
}
Program: 189447
Project: 189447
Buggy source:
public PathStateDistribution getRelatableState(PathStateDistribution stateBelief){
  final Path path=this.pathState.getPath();
  final PathState onThisPath=this.pathState.getRelatableState(stateBelief.getPathState());
  final Matrix covar;
  if (path.isNullPath()) {
    covar=stateBelief.getGroundBelief().getCovariance();
  }
 else {
    if (!stateBelief.getPathState().isOnRoad()) {
      final PathEdgeProjection proj=PathUtils.getRoadProjection(stateBelief.getMotionStateDistribution().getMean(),path.getGeometry(),onThisPath.getEdge().getLine(),onThisPath.getEdge().getDistToStartOfEdge());
      final Matrix C=stateBelief.getCovariance();
      covar=proj.getProjMatrix().transpose().times(C).times(proj.getProjMatrix());
    }
 else {
      covar=stateBelief.getCovariance();
    }
  }
  final PathStateDistribution newBelief=stateBelief.clone();
  newBelief.distribution.setMean(onThisPath.getMotionState());
  newBelief.distribution.setCovariance(covar);
  return newBelief;
}

Fixed version (ground truth):
public PathStateDistribution getRelatableState(PathStateDistribution stateBelief){
  final Path path=this.pathState.getPath();
  final PathState onThisPath=this.pathState.getRelatableState(stateBelief.getPathState());
  final Matrix covar;
  if (path.isNullPath()) {
    covar=stateBelief.getGroundDistribution().getCovariance();
  }
 else {
    if (!stateBelief.getPathState().isOnRoad()) {
      final PathEdgeProjection proj=PathUtils.getRoadProjection(stateBelief.getMotionDistribution().getMean(),path.getGeometry(),onThisPath.getEdge().getLine(),onThisPath.getEdge().getDistToStartOfEdge());
      final Matrix C=stateBelief.getCovariance();
      covar=proj.getProjMatrix().transpose().times(C).times(proj.getProjMatrix());
    }
 else {
      covar=stateBelief.getCovariance();
    }
  }
  final PathStateDistribution newBelief=stateBelief.clone();
  newBelief.motionDistribution.setMean(onThisPath.getMotionState());
  newBelief.motionDistribution.setCovariance(covar);
  return newBelief;
}
Program: 189448
Project: 189448
Buggy source:
public PathStateDistribution convertToPath(Path newPath){
  final PathState onThisPath=this.pathState.convertToPath(newPath);
  final Matrix covar;
  if (newPath.isNullPath()) {
    covar=this.getGroundBelief().getCovariance();
  }
 else {
    if (!this.pathState.isOnRoad()) {
      PathEdgeProjection proj=PathUtils.getRoadProjection(this.pathState.getGroundState(),path.getGeometry(),onThisPath.getEdge().getLine(),onThisPath.getEdge().getDistToStartOfEdge());
      final Matrix C=this.getCovariance();
      covar=proj.getProjMatrix().transpose().times(C).times(proj.getProjMatrix());
    }
 else {
      covar=this.getCovariance();
    }
  }
  final MultivariateGaussian newBelief=this.distribution.clone();
  newBelief.setMean(onThisPath.getMotionState());
  newBelief.setCovariance(covar);
  return new PathStateDistribution(newPath,newBelief);
}

Fixed version (ground truth):
public PathStateDistribution convertToPath(Path newPath){
  final PathState onThisPath=this.pathState.convertToPath(newPath);
  final Matrix covar;
  if (newPath.isNullPath()) {
    covar=this.getGroundDistribution().getCovariance();
  }
 else {
    if (!this.pathState.isOnRoad()) {
      PathEdgeProjection proj=PathUtils.getRoadProjection(this.pathState.getGroundState(),path.getGeometry(),onThisPath.getEdge().getLine(),onThisPath.getEdge().getDistToStartOfEdge());
      final Matrix C=this.getCovariance();
      covar=proj.getProjMatrix().transpose().times(C).times(proj.getProjMatrix());
    }
 else {
      covar=this.getCovariance();
    }
  }
  final MultivariateGaussian newBelief=this.motionDistribution.clone();
  newBelief.setMean(onThisPath.getMotionState());
  newBelief.setCovariance(covar);
  return new PathStateDistribution(newPath,newBelief);
}
Program: 189449
Project: 189449
Buggy source:
public PDF(PathStateDistribution pathStateDistribution){
  super(pathStateDistribution);
  this.gaussianPdf=pathStateDistribution.distribution.getProbabilityFunction();
}

Fixed version (ground truth):
public PDF(PathStateDistribution pathStateDistribution){
  super(pathStateDistribution);
  this.gaussianPdf=pathStateDistribution.motionDistribution.getProbabilityFunction();
}
Program: 189450
Project: 189450
Buggy source:
@Override public void convertFromVector(Vector parameters){
  this.distribution.convertFromVector(parameters);
}

Fixed version (ground truth):
@Override public void convertFromVector(Vector parameters){
  this.motionDistribution.convertFromVector(parameters);
  this.groundDistribution=null;
  this.edgeDistribution=null;
  this.pathState=new PathState(this.path,this.motionDistribution.getMean());
}