Program: 189176
Project: 189176
Buggy source:
public void onSubmit(){
  if (attachmentPanel != null) {
    for (    Attachment attachment : attachmentPanel.getAttachments()) {
      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);
    }
  }
  if (issue.getAssignee() != null && !issue.getWatchers().contains(issue.getAssignee())) {
    if (oldAssignee == null || !issue.getAssignee().equals(oldAssignee)) {
      issue.getWatchers().add(issue.getAssignee());
    }
  }
  parent.onSubmit(issue);
  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) {
    for (    Attachment attachment : attachmentPanel.getAttachments()) {
      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());
  }
  if (creating) {
    if (toggleWatchers.getModelObject()) {
      issue.getWatchers().add(((HeadsUpSession)getSession()).getUser());
    }
  }
  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);
    }
  }
  if (issue.getAssignee() != null && !issue.getWatchers().contains(issue.getAssignee())) {
    if (oldAssignee == null || !issue.getAssignee().equals(oldAssignee)) {
      issue.getWatchers().add(issue.getAssignee());
    }
  }
  parent.onSubmit(issue);
  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);
}