Program: 189244
Project: 189244
Buggy source:
public void onSubmit(){
  if (attachmentPanel != null) {
    Attachment attachment=attachmentPanel.getAttachment();
    if (attachment != null) {
      issue.getAttachments().add(attachment);
    }
  }
  if (!creating) {
    if (issue.getTimeRequired() != null && !issue.getTimeRequired().equals(oldTimeRequired)) {
      DurationWorked simulate=new DurationWorked();
      simulate.setUpdatedRequired(issue.getTimeRequired());
      simulate.setDay(new Date());
      simulate.setIssue(issue);
      simulate.setUser(((HeadsUpSession)getSession()).getUser());
      ((HibernateStorage)owner.getStorage()).save(simulate);
      issue.getTimeWorked().add(simulate);
    }
    issue=(Issue)((HibernateStorage)owner.getStorage()).getHibernateSession().merge(issue);
  }
 else   if (Boolean.parseBoolean(issue.getProject().getConfigurationValue(StoredProject.CONFIGURATION_TIMETRACKING_BURNDOWN))) {
    issue.setTimeRequired(issue.getTimeEstimate());
  }
  issue.setUpdated(new Date());
  if (issue.getMilestone() != null) {
    Milestone milestone=issue.getMilestone();
    if (creating) {
      milestone=(Milestone)((HibernateStorage)owner.getStorage()).getHibernateSession().merge(milestone);
    }
    if (!milestone.getIssues().contains(issue)) {
      milestone.getIssues().add(issue);
    }
  }
  parent.onSubmit(issue);
  if (issue.getAssignee() != null && !issue.getWatchers().contains(issue.getAssignee())) {
    if (oldAssignee == null || !issue.getAssignee().equals(oldAssignee)) {
      issue.getWatchers().add(issue.getAssignee());
    }
  }
  PageParameters params=new PageParameters();
  params.add("String_Node_Str",issue.getProject().getId());
  params.add("String_Node_Str",String.valueOf(issue.getId()));
  setResponsePage(owner.getPageClass("String_Node_Str"),params);
}

Fixed version (ground truth):
public void onSubmit(){
  if (attachmentPanel != null) {
    Attachment attachment=attachmentPanel.getAttachment();
    if (attachment != null) {
      issue.getAttachments().add(attachment);
    }
  }
  if (!creating) {
    issue=(Issue)((HibernateStorage)owner.getStorage()).getHibernateSession().merge(issue);
    if (issue.getTimeRequired() != null && !issue.getTimeRequired().equals(oldTimeRequired)) {
      DurationWorked simulate=new DurationWorked();
      simulate.setUpdatedRequired(issue.getTimeRequired());
      simulate.setDay(new Date());
      simulate.setIssue(issue);
      simulate.setUser(((HeadsUpSession)getSession()).getUser());
      ((HibernateStorage)owner.getStorage()).save(simulate);
      issue.getTimeWorked().add(simulate);
    }
  }
 else   if (Boolean.parseBoolean(issue.getProject().getConfigurationValue(StoredProject.CONFIGURATION_TIMETRACKING_BURNDOWN))) {
    issue.setTimeRequired(issue.getTimeEstimate());
  }
  issue.setUpdated(new Date());
  if (issue.getMilestone() != null) {
    Milestone milestone=issue.getMilestone();
    if (creating) {
      milestone=(Milestone)((HibernateStorage)owner.getStorage()).getHibernateSession().merge(milestone);
    }
    if (!milestone.getIssues().contains(issue)) {
      milestone.getIssues().add(issue);
    }
  }
  parent.onSubmit(issue);
  if (issue.getAssignee() != null && !issue.getWatchers().contains(issue.getAssignee())) {
    if (oldAssignee == null || !issue.getAssignee().equals(oldAssignee)) {
      issue.getWatchers().add(issue.getAssignee());
    }
  }
  PageParameters params=new PageParameters();
  params.add("String_Node_Str",issue.getProject().getId());
  params.add("String_Node_Str",String.valueOf(issue.getId()));
  setResponsePage(owner.getPageClass("String_Node_Str"),params);
}