Program: 35329
Project: 35329
Buggy source:
protected RssRoot transformResults(SearchResult searchResult,ApiCallParameters params){
  logger.debug("String_Node_Str");
  List<SearchResultItem> searchResultItems=pickSearchResultItemsFromDuplicateGroups(searchResult);
  int maxIndex=searchResultItems.size();
  logger.info("String_Node_Str",params.getOffset(),params.getOffset() + params.getLimit(),searchResultItems.size());
  searchResultItems=searchResultItems.subList(Math.min(params.getOffset(),maxIndex),Math.min(params.getOffset() + params.getLimit(),maxIndex));
  RssRoot rssRoot=new RssRoot();
  RssChannel rssChannel=new RssChannel();
  rssChannel.setTitle("String_Node_Str");
  rssChannel.setLink("String_Node_Str");
  rssChannel.setWebMaster("String_Node_Str");
  rssChannel.setNewznabResponse(new NewznabResponse(params.getOffset(),searchResultItems.size()));
  rssRoot.setRssChannel(rssChannel);
  List<RssItem> items=new ArrayList<>();
  for (  SearchResultItem searchResultItem : searchResultItems) {
    RssItem item=new RssItem();
    item.setLink(searchResultItem.getLink());
    item.setTitle(searchResultItem.getTitle());
    item.setRssGuid(new RssGuid(String.valueOf(searchResultItem.getGuid()),false));
    item.setPubDate(searchResultItem.getPubDate());
    List<NewznabAttribute> newznabAttributes=searchResultItem.getAttributes().entrySet().stream().map(attribute -> new NewznabAttribute(attribute.getKey(),attribute.getValue())).collect(Collectors.toList());
    item.setAttributes(newznabAttributes);
    items.add(item);
  }
  rssChannel.setItems(items);
  logger.debug("String_Node_Str");
  return rssRoot;
}

Fixed version (ground truth):
protected RssRoot transformResults(SearchResult searchResult,ApiCallParameters params){
  logger.debug("String_Node_Str");
  List<SearchResultItem> searchResultItems=pickSearchResultItemsFromDuplicateGroups(searchResult);
  int maxIndex=searchResultItems.size();
  int fromIndex=Math.min(params.getOffset(),maxIndex);
  int toIndex=Math.min(params.getOffset() + params.getLimit(),maxIndex);
  logger.info("String_Node_Str",fromIndex,toIndex,searchResultItems.size());
  searchResultItems=searchResultItems.subList(fromIndex,toIndex);
  RssRoot rssRoot=new RssRoot();
  RssChannel rssChannel=new RssChannel();
  rssChannel.setTitle("String_Node_Str");
  rssChannel.setLink("String_Node_Str");
  rssChannel.setWebMaster("String_Node_Str");
  rssChannel.setNewznabResponse(new NewznabResponse(params.getOffset(),searchResultItems.size()));
  rssRoot.setRssChannel(rssChannel);
  List<RssItem> items=new ArrayList<>();
  for (  SearchResultItem searchResultItem : searchResultItems) {
    RssItem item=new RssItem();
    item.setLink(searchResultItem.getLink());
    item.setTitle(searchResultItem.getTitle());
    item.setRssGuid(new RssGuid(String.valueOf(searchResultItem.getGuid()),false));
    item.setPubDate(searchResultItem.getPubDate());
    List<NewznabAttribute> newznabAttributes=searchResultItem.getAttributes().entrySet().stream().map(attribute -> new NewznabAttribute(attribute.getKey(),attribute.getValue())).collect(Collectors.toList());
    item.setAttributes(newznabAttributes);
    items.add(item);
  }
  rssChannel.setItems(items);
  logger.debug("String_Node_Str");
  return rssRoot;
}