Program: 61058
Project: 61058
Buggy source:
public RolesPanel(final String id,final UserTO userTO){
  super(id);
  final ModalWindow membershipWin=new ModalWindow("String_Node_Str");
  membershipWin.setCssClassName(ModalWindow.CSS_CLASS_GRAY);
  membershipWin.setCookieName("String_Node_Str");
  add(membershipWin);
  final List<RoleTO> roles=roleRestClient.getAllRoles();
  BaseTree tree=new LinkTree("String_Node_Str",roleTreeBuilder.build()){
    @Override protected IModel getNodeTextModel(    final IModel model){
      return new PropertyModel(model,"String_Node_Str");
    }
    @Override protected void onNodeLinkClicked(    final Object node,    final BaseTree tree,    final AjaxRequestTarget target){
      final RoleTO roleTO=(RoleTO)((DefaultMutableTreeNode)node).getUserObject();
      membershipWin.setPageCreator(new ModalWindow.PageCreator(){
        private MembershipTO membershipTO;
        @Override public Page createPage(){
          membershipTO=new MembershipTO();
          membershipTO.setRoleId(roleTO.getId());
          return new MembershipModalPage(membershipWin,membershipTO,userTO);
        }
      }
);
      membershipWin.show(target);
    }
  }
;
  tree.getTreeState().expandAll();
  tree.updateTree();
  add(tree);
  ListView<MembershipTO> membershipsView=new ListView<MembershipTO>("String_Node_Str",new PropertyModel<List<? extends MembershipTO>>(userTO,"String_Node_Str")){
    @Override protected void populateItem(    final ListItem item){
      final MembershipTO membershipTO=(MembershipTO)item.getDefaultModelObject();
      item.add(new Label("String_Node_Str",new Model(membershipTO.getRoleId())));
      item.add(new Label("String_Node_Str",new Model(getRoleName(membershipTO.getRoleId(),roles))));
      AjaxLink editLink=new IndicatingAjaxLink("String_Node_Str"){
        @Override public void onClick(        AjaxRequestTarget target){
          membershipWin.setPageCreator(new ModalWindow.PageCreator(){
            @Override public Page createPage(){
              MembershipModalPage window=new MembershipModalPage(membershipWin,membershipTO,userTO);
              return window;
            }
          }
);
          membershipWin.show(target);
        }
      }
;
      item.add(editLink);
      AjaxLink deleteLink=new IndicatingDeleteOnConfirmAjaxLink("String_Node_Str"){
        @Override public void onClick(        final AjaxRequestTarget target){
          userTO.removeMembership(membershipTO);
          target.add(membershipsContainer);
        }
      }
;
      item.add(deleteLink);
    }
  }
;
  membershipsContainer=new WebMarkupContainer("String_Node_Str");
  membershipsContainer.add(membershipsView);
  membershipsContainer.setOutputMarkupId(true);
  add(membershipsContainer);
  setWindowClosedCallback(membershipWin,membershipsContainer);
}

Fixed version (ground truth):
public RolesPanel(final String id,final UserTO userTO){
  super(id);
  this.userTO=userTO;
  final WebMarkupContainer membershipsContainer=new WebMarkupContainer("String_Node_Str");
  membershipsContainer.setOutputMarkupId(true);
  add(membershipsContainer);
  final ModalWindow membershipWin=new ModalWindow("String_Node_Str");
  membershipWin.setCssClassName(ModalWindow.CSS_CLASS_GRAY);
  membershipWin.setCookieName("String_Node_Str");
  add(membershipWin);
  final List<RoleTO> roles=roleRestClient.getAllRoles();
  BaseTree tree=new LinkTree("String_Node_Str",roleTreeBuilder.build()){
    private static final long serialVersionUID=-5514696922119256101L;
    @Override protected IModel getNodeTextModel(    final IModel model){
      return new PropertyModel(model,"String_Node_Str");
    }
    @Override protected void onNodeLinkClicked(    final Object node,    final BaseTree tree,    final AjaxRequestTarget target){
      final RoleTO roleTO=(RoleTO)((DefaultMutableTreeNode)node).getUserObject();
      membershipWin.setPageCreator(new ModalWindow.PageCreator(){
        private static final long serialVersionUID=7661763358801821185L;
        private MembershipTO membershipTO;
        @Override public Page createPage(){
          membershipTO=new MembershipTO();
          membershipTO.setRoleId(roleTO.getId());
          return new MembershipModalPage(getPage().getPageReference(),membershipWin,membershipTO);
        }
      }
);
      membershipWin.show(target);
    }
  }
;
  tree.setOutputMarkupId(true);
  tree.getTreeState().expandAll();
  add(tree);
  ListView<MembershipTO> membershipsView=new ListView<MembershipTO>("String_Node_Str",new PropertyModel<List<? extends MembershipTO>>(userTO,"String_Node_Str")){
    private static final long serialVersionUID=9101744072914090143L;
    @Override protected void populateItem(    final ListItem item){
      final MembershipTO membershipTO=(MembershipTO)item.getDefaultModelObject();
      item.add(new Label("String_Node_Str",new Model(membershipTO.getRoleId())));
      item.add(new Label("String_Node_Str",new Model(getRoleName(membershipTO.getRoleId(),roles))));
      AjaxLink editLink=new IndicatingAjaxLink("String_Node_Str"){
        private static final long serialVersionUID=-7978723352517770644L;
        @Override public void onClick(        AjaxRequestTarget target){
          membershipWin.setPageCreator(new ModalWindow.PageCreator(){
            private static final long serialVersionUID=-7834632442532690940L;
            @Override public Page createPage(){
              return new MembershipModalPage(getPage().getPageReference(),membershipWin,membershipTO);
            }
          }
);
          membershipWin.show(target);
        }
      }
;
      item.add(editLink);
      AjaxLink deleteLink=new IndicatingDeleteOnConfirmAjaxLink("String_Node_Str"){
        private static final long serialVersionUID=-7978723352517770644L;
        @Override public void onClick(        final AjaxRequestTarget target){
          userTO.removeMembership(membershipTO);
          target.add(membershipsContainer);
        }
      }
;
      item.add(deleteLink);
    }
  }
;
  membershipsContainer.add(membershipsView);
  setWindowClosedCallback(membershipWin,membershipsContainer);
}