Program: 189232
Project: 189232
Buggy source:
public IssuePanel(String id,final Issue issue){
  super(id);
  add(new Label("String_Node_Str",String.valueOf(issue.getId())));
  add(new Label("String_Node_Str",(issue.getProject() == null) ? "String_Node_Str" : issue.getProject().toString()));
  WebMarkupContainer type=new WebMarkupContainer("String_Node_Str");
  type.add(new Label("String_Node_Str",IssueUtils.getTypeName(issue.getType())));
  String typeIcon="String_Node_Str" + IssueUtils.getTypeName(issue.getType()) + "String_Node_Str";
  type.add(new Image("String_Node_Str",new ResourceReference(IssueListPanel.class,typeIcon)));
  add(type);
  add(new Label("String_Node_Str",IssueUtils.getPriorityName(issue.getPriority())));
  add(new Label("String_Node_Str",issue.getVersion()));
  final Milestone milestone=issue.getMilestone();
  Class userPage=RenderUtil.getPageClass("String_Node_Str");
  Class milestonePage=RenderUtil.getPageClass("String_Node_Str");
  PageParameters params=new PageParameters();
  if (milestone == null) {
    add(new WebMarkupContainer("String_Node_Str").setVisible(false));
    add(new Form("String_Node_Str").setVisible(false));
  }
 else {
    params.add("String_Node_Str",milestone.getProject().getId());
    params.add("String_Node_Str",milestone.getName());
    Link milestoneLink=new BookmarkablePageLink("String_Node_Str",milestonePage,params);
    milestoneLink.add(new Label("String_Node_Str",milestone.toString()));
    add(milestoneLink);
    Button addIssue=new Button("String_Node_Str"){
      @Override public void onSubmit(){
        super.onSubmit();
        PageParameters addIssueParams=new PageParameters();
        addIssueParams.add("String_Node_Str",milestone.getProject().getId());
        addIssueParams.add("String_Node_Str",milestone.getName());
        setResponsePage(RenderUtil.getPageClass("String_Node_Str"),addIssueParams);
      }
    }
;
    add(new Form("String_Node_Str").add(addIssue.setDefaultFormProcessing(false)));
  }
  String image=null;
switch (issue.getPriority()) {
case Issue.PRIORITY_BLOCKER:
    image="String_Node_Str";
  break;
case Issue.PRIORITY_CRITICAL:
image="String_Node_Str";
break;
case Issue.PRIORITY_MINOR:
image="String_Node_Str";
break;
case Issue.PRIORITY_TRIVIAL:
image="String_Node_Str";
break;
}
if (image == null) {
WebMarkupContainer ico=new WebMarkupContainer("String_Node_Str");
ico.setVisible(false);
add(ico);
}
 else {
add(new Image("String_Node_Str",new ResourceReference(IssueListPanel.class,image)));
}
add(new Label("String_Node_Str",issue.getOrder() == null ? "String_Node_Str" : String.valueOf(issue.getOrder())).setVisible(issue.getOrder() != null));
add(new Label("String_Node_Str",new Model<String>(){
@Override public String getObject(){
return IssueUtils.getWatchersDescription(issue,getSessionUser());
}
}
));
List<IssueRelationship> relationships=new LinkedList<IssueRelationship>();
relationships.addAll(issue.getRelationships());
Collections.sort(relationships,new Comparator<IssueRelationship>(){
public int compare(IssueRelationship relationship1,IssueRelationship relationship2){
if (relationship1.getType() == relationship2.getType()) {
if (relationship1.getRelated().getId() == relationship2.getRelated().getId()) {
if (relationship1.getRelated().getProject().equals(issue.getProject())) {
return Integer.MIN_VALUE;
}
 else if (relationship2.getRelated().getProject().equals(issue.getProject())) {
return Integer.MAX_VALUE;
}
return relationship1.getRelated().getProject().getId().compareToIgnoreCase(relationship2.getRelated().getProject().getId());
}
return (int)(relationship1.getRelated().getId() - relationship2.getRelated().getId());
}
return relationship1.getType() - relationship2.getType();
}
}
);
add(new ListView<IssueRelationship>("String_Node_Str",relationships){
protected void populateItem(ListItem<IssueRelationship> listItem){
IssueRelationship relationship=listItem.getModelObject();
listItem.add(new Label("String_Node_Str",IssueUtils.getRelationshipName(relationship.getType())));
Issue related=relationship.getRelated();
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",ViewIssue.class,params);
String issueId=String.valueOf(related.getId());
if (!related.getProject().equals(issue.getProject())) {
issueId=related.getProject().getId() + "String_Node_Str" + related.getId();
}
link.add(new Label("String_Node_Str","String_Node_Str" + issueId));
listItem.add(link.add(new IssueStatusModifier("String_Node_Str",related)));
listItem.add(new Label("String_Node_Str",related.getSummary()).add(new IssueStatusModifier("String_Node_Str",related)));
}
}
);
relationships=new LinkedList<IssueRelationship>();
relationships.clear();
relationships.addAll(issue.getReverseRelationships());
Collections.sort(relationships,new Comparator<IssueRelationship>(){
public int compare(IssueRelationship relationship1,IssueRelationship relationship2){
if (relationship1.getType() == relationship2.getType()) {
if (relationship1.getOwner().getId() == relationship2.getOwner().getId()) {
if (relationship1.getOwner().getProject().equals(issue.getProject())) {
return Integer.MIN_VALUE;
}
 else if (relationship2.getOwner().getProject().equals(issue.getProject())) {
return Integer.MAX_VALUE;
}
return relationship1.getOwner().getProject().getId().compareToIgnoreCase(relationship2.getOwner().getProject().getId());
}
return (int)(relationship1.getOwner().getId() - relationship2.getOwner().getId());
}
return relationship1.getType() - relationship2.getType();
}
}
);
add(new ListView<IssueRelationship>("String_Node_Str",relationships){
protected void populateItem(ListItem<IssueRelationship> listItem){
IssueRelationship relationship=listItem.getModelObject();
listItem.add(new Label("String_Node_Str",IssueUtils.getReverseRelationshipName(relationship.getType())));
Issue related=relationship.getOwner();
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",ViewIssue.class,params);
String issueId=String.valueOf(related.getId());
if (!related.getProject().equals(issue.getProject())) {
issueId=related.getProject().getId() + "String_Node_Str" + related.getId();
}
link.add(new Label("String_Node_Str","String_Node_Str" + issueId));
listItem.add(link.add(new IssueStatusModifier("String_Node_Str",related)));
listItem.add(new Label("String_Node_Str",related.getSummary()).add(new IssueStatusModifier("String_Node_Str",related)));
}
}
);
add(new ListView<ChangeSet>("String_Node_Str",new ArrayList<ChangeSet>(issue.getChangeSets())){
protected void populateItem(ListItem<ChangeSet> listItem){
ChangeSet change=listItem.getModelObject();
PageParameters params=new PageParameters();
params.put("String_Node_Str",change.getProject());
params.put("String_Node_Str",change.getId());
BookmarkablePageLink link=new BookmarkablePageLink("String_Node_Str",ApplicationPageMapper.get().getPageClass("String_Node_Str"),params);
String changeId=String.valueOf(change.getId());
if (!change.getProject().equals(issue.getProject())) {
changeId=change.getProject().getId() + "String_Node_Str" + change.getId();
}
link.add(new Label("String_Node_Str","String_Node_Str" + changeId));
listItem.add(link);
listItem.add(new Label("String_Node_Str",MarkedUpTextModel.markUp(change.getComment(),change.getProject())).setEscapeModelStrings(false));
}
}
);
add(new Label("String_Node_Str",IssueUtils.getStatusDescription(issue)));
params=getProjectPageParameters(issue.getProject());
params.add("String_Node_Str",issue.getReporter().getUsername());
Link reporterLink=new BookmarkablePageLink("String_Node_Str",userPage,params);
reporterLink.add(new Label("String_Node_Str",issue.getReporter().getFullnameOrUsername()));
add(reporterLink);
if (issue.getAssignee() != null) {
params=getProjectPageParameters(issue.getProject());
params.add("String_Node_Str",issue.getAssignee().getUsername());
Link assignedLink=new BookmarkablePageLink("String_Node_Str",userPage,params);
assignedLink.add(new Label("String_Node_Str",new PropertyModel(issue,"String_Node_Str")));
add(assignedLink);
if (isSessionUserAssignedToIssue(issue)) {
addDropIssueButton(issue);
}
}
 else {
add(new WebMarkupContainer("String_Node_Str").setVisible(false));
add(new Form("String_Node_Str").setVisible(false));
}
add(new Label("String_Node_Str",new FormattedDateModel(issue.getCreated(),((HeadsUpSession)getSession()).getTimeZone())));
add(new Label("String_Node_Str",new FormattedDateModel(issue.getUpdated(),((HeadsUpSession)getSession()).getTimeZone())));
boolean useTime=Boolean.parseBoolean(issue.getProject().getConfigurationValue(StoredProject.CONFIGURATION_TIMETRACKING_ENABLED));
add(new Label("String_Node_Str",new IssueHoursEstimateModel(issue){
@Override public String getObject(){
String time=super.getObject();
if (issue.getIncludeInInitialEstimates()) {
time+="String_Node_Str";
}
return time;
}
}
).setVisible(useTime));
add(new Label("String_Node_Str",new IssueHoursRequiredModel(issue)).setVisible(useTime));
if (Boolean.parseBoolean(issue.getProject().getConfigurationValue(StoredProject.CONFIGURATION_TIMETRACKING_BURNDOWN))) {
add(new Label("String_Node_Str","String_Node_Str"));
}
 else {
add(new Label("String_Node_Str","String_Node_Str"));
}
add(new Label("String_Node_Str",issue.getSummary()));
add(new Label("String_Node_Str",issue.getEnvironment()));
add(new Label("String_Node_Str",new MarkedUpTextModel(issue.getBody(),issue.getProject())).setEscapeModelStrings(false));
add(new Label("String_Node_Str",new MarkedUpTextModel(issue.getTestNotes(),issue.getProject())).setEscapeModelStrings(false).setVisible(issue.getTestNotes() != null));
}

