Program: 55114
Project: 55114
Buggy source:
public Calendar getUserCalendar(String userToken) throws URISyntaxException, ParseException {
  UserWithPermission user;
  try {
    user=findUserFromCalendarToken(userToken);
  }
 catch (  EmptyResultDataAccessException ex) {
    throw new SecurityException("String_Node_Str");
  }
  if (userRepository.isCalendarFeedDisabled(user)) {
    throw new SecurityException("String_Node_Str");
  }
  final String utcTimeZone=TimeZones.getUtcTimeZone().getID();
  final TzId tzParam=new TzId(utcTimeZone);
  final Calendar calendar=new Calendar();
  calendar.getProperties().add(new ProdId("String_Node_Str"));
  calendar.getProperties().add(Version.VERSION_2_0);
  calendar.getProperties().add(CalScale.GREGORIAN);
  calendar.getProperties().add(Method.PUBLISH);
  final String applicationUrl=StringUtils.appendIfMissing(configurationRepository.getValue(Key.BASE_APPLICATION_URL),"String_Node_Str");
  final List<VEvent> events=new ArrayList<>();
  final SimpleDateFormat releaseDateFormatter=new SimpleDateFormat("String_Node_Str");
  List<Project> projects=projectService.findAllProjects(user);
  for (  Project project : projects) {
    CardLabel milestoneLabel=cardLabelRepository.findLabelByName(project.getId(),"String_Node_Str",CardLabel.LabelDomain.SYSTEM);
    Url mUrl=new Url(new URI(String.format("String_Node_Str",applicationUrl,project.getShortName())));
    for (    LabelListValueWithMetadata m : cardLabelRepository.findListValuesByLabelId(milestoneLabel.getId())) {
      if (m.getMetadata().containsKey("String_Node_Str")) {
        java.util.Date date=releaseDateFormatter.parse(m.getMetadata().get("String_Node_Str") + "String_Node_Str");
        SearchFilter filter=filter(SearchFilter.FilterType.MILESTONE,SearchFilter.ValueType.STRING,m.getValue());
        SearchFilter notTrashFilter=filter(SearchFilter.FilterType.NOTLOCATION,SearchFilter.ValueType.STRING,BoardColumn.BoardColumnLocation.TRASH.toString());
        SearchResults cards=searchService.find(Arrays.asList(filter,notTrashFilter),project.getId(),null,user);
        double closed=0;
        double total=0;
        StringBuilder descBuilder=new StringBuilder();
        for (        CardFullWithCounts card : cards.getFound()) {
          if (card.getColumnDefinition() == ColumnDefinition.CLOSED) {
            closed++;
          }
          total++;
          descBuilder.append(getEventName(card));
          descBuilder.append("String_Node_Str");
        }
        final String name=String.format("String_Node_Str",project.getShortName(),m.getValue(),total > 0 ? 100 * closed / total : 100);
        final VEvent event=new VEvent(new Date(date.getTime()),name);
        event.getProperties().add(new Description(descBuilder.toString()));
        final UUID id=new UUID(getLong(m.getCardLabelId(),m.getId()),getLong(m.getOrder(),0));
        event.getProperties().add(new Uid(id.toString()));
        if (!m.getMetadata().containsKey("String_Node_Str") || m.getMetadata().get("String_Node_Str").equals("String_Node_Str")) {
          final VAlarm reminder=new VAlarm(new Dur(0,0,0,0));
          reminder.getProperties().add(Action.DISPLAY);
          reminder.getProperties().add(new Description(name));
          event.getAlarms().add(reminder);
        }
        event.getProperties().getProperty(Property.DTSTART).getParameters().add(tzParam);
        event.getProperties().add(mUrl);
        events.add(event);
      }
    }
  }
  Map<Integer,UserDescription> usersCache=new HashMap<>();
  Map<Integer,CardFullWithCounts> map=new LinkedHashMap<>();
  SearchFilter locationFilter=filter(SearchFilter.FilterType.LOCATION,SearchFilter.ValueType.STRING,BoardColumn.BoardColumnLocation.BOARD.toString());
  SearchFilter aFilter=filter(SearchFilter.FilterType.ASSIGNED,SearchFilter.ValueType.CURRENT_USER,"String_Node_Str");
  for (  CardFullWithCounts card : searchService.find(Arrays.asList(locationFilter,aFilter),null,null,user).getFound()) {
    map.put(card.getId(),card);
  }
  SearchFilter wFilter=filter(SearchFilter.FilterType.WATCHED_BY,SearchFilter.ValueType.CURRENT_USER,"String_Node_Str");
  for (  CardFullWithCounts card : searchService.find(Arrays.asList(locationFilter,wFilter),null,null,user).getFound()) {
    map.put(card.getId(),card);
  }
  for (  CardFullWithCounts card : map.values()) {
    Url cardUrl=new Url(new URI(String.format("String_Node_Str",applicationUrl,card.getProjectShortName(),card.getBoardShortName(),card.getSequence())));
    CardDataHistory cardDesc=cardDataService.findLatestDescriptionByCardId(card.getId());
    for (    LabelAndValue lav : card.getLabelsWithType(LabelType.TIMESTAMP)) {
      String name=getEventName(card);
      final VEvent event=new VEvent(new Date(lav.getLabelValueTimestamp()),name);
      event.getProperties().add(new Created(new DateTime(card.getCreationDate())));
      event.getProperties().add(new LastModified(new DateTime(card.getLastUpdateTime())));
      final UUID id=new UUID(getLong(card.getColumnId(),card.getId()),getLong(lav.getLabelId(),lav.getLabelValueId()));
      event.getProperties().add(new Uid(id.toString()));
      if (card.getColumnDefinition() != ColumnDefinition.CLOSED) {
        final VAlarm reminder=new VAlarm(new Dur(0,0,0,0));
        reminder.getProperties().add(Action.DISPLAY);
        reminder.getProperties().add(new Description(name));
        event.getAlarms().add(reminder);
      }
      event.getProperties().getProperty(Property.DTSTART).getParameters().add(tzParam);
      UserDescription ud=getUserDescription(card.getCreationUser(),usersCache);
      Organizer organizer=new Organizer(URI.create(ud.getEmail()));
      organizer.getParameters().add(new Cn(ud.getName()));
      event.getProperties().add(organizer);
      event.getProperties().add(cardUrl);
      if (cardDesc != null) {
        event.getProperties().add(new Description(cardDesc.getContent()));
      }
      events.add(event);
    }
  }
  calendar.getComponents().addAll(events);
  return calendar;
}

