Program: 70016
Project: 70016
Buggy source:
/** 
 * returns a Collection of SubscriptionListItems for the given EPDefaultMap or EPStructuredMapTemplate (they are handled the same)<br /> the returning list will contain listItems for newly added artefacts/Pages/StructElements/Comments/Ratings
 * @param compareDate the comareDate (only items are added, that are created after this date)
 * @param map the EPDefaultMap or
 */
public List<SubscriptionListItem> getAllSubscrItems_Default(Date compareDate,EPAbstractMap map){
  List<SubscriptionListItem> allItems=new ArrayList<SubscriptionListItem>();
  String tmp_bPath;
  String tmp_linkUrl;
  List<EPStructureToStructureLink> structLinkCollection=getAllStruct2StructLinks(map);
  for (  EPStructureToStructureLink structLink : structLinkCollection) {
    if (structLink.getCreationDate().after(compareDate)) {
      if (structLink.getChild() instanceof EPPage) {
        EPPage childPage=(EPPage)structLink.getChild();
        tmp_bPath=rootBusinessPath + "String_Node_Str" + childPage.getKey()+ "String_Node_Str";
        tmp_linkUrl=BusinessControlFactory.getInstance().getURLFromBusinessPathString(tmp_bPath);
        allItems.add(new SubscriptionListItem(translator.translate("String_Node_Str",new String[]{childPage.getTitle()}),tmp_linkUrl,structLink.getCreationDate(),"String_Node_Str"));
      }
 else {
        if (structLink.getParent() instanceof EPPage) {
          EPPage parentPage=(EPPage)structLink.getParent();
          tmp_bPath=rootBusinessPath + "String_Node_Str" + parentPage.getKey()+ "String_Node_Str";
          tmp_linkUrl=BusinessControlFactory.getInstance().getURLFromBusinessPathString(tmp_bPath);
        }
 else {
          tmp_linkUrl=BusinessControlFactory.getInstance().getURLFromBusinessPathString(rootBusinessPath);
          allItems.add(new SubscriptionListItem(translator.translate("String_Node_Str",new String[]{structLink.getChild().getTitle()}),tmp_linkUrl,structLink.getCreationDate(),"String_Node_Str"));
        }
      }
    }
  }
  List<EPStructureToArtefactLink> links=getAllArtefactLinks(map);
  for (  EPStructureToArtefactLink link : links) {
    if (link.getCreationDate().after(compareDate)) {
      PortfolioStructure linkParent=link.getStructureElement();
      Long linkKey=0L;
      if (linkParent instanceof EPPage) {
        linkKey=linkParent.getKey();
      }
 else {
        linkKey=linkParent.getRoot().getKey();
      }
      tmp_bPath=rootBusinessPath + "String_Node_Str" + linkKey+ "String_Node_Str";
      tmp_linkUrl=BusinessControlFactory.getInstance().getURLFromBusinessPathString(tmp_bPath);
      allItems.add(new SubscriptionListItem(translator.translate("String_Node_Str",new String[]{getFullNameFromUser(link.getArtefact().getAuthor())}),tmp_linkUrl,link.getCreationDate(),"String_Node_Str"));
    }
  }
  allItems.addAll(getCRItemsForMap(compareDate,map));
  Collections.sort(allItems,new SubscriptionListItemComparator());
  return allItems;
}

Fixed version (ground truth):
/** 
 * returns a Collection of SubscriptionListItems for the given EPDefaultMap or EPStructuredMapTemplate (they are handled the same)<br /> the returning list will contain listItems for newly added artefacts/Pages/StructElements/Comments/Ratings
 * @param compareDate the comareDate (only items are added, that are created after this date)
 * @param map the EPDefaultMap or
 */
public List<SubscriptionListItem> getAllSubscrItems_Default(Date compareDate,EPAbstractMap map){
  List<SubscriptionListItem> allItems=new ArrayList<SubscriptionListItem>();
  String tmp_bPath;
  String tmp_linkUrl;
  List<EPStructureToStructureLink> structLinkCollection=getAllStruct2StructLinks(map);
  for (  EPStructureToStructureLink structLink : structLinkCollection) {
    if (structLink.getCreationDate().after(compareDate)) {
      if (structLink.getChild() instanceof EPPage) {
        EPPage childPage=(EPPage)structLink.getChild();
        tmp_bPath=rootBusinessPath + "String_Node_Str" + childPage.getKey()+ "String_Node_Str";
        tmp_linkUrl=BusinessControlFactory.getInstance().getURLFromBusinessPathString(tmp_bPath);
        allItems.add(new SubscriptionListItem(translator.translate("String_Node_Str",new String[]{childPage.getTitle()}),tmp_linkUrl,structLink.getCreationDate(),"String_Node_Str"));
      }
 else {
        tmp_linkUrl=BusinessControlFactory.getInstance().getURLFromBusinessPathString(rootBusinessPath);
        if (structLink.getParent() instanceof EPPage) {
          EPPage parentPage=(EPPage)structLink.getParent();
          tmp_bPath=rootBusinessPath + "String_Node_Str" + parentPage.getKey()+ "String_Node_Str";
          tmp_linkUrl=BusinessControlFactory.getInstance().getURLFromBusinessPathString(tmp_bPath);
        }
        allItems.add(new SubscriptionListItem(translator.translate("String_Node_Str",new String[]{structLink.getChild().getTitle()}),tmp_linkUrl,structLink.getCreationDate(),"String_Node_Str"));
      }
    }
  }
  Long tmp_LinkKey;
  String tmp_TargetTitle;
  List<EPStructureToArtefactLink> links=getAllArtefactLinks(map);
  for (  EPStructureToArtefactLink link : links) {
    if (link.getCreationDate().after(compareDate)) {
      PortfolioStructure linkParent=link.getStructureElement();
      if (linkParent instanceof EPPage) {
        tmp_LinkKey=linkParent.getKey();
        tmp_TargetTitle=linkParent.getTitle();
      }
 else {
        tmp_LinkKey=linkParent.getRoot().getKey();
        tmp_TargetTitle=linkParent.getRoot().getTitle();
      }
      tmp_bPath=rootBusinessPath + "String_Node_Str" + tmp_LinkKey+ "String_Node_Str";
      tmp_linkUrl=BusinessControlFactory.getInstance().getURLFromBusinessPathString(tmp_bPath);
      allItems.add(new SubscriptionListItem(translator.translate("String_Node_Str",new String[]{getFullNameFromUser(link.getArtefact().getAuthor()),link.getArtefact().getTitle(),tmp_TargetTitle}),tmp_linkUrl,link.getCreationDate(),"String_Node_Str"));
    }
  }
  allItems.addAll(getCRItemsForMap(compareDate,map));
  Collections.sort(allItems,new SubscriptionListItemComparator());
  return allItems;
}