Program: 189187
Project: 189187
Buggy source:
public void layout(){
  super.layout();
  add(CSSPackageResource.getHeaderContribution(getClass(),"String_Node_Str"));
  user=getSession().getUser();
  String username=getPageParameters().getString("String_Node_Str");
  if (username != null) {
    user=getSecurityManager().getUserByUsername(username);
    if (user == null || user.equals(HeadsUpSession.ANONYMOUS_USER)) {
      notFoundError();
      return;
    }
  }
  final org.headsupdev.agile.api.User finalUser=user;
  boolean showTools=(user.equals(getSession().getUser()) && !user.equals(HeadsUpSession.ANONYMOUS_USER)) || getSecurityManager().userHasPermission(getSession().getUser(),new AdminPermission(),null);
  final boolean timeEnabled=Boolean.parseBoolean(StoredProject.getDefault().getConfigurationValue(StoredProject.CONFIGURATION_TIMETRACKING_ENABLED));
  final boolean showVelocity=timeEnabled && showTools;
  WebMarkupContainer velocityPanel=new WebMarkupContainer("String_Node_Str");
  add(velocityPanel.setVisible(showVelocity));
  if (showVelocity) {
    Velocity velocity=getResourceManager().getUserVelocity(user);
    String velocityStr="String_Node_Str";
    if (!velocity.equals(Velocity.INVALID)) {
      velocityStr=String.format("String_Node_Str",velocity.getVelocity());
    }
    velocityPanel.add(new Label("String_Node_Str",velocityStr));
    Velocity currentVelocity=getResourceManager().getCurrentUserVelocity(user);
    String currentVelocityStr="String_Node_Str";
    if (!currentVelocity.equals(Velocity.INVALID)) {
      currentVelocityStr=String.format("String_Node_Str",currentVelocity.getVelocity());
    }
    velocityPanel.add(new Label("String_Node_Str",currentVelocityStr));
    Velocity averageVelocity=getResourceManager().getAverageVelocity();
    String averageVelocityStr="String_Node_Str";
    if (!averageVelocity.equals(Velocity.INVALID)) {
      averageVelocityStr=String.format("String_Node_Str",averageVelocity.getVelocity());
    }
    velocityPanel.add(new Label("String_Node_Str",averageVelocityStr));
  }
  PageParameters params=new PageParameters();
  params.add("String_Node_Str",user.getUsername());
  params.add("String_Node_Str","String_Node_Str");
  add(new Image("String_Node_Str",new ResourceReference("String_Node_Str"),params));
  add(new UserDetailsPanel("String_Node_Str",user,getProject(),shouldShowFullDetails()));
  if (showTools) {
    params=getPageParameters();
    addLink(new BookmarkableMenuLink(getPageClass("String_Node_Str"),params,"String_Node_Str"));
    addLink(new BookmarkableMenuLink(getPageClass("String_Node_Str"),params,"String_Node_Str"));
    addLink(new BookmarkableMenuLink(getPageClass("String_Node_Str"),params,"String_Node_Str"));
  }
  add(new Label("String_Node_Str",user.getFullnameOrUsername()));
  add(new IssueListPanel("String_Node_Str",getIssuesWatchedBy(finalUser),this,false,false));
  Calendar calendar=Calendar.getInstance(user.getTimeZone());
  Date startOfToday=DateUtil.getStartOfToday(calendar);
  Date endOfToday=DateUtil.getEndOfToday(calendar);
  calendar.setTime(startOfToday);
  calendar.add(Calendar.DATE,-7);
  Date startOfWeek=calendar.getTime();
  Duration durationDay=getResourceManager().getLoggedTimeForUser(user,startOfToday,endOfToday);
  add(new Label("String_Node_Str",durationDay == null ? "String_Node_Str" : durationDay.toString()));
  Duration durationWeek=getResourceManager().getLoggedTimeForUser(user,startOfWeek,endOfToday);
  add(new Label("String_Node_Str",durationWeek == null ? "String_Node_Str" : durationWeek.toString()));
  add(new ListView<DurationWorked>("String_Node_Str",getResourceManager().getDurationWorkedForUser(user,startOfWeek,endOfToday)){
    protected void populateItem(    ListItem<DurationWorked> listItem){
      DurationWorked worked=listItem.getModelObject();
      if (worked.getIssue() == null) {
        listItem.setVisible(false);
        return;
      }
      WebMarkupContainer workedTitle=new WebMarkupContainer("String_Node_Str");
      listItem.add(new Image("String_Node_Str",new ResourceReference(HeadsUpPage.class,"String_Node_Str")));
      String time="String_Node_Str";
      if (worked.getWorked() != null) {
        time=worked.getWorked().toString();
      }
      workedTitle.add(new Label("String_Node_Str",time));
      Issue related=worked.getIssue();
      PageParameters params=new PageParameters();
      params.put("String_Node_Str",related.getProject());
      params.put("String_Node_Str",related.getId());
      BookmarkablePageLink link=new BookmarkablePageLink("String_Node_Str",getPageClass("String_Node_Str"),params);
      String issueId=related.getProject().getId() + "String_Node_Str" + related.getId();
      link.add(new Label("String_Node_Str","String_Node_Str" + issueId));
      workedTitle.add(link.add(new IssueStatusModifier("String_Node_Str",related)));
      workedTitle.add(new Label("String_Node_Str",related.getSummary()).add(new IssueStatusModifier("String_Node_Str",related)));
      workedTitle.add(new Label("String_Node_Str",worked.getUser().getFullnameOrUsername()));
      workedTitle.add(new Label("String_Node_Str",new FormattedDateModel(worked.getDay(),((HeadsUpSession)getSession()).getTimeZone())));
      listItem.add(workedTitle);
    }
  }
.setVisible(showTools && timeEnabled));
  add(new Label("String_Node_Str",user.getFullnameOrUsername()));
  add(new HistoryPanel("String_Node_Str",getEventsForUser(user),true));
}

