Program: 189166
Project: 189166
Buggy source:
public void layout(){
  super.layout();
  page=this;
  add(CSSPackageResource.getHeaderContribution(getClass(),"String_Node_Str"));
  String name=getPageParameters().getString("String_Node_Str");
  milestone=dao.find(name,getProject());
  if (milestone == null) {
    notFoundError();
    return;
  }
  addLinks(getLinks(milestone));
  addDetails();
  User currentUser=getSession().getUser();
  final boolean userHasPermission=Manager.getSecurityInstance().userHasPermission(currentUser,new MilestoneEditPermission(),getProject());
  final List<Comment> commentList=new LinkedList<Comment>();
  commentList.addAll(milestone.getComments());
  Collections.sort(commentList,new Comparator<Comment>(){
    public int compare(    Comment comment1,    Comment comment2){
      return comment1.getCreated().compareTo(comment2.getCreated());
    }
  }
);
  add(new ListView<Comment>("String_Node_Str",commentList){
    private Comment comment;
    protected void populateItem(    ListItem<Comment> listItem){
      comment=listItem.getModelObject();
      listItem.add(new Image("String_Node_Str",new ResourceReference(HeadsUpPage.class,"String_Node_Str")));
      listItem.add(new Label("String_Node_Str",comment.getUser().getFullnameOrUsername()));
      listItem.add(new Label("String_Node_Str",new FormattedDateModel(comment.getCreated(),((HeadsUpSession)getSession()).getTimeZone())));
      PageParameters params=page.getProjectPageParameters();
      params.put("String_Node_Str",milestone.getName());
      params.put("String_Node_Str",comment.getId());
      Link edit=new BookmarkablePageLink("String_Node_Str",EditComment.class,params);
      listItem.add(edit.setVisible(userHasPermission));
      Link remove=new Link("String_Node_Str"){
        @Override public void onClick(){
          Comment comm=(Comment)((HibernateStorage)getStorage()).merge(comment);
          milestone.getComments().remove(comm);
          Milestone mile=(Milestone)((HibernateStorage)getStorage()).merge(milestone);
          commentList.remove(comm);
          mile.setUpdated(new Date());
          ((HibernateStorage)getStorage()).delete(comm);
        }
      }
;
      listItem.add(remove.setVisible(userHasPermission));
      listItem.add(new Label("String_Node_Str",new MarkedUpTextModel(comment.getComment(),getProject())).setEscapeModelStrings(false));
    }
  }
);
  filter=new IssueFilterPanel("String_Node_Str",getSession().getUser());
  if (milestone.isCompleted()) {
    filter.setStatuses(new boolean[]{false,false,false,false,false,true,true});
  }
 else {
    filter.setStatuses(new boolean[]{true,true,true,true,true,false,false});
  }
  add(filter);
  add(new IssueListPanel("String_Node_Str",getIssuesProvider(),this,true,true,milestone));
  boolean timeEnabled=Boolean.parseBoolean(milestone.getProject().getConfigurationValue(StoredProject.CONFIGURATION_TIMETRACKING_ENABLED)) && milestone.hasValidTimePeriod();
  add(new Image("String_Node_Str",new ResourceReference("String_Node_Str"),getPageParameters()).setVisible(timeEnabled));
  add(new WorkRemainingTable("String_Node_Str",milestone).setVisible(timeEnabled));
  ValueMap params=new ValueMap();
  params.put("String_Node_Str",getProject().getId());
  params.put("String_Node_Str",milestone.getName());
  params.put("String_Node_Str",true);
  add(new ResourceLink("String_Node_Str",new ResourceReference("String_Node_Str"),params).setVisible(timeEnabled));
}

Fixed version (ground truth):
public void layout(){
  super.layout();
  page=this;
  add(CSSPackageResource.getHeaderContribution(getClass(),"String_Node_Str"));
  String name=getPageParameters().getString("String_Node_Str");
  milestone=dao.find(name,getProject());
  if (milestone == null) {
    notFoundError();
    return;
  }
  addLinks(getLinks(milestone));
  addDetails();
  User currentUser=getSession().getUser();
  final boolean userHasPermission=Manager.getSecurityInstance().userHasPermission(currentUser,new MilestoneEditPermission(),getProject());
  final List<Comment> commentList=new LinkedList<Comment>();
  commentList.addAll(milestone.getComments());
  Collections.sort(commentList,new Comparator<Comment>(){
    public int compare(    Comment comment1,    Comment comment2){
      return comment1.getCreated().compareTo(comment2.getCreated());
    }
  }
);
  add(new ListView<Comment>("String_Node_Str",commentList){
    private Comment comment;
    protected void populateItem(    ListItem<Comment> listItem){
      CommentPanel panel=new CommentPanel("String_Node_Str",listItem.getModel(),getProject(),commentList,milestone);
      listItem.add(panel);
    }
  }
);
  filter=new IssueFilterPanel("String_Node_Str",getSession().getUser());
  if (milestone.isCompleted()) {
    filter.setStatuses(new boolean[]{false,false,false,false,false,true,true});
  }
 else {
    filter.setStatuses(new boolean[]{true,true,true,true,true,false,false});
  }
  add(filter);
  add(new IssueListPanel("String_Node_Str",getIssuesProvider(),this,true,true,milestone));
  boolean timeEnabled=Boolean.parseBoolean(milestone.getProject().getConfigurationValue(StoredProject.CONFIGURATION_TIMETRACKING_ENABLED)) && milestone.hasValidTimePeriod();
  add(new Image("String_Node_Str",new ResourceReference("String_Node_Str"),getPageParameters()).setVisible(timeEnabled));
  add(new WorkRemainingTable("String_Node_Str",milestone).setVisible(timeEnabled));
  ValueMap params=new ValueMap();
  params.put("String_Node_Str",getProject().getId());
  params.put("String_Node_Str",milestone.getName());
  params.put("String_Node_Str",true);
  add(new ResourceLink("String_Node_Str",new ResourceReference("String_Node_Str"),params).setVisible(timeEnabled));
}