Fixed version (ground truth):
public Calendar getUserCalendar(String userToken) throws URISyntaxException, ParseException {
  UserWithPermission user;
  try {
    user=findUserFromCalendarToken(userToken);
  }
 catch (  EmptyResultDataAccessException ex) {
    throw new SecurityException("String_Node_Str");
  }
  if (userRepository.isCalendarFeedDisabled(user)) {
    throw new SecurityException("String_Node_Str");
  }
  final Calendar calendar=new Calendar();
  calendar.getProperties().add(new ProdId("String_Node_Str"));
  calendar.getProperties().add(Version.VERSION_2_0);
  calendar.getProperties().add(CalScale.GREGORIAN);
  calendar.getProperties().add(Method.PUBLISH);
  final String applicationUrl=StringUtils.appendIfMissing(configurationRepository.getValue(Key.BASE_APPLICATION_URL),"String_Node_Str");
  final List<VEvent> events=new ArrayList<>();
  final SimpleDateFormat releaseDateFormatter=new SimpleDateFormat("String_Node_Str");
  List<Project> projects=projectService.findAllProjects(user);
  for (  Project project : projects) {
    CardLabel milestoneLabel=cardLabelRepository.findLabelByName(project.getId(),"String_Node_Str",CardLabel.LabelDomain.SYSTEM);
    Url mUrl=new Url(new URI(String.format("String_Node_Str",applicationUrl,project.getShortName())));
    for (    LabelListValueWithMetadata m : cardLabelRepository.findListValuesByLabelId(milestoneLabel.getId())) {
      if (m.getMetadata().containsKey("String_Node_Str")) {
        java.util.Date date=releaseDateFormatter.parse(m.getMetadata().get("String_Node_Str") + "String_Node_Str");
        SearchFilter filter=filter(SearchFilter.FilterType.MILESTONE,SearchFilter.ValueType.STRING,m.getValue());
        SearchFilter notTrashFilter=filter(SearchFilter.FilterType.NOTLOCATION,SearchFilter.ValueType.STRING,BoardColumn.BoardColumnLocation.TRASH.toString());
        SearchResults cards=searchService.find(Arrays.asList(filter,notTrashFilter),project.getId(),null,user);
        double closed=0;
        double total=0;
        StringBuilder descBuilder=new StringBuilder();
        for (        CardFullWithCounts card : cards.getFound()) {
          if (card.getColumnDefinition() == ColumnDefinition.CLOSED) {
            closed++;
          }
          total++;
          descBuilder.append(getEventName(card));
          descBuilder.append("String_Node_Str");
        }
        final String name=String.format("String_Node_Str",project.getShortName(),m.getValue(),total > 0 ? 100 * closed / total : 100);
        final VEvent event=new VEvent(new Date(date.getTime()),name);
        event.getProperties().getProperty(Property.DTSTART).getParameters().add(Value.DATE);
        event.getProperties().add(new Description(descBuilder.toString()));
        final UUID id=new UUID(getLong(m.getCardLabelId(),m.getId()),getLong(m.getOrder(),0));
        event.getProperties().add(new Uid(id.toString()));
        if (!m.getMetadata().containsKey("String_Node_Str") || m.getMetadata().get("String_Node_Str").equals("String_Node_Str")) {
          final VAlarm reminder=new VAlarm(new Dur(0,0,0,0));
          reminder.getProperties().add(Action.DISPLAY);
          reminder.getProperties().add(new Description(name));
          event.getAlarms().add(reminder);
        }
        event.getProperties().add(mUrl);
        events.add(event);
      }
    }
  }
  Map<Integer,UserDescription> usersCache=new HashMap<>();
  Map<Integer,CardFullWithCounts> map=new LinkedHashMap<>();
  SearchFilter locationFilter=filter(SearchFilter.FilterType.LOCATION,SearchFilter.ValueType.STRING,BoardColumn.BoardColumnLocation.BOARD.toString());
  SearchFilter aFilter=filter(SearchFilter.FilterType.ASSIGNED,SearchFilter.ValueType.CURRENT_USER,"String_Node_Str");
  for (  CardFullWithCounts card : searchService.find(Arrays.asList(locationFilter,aFilter),null,null,user).getFound()) {
    map.put(card.getId(),card);
  }
  SearchFilter wFilter=filter(SearchFilter.FilterType.WATCHED_BY,SearchFilter.ValueType.CURRENT_USER,"String_Node_Str");
  for (  CardFullWithCounts card : searchService.find(Arrays.asList(locationFilter,wFilter),null,null,user).getFound()) {
    map.put(card.getId(),card);
  }
  for (  CardFullWithCounts card : map.values()) {
    Url cardUrl=new Url(new URI(String.format("String_Node_Str",applicationUrl,card.getProjectShortName(),card.getBoardShortName(),card.getSequence())));
    CardDataHistory cardDesc=cardDataService.findLatestDescriptionByCardId(card.getId());
    for (    LabelAndValue lav : card.getLabelsWithType(LabelType.TIMESTAMP)) {
      String name=getEventName(card);
      final VEvent event=new VEvent(new Date(lav.getLabelValueTimestamp()),name);
      event.getProperties().getProperty(Property.DTSTART).getParameters().add(Value.DATE);
      event.getProperties().add(new Created(new DateTime(card.getCreationDate())));
      event.getProperties().add(new LastModified(new DateTime(card.getLastUpdateTime())));
      final UUID id=new UUID(getLong(card.getColumnId(),card.getId()),getLong(lav.getLabelId(),lav.getLabelValueId()));
      event.getProperties().add(new Uid(id.toString()));
      if (card.getColumnDefinition() != ColumnDefinition.CLOSED) {
        final VAlarm reminder=new VAlarm(new Dur(0,0,0,0));
        reminder.getProperties().add(Action.DISPLAY);
        reminder.getProperties().add(new Description(name));
        event.getAlarms().add(reminder);
      }
      UserDescription ud=getUserDescription(card.getCreationUser(),usersCache);
      Organizer organizer=new Organizer(URI.create(ud.getEmail()));
      organizer.getParameters().add(new Cn(ud.getName()));
      event.getProperties().add(organizer);
      event.getProperties().add(cardUrl);
      if (cardDesc != null) {
        event.getProperties().add(new Description(cardDesc.getContent()));
      }
      events.add(event);
    }
  }
  calendar.getComponents().addAll(events);
  return calendar;
}