Fixed version (ground truth):
public void layout(){
  super.layout();
  add(CSSPackageResource.getHeaderContribution(getClass(),"String_Node_Str"));
  user=getSession().getUser();
  String username=getPageParameters().getString("String_Node_Str");
  if (username != null) {
    user=getSecurityManager().getUserByUsername(username);
    if (user == null || user.equals(HeadsUpSession.ANONYMOUS_USER)) {
      notFoundError();
      return;
    }
  }
  final org.headsupdev.agile.api.User finalUser=user;
  boolean showTools=(user.equals(getSession().getUser()) && !user.equals(HeadsUpSession.ANONYMOUS_USER)) || getSecurityManager().userHasPermission(getSession().getUser(),new AdminPermission(),null);
  final boolean timeEnabled=Boolean.parseBoolean(StoredProject.getDefault().getConfigurationValue(StoredProject.CONFIGURATION_TIMETRACKING_ENABLED));
  final boolean showVelocity=timeEnabled && showTools;
  WebMarkupContainer velocityPanel=new WebMarkupContainer("String_Node_Str");
  add(velocityPanel.setVisible(showVelocity));
  if (showVelocity) {
    Velocity velocity=getResourceManager().getUserVelocity(user);
    String velocityStr="String_Node_Str";
    if (!velocity.equals(Velocity.INVALID)) {
      velocityStr=String.format("String_Node_Str",velocity.getVelocity());
    }
    velocityPanel.add(new Label("String_Node_Str",velocityStr));
    Velocity currentVelocity=getResourceManager().getCurrentUserVelocity(user);
    String currentVelocityStr="String_Node_Str";
    if (!currentVelocity.equals(Velocity.INVALID)) {
      currentVelocityStr=String.format("String_Node_Str",currentVelocity.getVelocity());
    }
    velocityPanel.add(new Label("String_Node_Str",currentVelocityStr));
    Velocity averageVelocity=getResourceManager().getAverageVelocity();
    String averageVelocityStr="String_Node_Str";
    if (!averageVelocity.equals(Velocity.INVALID)) {
      averageVelocityStr=String.format("String_Node_Str",averageVelocity.getVelocity());
    }
    velocityPanel.add(new Label("String_Node_Str",averageVelocityStr));
  }
  PageParameters params=new PageParameters();
  params.add("String_Node_Str",user.getUsername());
  params.add("String_Node_Str","String_Node_Str");
  add(new Image("String_Node_Str",new ResourceReference("String_Node_Str"),params));
  add(new UserDetailsPanel("String_Node_Str",user,getProject(),shouldShowFullDetails()));
  if (showTools) {
    params=getPageParameters();
    addLink(new BookmarkableMenuLink(getPageClass("String_Node_Str"),params,"String_Node_Str"));
    addLink(new BookmarkableMenuLink(getPageClass("String_Node_Str"),params,"String_Node_Str"));
    addLink(new BookmarkableMenuLink(getPageClass("String_Node_Str"),params,"String_Node_Str"));
  }
  add(new Label("String_Node_Str",user.getFullnameOrUsername()));
  add(new IssueListPanel("String_Node_Str",getIssuesWatchedBy(finalUser),this,false,false,null));
  Calendar calendar=Calendar.getInstance(user.getTimeZone());
  Date startOfToday=DateUtil.getStartOfToday(calendar);
  Date endOfToday=DateUtil.getEndOfToday(calendar);
  calendar.setTime(startOfToday);
  calendar.add(Calendar.DATE,-7);
  Date startOfWeek=calendar.getTime();
  Duration durationDay=getResourceManager().getLoggedTimeForUser(user,startOfToday,endOfToday);
  add(new Label("String_Node_Str",durationDay == null ? "String_Node_Str" : durationDay.toString()));
  Duration durationWeek=getResourceManager().getLoggedTimeForUser(user,startOfWeek,endOfToday);
  add(new Label("String_Node_Str",durationWeek == null ? "String_Node_Str" : durationWeek.toString()));
  add(new ListView<DurationWorked>("String_Node_Str",getResourceManager().getDurationWorkedForUser(user,startOfWeek,endOfToday)){
    protected void populateItem(    ListItem<DurationWorked> listItem){
      DurationWorked worked=listItem.getModelObject();
      if (worked.getIssue() == null) {
        listItem.setVisible(false);
        return;
      }
      WebMarkupContainer workedTitle=new WebMarkupContainer("String_Node_Str");
      listItem.add(new Image("String_Node_Str",new ResourceReference(HeadsUpPage.class,"String_Node_Str")));
      String time="String_Node_Str";
      if (worked.getWorked() != null) {
        time=worked.getWorked().toString();
      }
      workedTitle.add(new Label("String_Node_Str",time));
      Issue related=worked.getIssue();
      PageParameters params=new PageParameters();
      params.put("String_Node_Str",related.getProject());
      params.put("String_Node_Str",related.getId());
      BookmarkablePageLink link=new BookmarkablePageLink("String_Node_Str",getPageClass("String_Node_Str"),params);
      String issueId=related.getProject().getId() + "String_Node_Str" + related.getId();
      link.add(new Label("String_Node_Str","String_Node_Str" + issueId));
      workedTitle.add(link.add(new IssueStatusModifier("String_Node_Str",related)));
      workedTitle.add(new Label("String_Node_Str",related.getSummary()).add(new IssueStatusModifier("String_Node_Str",related)));
      workedTitle.add(new Label("String_Node_Str",worked.getUser().getFullnameOrUsername()));
      workedTitle.add(new Label("String_Node_Str",new FormattedDateModel(worked.getDay(),((HeadsUpSession)getSession()).getTimeZone())));
      listItem.add(workedTitle);
    }
  }
.setVisible(showTools && timeEnabled));
  add(new Label("String_Node_Str",user.getFullnameOrUsername()));
  add(new HistoryPanel("String_Node_Str",getEventsForUser(user),true));
}