Fixed version (ground truth):
public IssuePanel(String id,final Issue issue){
  super(id);
  add(new Label("String_Node_Str",String.valueOf(issue.getId())));
  add(new Label("String_Node_Str",(issue.getProject() == null) ? "String_Node_Str" : issue.getProject().toString()));
  WebMarkupContainer type=new WebMarkupContainer("String_Node_Str");
  type.add(new Label("String_Node_Str",IssueUtils.getTypeName(issue.getType())));
  String typeIcon="String_Node_Str" + IssueUtils.getTypeName(issue.getType()) + "String_Node_Str";
  type.add(new Image("String_Node_Str",new ResourceReference(IssueListPanel.class,typeIcon)));
  add(type);
  add(new Label("String_Node_Str",IssueUtils.getPriorityName(issue.getPriority())));
  add(new Label("String_Node_Str",issue.getVersion()));
  final Milestone milestone=issue.getMilestone();
  Class userPage=RenderUtil.getPageClass("String_Node_Str");
  Class milestonePage=RenderUtil.getPageClass("String_Node_Str");
  PageParameters params=new PageParameters();
  if (milestone == null) {
    add(new WebMarkupContainer("String_Node_Str").setVisible(false));
    add(new Form("String_Node_Str").setVisible(false));
  }
 else {
    params.add("String_Node_Str",milestone.getProject().getId());
    params.add("String_Node_Str",milestone.getName());
    Link milestoneLink=new BookmarkablePageLink("String_Node_Str",milestonePage,params);
    milestoneLink.add(new Label("String_Node_Str",milestone.toString()));
    add(milestoneLink);
    Button addIssue=new Button("String_Node_Str"){
      @Override public void onSubmit(){
        super.onSubmit();
        PageParameters addIssueParams=new PageParameters();
        addIssueParams.add("String_Node_Str",milestone.getProject().getId());
        addIssueParams.add("String_Node_Str",milestone.getName());
        setResponsePage(RenderUtil.getPageClass("String_Node_Str"),addIssueParams);
      }
    }
;
    add(new Form("String_Node_Str").add(addIssue.setDefaultFormProcessing(false)));
  }
  String image=null;
switch (issue.getPriority()) {
case Issue.PRIORITY_BLOCKER:
    image="String_Node_Str";
  break;
case Issue.PRIORITY_CRITICAL:
image="String_Node_Str";
break;
case Issue.PRIORITY_MINOR:
image="String_Node_Str";
break;
case Issue.PRIORITY_TRIVIAL:
image="String_Node_Str";
break;
}
if (image == null) {
WebMarkupContainer ico=new WebMarkupContainer("String_Node_Str");
ico.setVisible(false);
add(ico);
}
 else {
add(new Image("String_Node_Str",new ResourceReference(IssueListPanel.class,image)));
}
add(new Label("String_Node_Str",issue.getOrder() == null ? "String_Node_Str" : String.valueOf(issue.getOrder())).setVisible(issue.getOrder() != null));
add(new Label("String_Node_Str",new Model<String>(){
@Override public String getObject(){
return IssueUtils.getWatchersDescription(issue,getSessionUser());
}
}
));
List<IssueRelationship> relationships=new LinkedList<IssueRelationship>();
relationships.addAll(issue.getRelationships());
Collections.sort(relationships,new Comparator<IssueRelationship>(){
public int compare(IssueRelationship relationship1,IssueRelationship relationship2){
if (relationship1.getType() == relationship2.getType()) {
if (relationship1.getRelated().getId() == relationship2.getRelated().getId()) {
if (relationship1.getRelated().getProject().equals(issue.getProject())) {
return Integer.MIN_VALUE;
}
 else if (relationship2.getRelated().getProject().equals(issue.getProject())) {
return Integer.MAX_VALUE;
}
return relationship1.getRelated().getProject().getId().compareToIgnoreCase(relationship2.getRelated().getProject().getId());
}
return (int)(relationship1.getRelated().getId() - relationship2.getRelated().getId());
}
return relationship1.getType() - relationship2.getType();
}
}
);
add(new ListView<IssueRelationship>("String_Node_Str",relationships){
protected void populateItem(ListItem<IssueRelationship> listItem){
IssueRelationship relationship=listItem.getModelObject();
listItem.add(new Label("String_Node_Str",IssueUtils.getRelationshipName(relationship.getType())));
Issue related=relationship.getRelated();
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",ViewIssue.class,params);
String issueId=String.valueOf(related.getId());
if (!related.getProject().equals(issue.getProject())) {
issueId=related.getProject().getId() + "String_Node_Str" + related.getId();
}
link.add(new Label("String_Node_Str","String_Node_Str" + issueId));
listItem.add(link.add(new IssueStatusModifier("String_Node_Str",related)));
listItem.add(new Label("String_Node_Str",related.getSummary()).add(new IssueStatusModifier("String_Node_Str",related)));
}
}
);
relationships=new LinkedList<IssueRelationship>();
relationships.clear();
relationships.addAll(issue.getReverseRelationships());
Collections.sort(relationships,new Comparator<IssueRelationship>(){
public int compare(IssueRelationship relationship1,IssueRelationship relationship2){
if (relationship1.getType() == relationship2.getType()) {
if (relationship1.getOwner().getId() == relationship2.getOwner().getId()) {
if (relationship1.getOwner().getProject().equals(issue.getProject())) {
return Integer.MIN_VALUE;
}
 else if (relationship2.getOwner().getProject().equals(issue.getProject())) {
return Integer.MAX_VALUE;
}
return relationship1.getOwner().getProject().getId().compareToIgnoreCase(relationship2.getOwner().getProject().getId());
}
return (int)(relationship1.getOwner().getId() - relationship2.getOwner().getId());
}
return relationship1.getType() - relationship2.getType();
}
}
);
add(new ListView<IssueRelationship>("String_Node_Str",relationships){
protected void populateItem(ListItem<IssueRelationship> listItem){
IssueRelationship relationship=listItem.getModelObject();
listItem.add(new Label("String_Node_Str",IssueUtils.getReverseRelationshipName(relationship.getType())));
Issue related=relationship.getOwner();
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",ViewIssue.class,params);
String issueId=String.valueOf(related.getId());
if (!related.getProject().equals(issue.getProject())) {
issueId=related.getProject().getId() + "String_Node_Str" + related.getId();
}
link.add(new Label("String_Node_Str","String_Node_Str" + issueId));
listItem.add(link.add(new IssueStatusModifier("String_Node_Str",related)));
listItem.add(new Label("String_Node_Str",related.getSummary()).add(new IssueStatusModifier("String_Node_Str",related)));
}
}
);
add(new ListView<ChangeSet>("String_Node_Str",new ArrayList<ChangeSet>(issue.getChangeSets())){
protected void populateItem(ListItem<ChangeSet> listItem){
ChangeSet change=listItem.getModelObject();
PageParameters params=new PageParameters();
params.put("String_Node_Str",change.getProject());
params.put("String_Node_Str",change.getId());
BookmarkablePageLink link=new BookmarkablePageLink("String_Node_Str",ApplicationPageMapper.get().getPageClass("String_Node_Str"),params);
String changeId=String.valueOf(change.getId());
if (!change.getProject().equals(issue.getProject())) {
changeId=change.getProject().getId() + "String_Node_Str" + change.getId();
}
link.add(new Label("String_Node_Str","String_Node_Str" + changeId));
listItem.add(link);
listItem.add(new Label("String_Node_Str",MarkedUpTextModel.markUp(change.getComment(),change.getProject())).setEscapeModelStrings(false));
}
}
);
add(new Label("String_Node_Str",IssueUtils.getStatusDescription(issue)));
params=getProjectPageParameters(issue.getProject());
params.add("String_Node_Str",issue.getReporter().getUsername());
Link reporterLink=new BookmarkablePageLink("String_Node_Str",userPage,params);
reporterLink.add(new Label("String_Node_Str",issue.getReporter().getFullnameOrUsername()));
add(reporterLink);
if (issue.getAssignee() != null) {
params=getProjectPageParameters(issue.getProject());
params.add("String_Node_Str",issue.getAssignee().getUsername());
Link assignedLink=new BookmarkablePageLink("String_Node_Str",userPage,params);
assignedLink.add(new Label("String_Node_Str",new PropertyModel(issue,"String_Node_Str")));
add(assignedLink);
}
 else {
add(new WebMarkupContainer("String_Node_Str").setVisible(false));
}
if (isSessionUserAssignedToIssue(issue)) {
addDropIssueButton(issue);
}
 else {
add(new Form("String_Node_Str").setVisible(false));
}
add(new Label("String_Node_Str",new FormattedDateModel(issue.getCreated(),((HeadsUpSession)getSession()).getTimeZone())));
add(new Label("String_Node_Str",new FormattedDateModel(issue.getUpdated(),((HeadsUpSession)getSession()).getTimeZone())));
boolean useTime=Boolean.parseBoolean(issue.getProject().getConfigurationValue(StoredProject.CONFIGURATION_TIMETRACKING_ENABLED));
add(new Label("String_Node_Str",new IssueHoursEstimateModel(issue){
@Override public String getObject(){
String time=super.getObject();
if (issue.getIncludeInInitialEstimates()) {
time+="String_Node_Str";
}
return time;
}
}
).setVisible(useTime));
add(new Label("String_Node_Str",new IssueHoursRequiredModel(issue)).setVisible(useTime));
if (Boolean.parseBoolean(issue.getProject().getConfigurationValue(StoredProject.CONFIGURATION_TIMETRACKING_BURNDOWN))) {
add(new Label("String_Node_Str","String_Node_Str"));
}
 else {
add(new Label("String_Node_Str","String_Node_Str"));
}
add(new Label("String_Node_Str",issue.getSummary()));
add(new Label("String_Node_Str",issue.getEnvironment()));
add(new Label("String_Node_Str",new MarkedUpTextModel(issue.getBody(),issue.getProject())).setEscapeModelStrings(false));
add(new Label("String_Node_Str",new MarkedUpTextModel(issue.getTestNotes(),issue.getProject())).setEscapeModelStrings(false).setVisible(issue.getTestNotes() != null));
}