Program: 102401
Project: 102401
Buggy source:
/** 
 * Get the open link for each type of notification
 * @param activity The activity of the notification
 * @return The link to open the related resource (file, event, wiki page, ...)
 */
public static String getOpenLink(ExoSocialActivity activity){
  String activityType=activity.getType();
  if (activityType != null) {
    try {
      Map<String,String> templateParams=activity.getTemplateParams();
      if (activityType.equals(ActivityPluginType.WIKI.getName())) {
        return CommonsUtils.getCurrentDomain() + templateParams.get("String_Node_Str");
      }
 else       if (activityType.equals(ActivityPluginType.FORUM.getName())) {
        if (activity.isComment()) {
          if (!activity.getTitleId().equals("String_Node_Str")) {
            return templateParams.get("String_Node_Str");
          }
        }
 else {
          return CommonsUtils.getCurrentDomain() + templateParams.get("String_Node_Str");
        }
      }
 else       if (activityType.equals(ActivityPluginType.CALENDAR.getName())) {
        return CommonsUtils.getCurrentDomain() + templateParams.get("String_Node_Str");
      }
 else       if (activityType.contains(ActivityPluginType.ANSWER.getName())) {
        if (activity.isComment()) {
          return CommonsUtils.getCurrentDomain() + Utils.getActivityManager().getParentActivity(activity).getTemplateParams().get("String_Node_Str");
        }
 else {
          return templateParams.get("String_Node_Str");
        }
      }
 else       if (activityType.equals(ActivityPluginType.POLL.getName())) {
        try {
          return CommonsUtils.getCurrentDomain() + CommonsUtils.getService(ForumService.class).getTopicByPath(templateParams.get("String_Node_Str"),false).getLink();
        }
 catch (        Exception e) {
          LOG.error(e.getMessage(),e);
        }
      }
 else       if (activityType.equals(ActivityPluginType.FILE.getName()) || activityType.equals(ActivityPluginType.CONTENT.getName())) {
        return CommonsUtils.getCurrentDomain() + templateParams.get("String_Node_Str");
      }
    }
 catch (    Exception e) {
      LOG.error("String_Node_Str" + activity.getId() + "String_Node_Str"+ e.getMessage(),e);
      return null;
    }
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Get the open link for each type of notification
 * @param activity The activity of the notification
 * @return The link to open the related resource (file, event, wiki page, ...)
 */
public static String getOpenLink(ExoSocialActivity activity){
  String activityType=activity.getType();
  if (activityType != null) {
    try {
      Map<String,String> templateParams=activity.getTemplateParams();
      if (activityType.equals(ActivityPluginType.WIKI.getName())) {
        return CommonsUtils.getCurrentDomain() + templateParams.get("String_Node_Str");
      }
 else       if (activityType.equals(ActivityPluginType.FORUM.getName())) {
        if (activity.isComment()) {
          if (!activity.getTitleId().equals("String_Node_Str")) {
            if (activity.getTitleId().equals("String_Node_Str")) {
              return getOpenLink(Utils.getActivityManager().getParentActivity(activity));
            }
 else {
              return templateParams.get("String_Node_Str");
            }
          }
        }
 else {
          return CommonsUtils.getCurrentDomain() + templateParams.get("String_Node_Str");
        }
      }
 else       if (activityType.equals(ActivityPluginType.CALENDAR.getName())) {
        return CommonsUtils.getCurrentDomain() + templateParams.get("String_Node_Str");
      }
 else       if (activityType.contains(ActivityPluginType.ANSWER.getName())) {
        if (activity.isComment()) {
          return CommonsUtils.getCurrentDomain() + Utils.getActivityManager().getParentActivity(activity).getTemplateParams().get("String_Node_Str");
        }
 else {
          return templateParams.get("String_Node_Str");
        }
      }
 else       if (activityType.equals(ActivityPluginType.POLL.getName())) {
        try {
          return CommonsUtils.getCurrentDomain() + CommonsUtils.getService(ForumService.class).getTopicByPath(templateParams.get("String_Node_Str"),false).getLink();
        }
 catch (        Exception e) {
          LOG.error(e.getMessage(),e);
        }
      }
 else       if (activityType.equals(ActivityPluginType.FILE.getName()) || activityType.equals(ActivityPluginType.CONTENT.getName())) {
        return CommonsUtils.getCurrentDomain() + templateParams.get("String_Node_Str");
      }
    }
 catch (    Exception e) {
      LOG.error("String_Node_Str" + activity.getId() + "String_Node_Str"+ e.getMessage(),e);
      return null;
    }
  }
  return null;
}