nus-yam/ex-repair huggingface dataset:
Program: 35282
Project: 35282
Buggy source:
protected MigrationResult startMigration(Map<String,String> migrationData){
  logger.info("String_Node_Str");
  List<String> migrationMessages=new ArrayList<>();
  try {
    migrationMessages=sqliteMigration.migrate(migrationData.get("String_Node_Str"),migrationMessages);
  }
 catch (  Exception e) {
    logger.error("String_Node_Str",e);
    return MigrationResult.databaseMigrationFailed("String_Node_Str" + e.getMessage(),migrationMessages);
  }
  try {
    migrationMessages=configMigration.migrate(migrationData.get("String_Node_Str")).getMessages();
  }
 catch (  Exception e) {
    logger.error("String_Node_Str",e);
    return MigrationResult.configMigrationFailed("String_Node_Str" + e.getMessage());
  }
  logger.info("String_Node_Str");
  return MigrationResult.migrationSuccessful(migrationMessages);
}

Fixed version (ground truth):
protected MigrationResult startMigration(Map<String,String> migrationData){
  logger.info("String_Node_Str");
  List<String> migrationMessages=new ArrayList<>();
  if (migrationData.getOrDefault("String_Node_Str","String_Node_Str").equals("String_Node_Str")) {
    try {
      migrationMessages=sqliteMigration.migrate(migrationData.get("String_Node_Str"),migrationMessages);
    }
 catch (    Exception e) {
      logger.error("String_Node_Str",e);
      return MigrationResult.databaseMigrationFailed("String_Node_Str" + e.getMessage(),migrationMessages);
    }
  }
  try {
    migrationMessages=configMigration.migrate(migrationData.get("String_Node_Str")).getMessages();
  }
 catch (  Exception e) {
    logger.error("String_Node_Str",e);
    return MigrationResult.configMigrationFailed("String_Node_Str" + e.getMessage());
  }
  logger.info("String_Node_Str");
  return MigrationResult.migrationSuccessful(migrationMessages);
}
Program: 35283
Project: 35283
Buggy source:
@Transactional public MigrationResult migrateFromUrl(String nzbhydra1BaseUrl){
  logger.info("String_Node_Str" + nzbhydra1BaseUrl);
  OkHttpResponse versionsResponse=callHydraUrl(nzbhydra1BaseUrl,"String_Node_Str");
  if (!versionsResponse.isSuccessful()) {
    String msg="String_Node_Str" + versionsResponse.getMessage();
    logger.error(msg);
    return MigrationResult.requirementsNotMet(msg);
  }
  Map<String,String> migrationData=null;
  try {
    Map<String,String> versionsData=new ObjectMapper().readValue(versionsResponse.getBody(),mapTypeReference);
    String currentVersionString=versionsData.get("String_Node_Str");
    SemanticVersion currentVersion=new SemanticVersion(currentVersionString);
    if (currentVersion.compareTo(new SemanticVersion("String_Node_Str")) < 0) {
      String msg="String_Node_Str" + currentVersionString + "String_Node_Str";
      logger.error(msg);
      return MigrationResult.requirementsNotMet(msg);
    }
    OkHttpResponse migrationResponse=callHydraUrl(nzbhydra1BaseUrl,"String_Node_Str");
    migrationData=new ObjectMapper().readValue(migrationResponse.getBody(),mapTypeReference);
  }
 catch (  Exception e) {
    logger.error("String_Node_Str",e);
    return MigrationResult.requirementsNotMet("String_Node_Str" + e.getMessage());
  }
  return startMigration(migrationData);
}

Fixed version (ground truth):
@Transactional public MigrationResult migrateFromUrl(String nzbhydra1BaseUrl,boolean doMigrateDatabase){
  logger.info("String_Node_Str" + nzbhydra1BaseUrl);
  OkHttpResponse versionsResponse=callHydraUrl(nzbhydra1BaseUrl,"String_Node_Str");
  if (!versionsResponse.isSuccessful()) {
    String msg="String_Node_Str" + versionsResponse.getMessage();
    logger.error(msg);
    return MigrationResult.requirementsNotMet(msg);
  }
  Map<String,String> migrationData=null;
  try {
    Map<String,String> versionsData=new ObjectMapper().readValue(versionsResponse.getBody(),mapTypeReference);
    String currentVersionString=versionsData.get("String_Node_Str");
    SemanticVersion currentVersion=new SemanticVersion(currentVersionString);
    if (currentVersion.compareTo(new SemanticVersion("String_Node_Str")) < 0) {
      String msg="String_Node_Str" + currentVersionString + "String_Node_Str";
      logger.error(msg);
      return MigrationResult.requirementsNotMet(msg);
    }
    OkHttpResponse migrationResponse=callHydraUrl(nzbhydra1BaseUrl,"String_Node_Str");
    migrationData=new ObjectMapper().readValue(migrationResponse.getBody(),mapTypeReference);
    migrationData.put("String_Node_Str",String.valueOf(doMigrateDatabase));
  }
 catch (  Exception e) {
    logger.error("String_Node_Str",e);
    return MigrationResult.requirementsNotMet("String_Node_Str" + e.getMessage());
  }
  return startMigration(migrationData);
}
Program: 35284
Project: 35284
Buggy source:
@Secured({"String_Node_Str"}) @RequestMapping(value="String_Node_Str",method=RequestMethod.GET,produces=MediaType.APPLICATION_JSON_VALUE) public MigrationResult migrateFromFiles(@RequestParam(name="String_Node_Str") String settingsFile,@RequestParam(name="String_Node_Str") String dbFile) throws IOException {
  messages.clear();
  return migration.migrateFromFiles(settingsFile,dbFile);
}

Fixed version (ground truth):
@Secured({"String_Node_Str"}) @RequestMapping(value="String_Node_Str",method=RequestMethod.GET,produces=MediaType.APPLICATION_JSON_VALUE) public MigrationResult migrateFromFiles(@RequestParam(name="String_Node_Str") String settingsFile,@RequestParam(name="String_Node_Str") String dbFile,@RequestParam(name="String_Node_Str") boolean doMigrateDatabase) throws IOException {
  messages.clear();
  return migration.migrateFromFiles(settingsFile,dbFile,doMigrateDatabase);
}
Program: 35285
Project: 35285
Buggy source:
@Secured({"String_Node_Str"}) @RequestMapping(value="String_Node_Str",method=RequestMethod.GET,produces=MediaType.APPLICATION_JSON_VALUE) public MigrationResult migrateFromUrl(@RequestParam(name="String_Node_Str") String oldHydraBaseUrl) throws IOException {
  messages.clear();
  return migration.migrateFromUrl(oldHydraBaseUrl);
}

Fixed version (ground truth):
@Secured({"String_Node_Str"}) @RequestMapping(value="String_Node_Str",method=RequestMethod.GET,produces=MediaType.APPLICATION_JSON_VALUE) public MigrationResult migrateFromUrl(@RequestParam(name="String_Node_Str") String oldHydraBaseUrl,@RequestParam(name="String_Node_Str") boolean doMigrateDatabase) throws IOException {
  messages.clear();
  return migration.migrateFromUrl(oldHydraBaseUrl,doMigrateDatabase);
}
Program: 35287
Project: 35287
Buggy source:
@EventListener public void onApplicationEvent(AuthenticationSuccessEvent event){
  if (attemptService.wasUnsuccessfulBefore(SessionStorage.IP.get())) {
    User user;
    try {
      user=(User)event.getAuthentication().getPrincipal();
      logger.info("String_Node_Str",user.getUsername(),SessionStorage.IP.get());
    }
 catch (    ClassCastException e) {
      logger.info("String_Node_Str",SessionStorage.IP.get());
    }
  }
  attemptService.accessSucceeded(SessionStorage.IP.get());
}

Fixed version (ground truth):
@EventListener public void onApplicationEvent(AuthenticationSuccessEvent event){
  String ip=SessionStorage.IP.get();
  if (ip == null) {
    ip=((HydraWebAuthenticationDetails)event.getAuthentication().getDetails()).getFilteredIp();
    SessionStorage.IP.set(ip);
  }
  if (attemptService.wasUnsuccessfulBefore(SessionStorage.IP.get())) {
    User user;
    try {
      user=(User)event.getAuthentication().getPrincipal();
      logger.info("String_Node_Str",user.getUsername(),SessionStorage.IP.get());
    }
 catch (    ClassCastException e) {
      logger.info("String_Node_Str",SessionStorage.IP.get());
    }
  }
  attemptService.accessSucceeded(SessionStorage.IP.get());
}
Program: 35288
Project: 35288
Buggy source:
public void accessFailed(String key){
synchronized (attemptsCache) {
    int attempts=attemptsCache.getUnchecked(key);
    attempts++;
    attemptsCache.put(key,attempts);
    logger.warn("String_Node_Str",attempts,SessionStorage.IP.get(),MAX_ATTEMPTS);
  }
}

Fixed version (ground truth):
public void accessFailed(String key){
synchronized (attemptsCache) {
    if (key == null) {
      logger.warn("String_Node_Str");
      return;
    }
    int attempts=attemptsCache.getUnchecked(key);
    attempts++;
    attemptsCache.put(key,attempts);
    logger.warn("String_Node_Str",attempts,SessionStorage.IP.get(),MAX_ATTEMPTS);
  }
}
Program: 35289
Project: 35289
Buggy source:
public void accessSucceeded(String key){
  attemptsCache.invalidate(key);
}

Fixed version (ground truth):
public void accessSucceeded(String key){
  if (key == null) {
    logger.warn("String_Node_Str");
    return;
  }
  attemptsCache.invalidate(key);
}
Program: 35290
Project: 35290
Buggy source:
public boolean wasUnsuccessfulBefore(String key){
  return attemptsCache.getUnchecked(key) > 0;
}

Fixed version (ground truth):
public boolean wasUnsuccessfulBefore(String key){
  if (key == null) {
    logger.warn("String_Node_Str");
    return true;
  }
  return attemptsCache.getUnchecked(key) > 0;
}
Program: 35291
Project: 35291
Buggy source:
@Override protected void addInterceptors(InterceptorRegistry registry){
  registry.addInterceptor(new HandlerInterceptor(){
    @Override public boolean preHandle(    HttpServletRequest request,    HttpServletResponse response,    Object handler) throws Exception {
      String ip=request.getHeader("String_Node_Str");
      if (ip != null) {
        ip=ip.split("String_Node_Str")[0];
      }
 else {
        ip=request.getRemoteAddr();
      }
      if (configProvider.getBaseConfig().getMain().getLogging().isLogIpAddresses()) {
        MDC.put("String_Node_Str",ip);
      }
      if (configProvider.getBaseConfig().getMain().getLogging().isLogUsername() && !Strings.isNullOrEmpty(request.getRemoteUser())) {
        MDC.put("String_Node_Str",request.getRemoteUser());
      }
      SessionStorage.IP.set(ip);
      SessionStorage.username.set(request.getRemoteUser());
      SessionStorage.userAgent.set(request.getHeader("String_Node_Str"));
      SessionStorage.requestUrl.set(request.getRequestURI());
      return true;
    }
    @Override public void postHandle(    HttpServletRequest request,    HttpServletResponse response,    Object handler,    ModelAndView modelAndView) throws Exception {
    }
    @Override public void afterCompletion(    HttpServletRequest request,    HttpServletResponse response,    Object handler,    Exception ex) throws Exception {
    }
  }
);
}

Fixed version (ground truth):
@Override protected void addInterceptors(InterceptorRegistry registry){
  registry.addInterceptor(interceptor);
}
Program: 35293
Project: 35293
Buggy source:
protected RssRoot transformResults(SearchResult searchResult,NewznabParameters params,SearchRequest searchRequest){
  logger.debug("String_Node_Str");
  int total=searchResult.getNumberOfTotalAvailableResults() - searchResult.getNumberOfRejectedResults() - searchResult.getNumberOfRemovedDuplicates();
  RssRoot rssRoot=getRssRoot(searchResult.getSearchResultItems(),params.getOffset(),total,searchRequest);
  logger.debug("String_Node_Str");
  return rssRoot;
}

Fixed version (ground truth):
protected RssRoot transformResults(SearchResult searchResult,NewznabParameters params,SearchRequest searchRequest){
  Stopwatch stopwatch=Stopwatch.createStarted();
  int total=searchResult.getNumberOfTotalAvailableResults() - searchResult.getNumberOfRejectedResults() - searchResult.getNumberOfRemovedDuplicates();
  RssRoot rssRoot=getRssRoot(searchResult.getSearchResultItems(),params.getOffset(),total,searchRequest);
  logger.debug(LoggingMarkers.PERFORMANCE,"String_Node_Str",stopwatch.elapsed(TimeUnit.MILLISECONDS));
  return rssRoot;
}
Program: 35294
Project: 35294
Buggy source:
public BaseConfig(){
  objectMapper.registerModule(new Jdk8Module());
}

Fixed version (ground truth):
public BaseConfig(){
  objectMapper.registerModule(new Jdk8Module());
  DefaultPrettyPrinter.Indenter indenter=new DefaultIndenter("String_Node_Str",DefaultIndenter.SYS_LF);
  defaultPrettyPrinter=new DefaultPrettyPrinter();
  defaultPrettyPrinter.indentObjectsWith(indenter);
  defaultPrettyPrinter.indentArraysWith(indenter);
}
Program: 35296
Project: 35296
Buggy source:
public String cleanUpTitle(String title){
  if (Strings.isNullOrEmpty(title)) {
    return title;
  }
  title=title.trim();
  for (  String word : configProvider.getBaseConfig().getSearching().getRemoveTrailing()) {
    if (title.toLowerCase().endsWith(word.trim().toLowerCase())) {
      debug(MarkerFactory.getMarker(LoggingMarkers.TRAILING.name()),"String_Node_Str",word,title);
      title=title.substring(0,title.length() - word.length()).trim();
      return title;
    }
  }
  return title;
}

Fixed version (ground truth):
public String cleanUpTitle(String title){
  if (Strings.isNullOrEmpty(title)) {
    return title;
  }
  title=title.trim();
  for (  String word : configProvider.getBaseConfig().getSearching().getRemoveTrailing()) {
    if (title.toLowerCase().endsWith(word.trim().toLowerCase())) {
      debug(LoggingMarkers.TRAILING,"String_Node_Str",word,title);
      title=title.substring(0,title.length() - word.length()).trim();
      return title;
    }
  }
  return title;
}
Program: 35297
Project: 35297
Buggy source:
@Cacheable(cacheNames="String_Node_Str",sync=true) public List<MediaInfo> search(String title,IdType titleType) throws InfoProviderException {
  try {
    List<MediaInfo> infos;
    if (titleType == TVTITLE) {
      List<TvMazeSearchResult> results=tvMazeHandler.search(title);
      infos=results.stream().map(MediaInfo::new).collect(Collectors.toList());
      for (      MediaInfo mediaInfo : infos) {
        TvInfo tvInfo=new TvInfo(mediaInfo);
        if (tvInfoRepository.findByTvrageIdOrTvmazeIdOrTvdbId(tvInfo.getTvrageId(),tvInfo.getTvmazeId(),tvInfo.getTvdbId()) == null) {
          tvInfoRepository.save(tvInfo);
        }
      }
    }
 else     if (titleType == MOVIETITLE) {
      List<TmdbSearchResult> results=tmdbHandler.search(title,null);
      infos=results.stream().map(MediaInfo::new).collect(Collectors.toList());
      for (      MediaInfo mediaInfo : infos) {
        MovieInfo movieInfo=new MovieInfo(mediaInfo);
        if (movieInfoRepository.findByImdbIdOrTmdbId(movieInfo.getImdbId(),movieInfo.getTmdbId()) == null) {
          movieInfoRepository.save(movieInfo);
        }
      }
    }
 else {
      throw new IllegalArgumentException("String_Node_Str");
    }
    return infos;
  }
 catch (  Exception e) {
    logger.error("String_Node_Str" + titleType + "String_Node_Str"+ title,e);
    Throwables.throwIfInstanceOf(e,InfoProviderException.class);
    throw new InfoProviderException("String_Node_Str",e);
  }
}

Fixed version (ground truth):
@Cacheable(cacheNames="String_Node_Str",sync=true) public List<MediaInfo> search(String title,IdType titleType) throws InfoProviderException {
  try {
    List<MediaInfo> infos;
    if (titleType == TVTITLE) {
      List<TvMazeSearchResult> results=tvMazeHandler.search(title);
      infos=results.stream().map(MediaInfo::new).collect(Collectors.toList());
      for (      MediaInfo mediaInfo : infos) {
        TvInfo tvInfo=new TvInfo(mediaInfo);
        if (tvInfoRepository.findByTvrageIdOrTvmazeIdOrTvdbId(tvInfo.getTvrageId(),tvInfo.getTvmazeId(),tvInfo.getTvdbId()) == null) {
          tvInfoRepository.save(tvInfo);
        }
      }
    }
 else     if (titleType == MOVIETITLE) {
      List<TmdbSearchResult> results=tmdbHandler.search(title,null);
      infos=results.stream().map(MediaInfo::new).collect(Collectors.toList());
    }
 else {
      throw new IllegalArgumentException("String_Node_Str");
    }
    return infos;
  }
 catch (  Exception e) {
    logger.error("String_Node_Str" + titleType + "String_Node_Str"+ title,e);
    Throwables.throwIfInstanceOf(e,InfoProviderException.class);
    throw new InfoProviderException("String_Node_Str",e);
  }
}
Program: 35300
Project: 35300
Buggy source:
public Builder getOkHttpClientBuilder(URI requestUri){
  System.setProperty("String_Node_Str","String_Node_Str");
  Builder builder=getBaseBuilder();
  if (!configProvider.getBaseConfig().getMain().isVerifySsl()) {
    builder=getUnsafeOkHttpClientBuilder(builder);
  }
  MainConfig main=configProvider.getBaseConfig().getMain();
  if (main.getProxyType() == ProxyType.NONE) {
    return builder;
  }
  if (isUriToBeIgnoredByProxy(requestUri.getHost())) {
    logger.debug("String_Node_Str",requestUri.getHost());
    return builder;
  }
  if (main.getProxyType() == ProxyType.SOCKS) {
    return builder.socketFactory(new SF(main.getProxyHost(),main.getProxyPort(),main.getProxyUsername(),main.getProxyPassword()));
  }
 else   if (main.getProxyType() == ProxyType.HTTP) {
    builder=builder.proxy(new Proxy(Type.HTTP,new InetSocketAddress(main.getProxyHost(),main.getProxyPort()))).proxyAuthenticator((    Route route,    Response response) -> {
      if (response.request().header("String_Node_Str") != null) {
        logger.warn("String_Node_Str");
        return null;
      }
      String credential=Credentials.basic(main.getProxyUsername(),main.getProxyPassword());
      return response.request().newBuilder().header("String_Node_Str",credential).build();
    }
);
  }
  return builder;
}

Fixed version (ground truth):
public Builder getOkHttpClientBuilder(URI requestUri){
  Builder builder=getBaseBuilder();
  if (!configProvider.getBaseConfig().getMain().isVerifySsl()) {
    builder=getUnsafeOkHttpClientBuilder(builder);
  }
  MainConfig main=configProvider.getBaseConfig().getMain();
  if (main.getProxyType() == ProxyType.NONE) {
    return builder;
  }
  if (isUriToBeIgnoredByProxy(requestUri.getHost())) {
    logger.debug("String_Node_Str",requestUri.getHost());
    return builder;
  }
  if (main.getProxyType() == ProxyType.SOCKS) {
    return builder.socketFactory(new SF(main.getProxyHost(),main.getProxyPort(),main.getProxyUsername(),main.getProxyPassword()));
  }
 else   if (main.getProxyType() == ProxyType.HTTP) {
    builder=builder.proxy(new Proxy(Type.HTTP,new InetSocketAddress(main.getProxyHost(),main.getProxyPort()))).proxyAuthenticator((    Route route,    Response response) -> {
      if (response.request().header("String_Node_Str") != null) {
        logger.warn("String_Node_Str");
        return null;
      }
      String credential=Credentials.basic(main.getProxyUsername(),main.getProxyPassword());
      return response.request().newBuilder().header("String_Node_Str",credential).build();
    }
);
  }
  return builder;
}
Program: 35301
Project: 35301
Buggy source:
public String cleanUpTitle(String title){
  if (Strings.isNullOrEmpty(title)) {
    return title;
  }
  title=title.trim();
  for (  String word : configProvider.getBaseConfig().getSearching().getRemoveTrailing()) {
    if (title.toLowerCase().endsWith(word.trim().toLowerCase())) {
      debug("String_Node_Str",word,title);
      title=title.substring(0,title.length() - word.length()).trim();
      return title;
    }
  }
  return title;
}

Fixed version (ground truth):
public String cleanUpTitle(String title){
  if (Strings.isNullOrEmpty(title)) {
    return title;
  }
  title=title.trim();
  for (  String word : configProvider.getBaseConfig().getSearching().getRemoveTrailing()) {
    if (title.toLowerCase().endsWith(word.trim().toLowerCase())) {
      debug(MarkerFactory.getMarker(LoggingMarkers.TRAILING.name()),"String_Node_Str",word,title);
      title=title.substring(0,title.length() - word.length()).trim();
      return title;
    }
  }
  return title;
}
Program: 35302
Project: 35302
Buggy source:
protected void debug(String msg,Object... arguments){
  getLogger().debug(getName() + "String_Node_Str" + msg,arguments);
}

Fixed version (ground truth):
protected void debug(Marker marker,String msg,Object... arguments){
  getLogger().debug(marker,getName() + "String_Node_Str" + msg,arguments);
}
Program: 35303
Project: 35303
Buggy source:
@Override protected UriComponentsBuilder buildSearchUrl(SearchRequest searchRequest,Integer offset,Integer limit) throws IndexerSearchAbortedException {
  UriComponentsBuilder componentsBuilder=getBaseUri();
  SearchType searchType=searchRequest.getSearchType();
  if (config.getSupportedSearchTypes().stream().noneMatch(x -> searchRequest.getSearchType().matches(x))) {
    searchType=SearchType.SEARCH;
  }
  componentsBuilder=componentsBuilder.queryParam("String_Node_Str",searchType.name().toLowerCase());
  String query="String_Node_Str";
  componentsBuilder=extendQueryUrlWithSearchIds(searchRequest,componentsBuilder);
  query=generateQueryIfApplicable(searchRequest,query);
  query=addRequiredAndExcludedWordsToQuery(searchRequest,query);
  query=cleanupQuery(query);
  addFurtherParametersToUri(searchRequest,componentsBuilder,query);
  if (limit != null) {
    componentsBuilder.queryParam("String_Node_Str",limit);
  }
  if (offset != null) {
    componentsBuilder.queryParam("String_Node_Str",offset);
  }
  return componentsBuilder;
}

Fixed version (ground truth):
@Override protected UriComponentsBuilder buildSearchUrl(SearchRequest searchRequest,Integer offset,Integer limit) throws IndexerSearchAbortedException {
  UriComponentsBuilder componentsBuilder=getBaseUri();
  SearchType searchType=searchRequest.getSearchType();
  if (config.getSupportedSearchTypes().stream().noneMatch(x -> searchRequest.getSearchType().matches(x))) {
    searchType=SearchType.SEARCH;
  }
  componentsBuilder=componentsBuilder.queryParam("String_Node_Str",searchType.name().toLowerCase());
  String query="String_Node_Str";
  componentsBuilder=extendQueryUrlWithSearchIds(searchRequest,componentsBuilder);
  query=generateQueryIfApplicable(searchRequest,query);
  query=addRequiredAndforbiddenWordsToQuery(searchRequest,query);
  query=cleanupQuery(query);
  addFurtherParametersToUri(searchRequest,componentsBuilder,query);
  if (limit != null) {
    componentsBuilder.queryParam("String_Node_Str",limit);
  }
  if (offset != null) {
    componentsBuilder.queryParam("String_Node_Str",offset);
  }
  return componentsBuilder;
}
Program: 35304
Project: 35304
Buggy source:
@Override protected UriComponentsBuilder buildSearchUrl(SearchRequest searchRequest,Integer offset,Integer limit) throws IndexerSearchAbortedException {
  UriComponentsBuilder componentsBuilder=getBaseUri().path("String_Node_Str").queryParam("String_Node_Str","String_Node_Str").queryParam("String_Node_Str",250).queryParam("String_Node_Str","String_Node_Str");
  if (searchRequest.getMinsize().isPresent()) {
    componentsBuilder.queryParam("String_Node_Str",searchRequest.getMinsize().get());
  }
 else   if (config.getGeneralMinSize().isPresent()) {
    componentsBuilder.queryParam("String_Node_Str",config.getGeneralMinSize().get());
  }
  if (searchRequest.getMaxsize().isPresent()) {
    componentsBuilder.queryParam("String_Node_Str",searchRequest.getMaxsize().get());
  }
  if (searchRequest.getMinage().isPresent()) {
    componentsBuilder.queryParam("String_Node_Str",searchRequest.getMinage().get());
  }
  if (searchRequest.getMaxage().isPresent()) {
    componentsBuilder.queryParam("String_Node_Str",searchRequest.getMaxage().get());
  }
  String query="String_Node_Str";
  query=generateQueryIfApplicable(searchRequest,query);
  if (Strings.isNullOrEmpty(query)) {
    throw new IndexerSearchAbortedException("String_Node_Str");
  }
  query=addRequiredAndExcludedWordsToQuery(searchRequest,query);
  componentsBuilder.queryParam("String_Node_Str",query);
  return componentsBuilder;
}

Fixed version (ground truth):
@Override protected UriComponentsBuilder buildSearchUrl(SearchRequest searchRequest,Integer offset,Integer limit) throws IndexerSearchAbortedException {
  UriComponentsBuilder componentsBuilder=getBaseUri().path("String_Node_Str").queryParam("String_Node_Str","String_Node_Str").queryParam("String_Node_Str",250).queryParam("String_Node_Str","String_Node_Str");
  if (searchRequest.getMinsize().isPresent()) {
    componentsBuilder.queryParam("String_Node_Str",searchRequest.getMinsize().get());
  }
 else   if (config.getGeneralMinSize().isPresent()) {
    componentsBuilder.queryParam("String_Node_Str",config.getGeneralMinSize().get());
  }
  if (searchRequest.getMaxsize().isPresent()) {
    componentsBuilder.queryParam("String_Node_Str",searchRequest.getMaxsize().get());
  }
  if (searchRequest.getMinage().isPresent()) {
    componentsBuilder.queryParam("String_Node_Str",searchRequest.getMinage().get());
  }
  if (searchRequest.getMaxage().isPresent()) {
    componentsBuilder.queryParam("String_Node_Str",searchRequest.getMaxage().get());
  }
  String query="String_Node_Str";
  query=generateQueryIfApplicable(searchRequest,query);
  if (Strings.isNullOrEmpty(query)) {
    throw new IndexerSearchAbortedException("String_Node_Str");
  }
  query=addRequiredAndforbiddenWordsToQuery(searchRequest,query);
  componentsBuilder.queryParam("String_Node_Str",query);
  return componentsBuilder;
}
Program: 35305
Project: 35305
Buggy source:
protected boolean checkForAge(SearchRequest searchRequest,Multiset<String> reasonsForRejection,SearchResultItem item){
  if (searchRequest.getMinage().isPresent() && item.getAgeInDays() < searchRequest.getMinage().get()) {
    logger.debug("String_Node_Str",item.getTitle(),searchRequest.getMinage().get());
    reasonsForRejection.add("String_Node_Str");
    return false;
  }
  if (searchRequest.getMaxage().isPresent() && item.getAgeInDays() > searchRequest.getMaxage().get()) {
    logger.debug("String_Node_Str",item.getTitle(),searchRequest.getMaxage().get());
    reasonsForRejection.add("String_Node_Str");
    return false;
  }
  return true;
}

Fixed version (ground truth):
protected boolean checkForAge(SearchRequest searchRequest,Multiset<String> reasonsForRejection,SearchResultItem item){
  if (searchRequest.getMinage().isPresent() && item.getAgeInDays() < searchRequest.getMinage().get()) {
    logger.debug(MARKER,"String_Node_Str",item.getTitle(),searchRequest.getMinage().get());
    reasonsForRejection.add("String_Node_Str");
    return false;
  }
  if (searchRequest.getMaxage().isPresent() && item.getAgeInDays() > searchRequest.getMaxage().get()) {
    logger.debug(MARKER,"String_Node_Str",item.getTitle(),searchRequest.getMaxage().get());
    reasonsForRejection.add("String_Node_Str");
    return false;
  }
  return true;
}
Program: 35306
Project: 35306
Buggy source:
protected boolean checkForForbiddenGroup(Multiset<String> reasonsForRejection,SearchResultItem item){
  if (item.getGroup().isPresent()) {
    if (configProvider.getBaseConfig().getSearching().getForbiddenGroups().stream().anyMatch(x -> item.getGroup().isPresent() && item.getGroup().get().contains(x))) {
      logger.debug("String_Node_Str",item.getGroup().get());
      reasonsForRejection.add("String_Node_Str");
      return false;
    }
  }
  return true;
}

Fixed version (ground truth):
protected boolean checkForForbiddenGroup(Multiset<String> reasonsForRejection,SearchResultItem item){
  if (item.getGroup().isPresent()) {
    if (configProvider.getBaseConfig().getSearching().getForbiddenGroups().stream().anyMatch(x -> item.getGroup().isPresent() && item.getGroup().get().contains(x))) {
      logger.debug(MARKER,"String_Node_Str",item.getGroup().get());
      reasonsForRejection.add("String_Node_Str");
      return false;
    }
  }
  return true;
}
Program: 35307
Project: 35307
Buggy source:
protected boolean checkRequiredWords(Multiset<String> reasonsForRejection,List<String> requiredWords,SearchResultItem item){
  if (!requiredWords.isEmpty()) {
    List<String> titleWords=getTitleWords(item);
    for (    String requiredWord : requiredWords) {
      if (requiredWord.contains("String_Node_Str") || requiredWord.contains("String_Node_Str")) {
        if (item.getTitle().contains(requiredWord)) {
          return true;
        }
      }
 else {
        if (titleWords.contains(requiredWord)) {
          return true;
        }
      }
    }
    logger.debug("String_Node_Str",item.getTitle());
    reasonsForRejection.add("String_Node_Str");
    return false;
  }
  return true;
}

Fixed version (ground truth):
protected boolean checkRequiredWords(Multiset<String> reasonsForRejection,List<String> requiredWords,SearchResultItem item){
  if (!requiredWords.isEmpty()) {
    List<String> titleWords=getTitleWords(item);
    for (    String requiredWord : requiredWords) {
      if (requiredWord.contains("String_Node_Str") || requiredWord.contains("String_Node_Str")) {
        if (item.getTitle().contains(requiredWord)) {
          return true;
        }
      }
 else {
        if (titleWords.contains(requiredWord)) {
          return true;
        }
      }
    }
    logger.debug(MARKER,"String_Node_Str",item.getTitle());
    reasonsForRejection.add("String_Node_Str");
    return false;
  }
  return true;
}
Program: 35308
Project: 35308
Buggy source:
protected boolean checkForCategory(SearchRequest searchRequest,Multiset<String> reasonsForRejection,SearchResultItem item){
  if (item.getCategory().getIgnoreResultsFrom().meets(searchRequest.getSource())) {
    logger.debug("String_Node_Str",item.getTitle(),searchRequest.getCategory().getName());
    reasonsForRejection.add("String_Node_Str");
    return false;
  }
  return true;
}

Fixed version (ground truth):
protected boolean checkForCategory(SearchRequest searchRequest,Multiset<String> reasonsForRejection,SearchResultItem item){
  if (item.getCategory().getIgnoreResultsFrom().meets(searchRequest.getSource())) {
    logger.debug(MARKER,"String_Node_Str",item.getTitle(),searchRequest.getCategory().getName());
    reasonsForRejection.add("String_Node_Str");
    return false;
  }
  return true;
}
Program: 35309
Project: 35309
Buggy source:
protected boolean checkRegexes(SearchResultItem item,Multiset<String> reasonsForRejection,String requiredRegex,String forbiddenRegex){
  if (!Strings.isNullOrEmpty(requiredRegex) && !Pattern.compile(requiredRegex).matcher(item.getTitle().toLowerCase()).find()) {
    logger.debug("String_Node_Str",item.getTitle());
    reasonsForRejection.add("String_Node_Str");
    return false;
  }
  if (!Strings.isNullOrEmpty(forbiddenRegex) && Pattern.compile(forbiddenRegex).matcher(item.getTitle().toLowerCase()).find()) {
    logger.debug("String_Node_Str",item.getTitle());
    reasonsForRejection.add("String_Node_Str");
    return false;
  }
  return true;
}

Fixed version (ground truth):
protected boolean checkRegexes(SearchResultItem item,Multiset<String> reasonsForRejection,String requiredRegex,String forbiddenRegex){
  if (!Strings.isNullOrEmpty(requiredRegex) && !Pattern.compile(requiredRegex).matcher(item.getTitle().toLowerCase()).find()) {
    logger.debug(MARKER,"String_Node_Str",item.getTitle());
    reasonsForRejection.add("String_Node_Str");
    return false;
  }
  if (!Strings.isNullOrEmpty(forbiddenRegex) && Pattern.compile(forbiddenRegex).matcher(item.getTitle().toLowerCase()).find()) {
    logger.debug(MARKER,"String_Node_Str",item.getTitle());
    reasonsForRejection.add("String_Node_Str");
    return false;
  }
  return true;
}
Program: 35311
Project: 35311
Buggy source:
protected boolean checkForSize(SearchRequest searchRequest,Multiset<String> reasonsForRejection,SearchResultItem item){
  if (searchRequest.getMinsize().isPresent() && item.getSize() / (1024 * 1024) < searchRequest.getMinsize().get()) {
    logger.debug("String_Node_Str",item.getTitle(),searchRequest.getMinsize().get());
    reasonsForRejection.add("String_Node_Str");
    return false;
  }
  if (searchRequest.getMaxsize().isPresent() && item.getSize() / (1024 * 1024) > searchRequest.getMaxsize().get()) {
    logger.debug("String_Node_Str",item.getTitle(),searchRequest.getMaxsize().get());
    reasonsForRejection.add("String_Node_Str");
    return false;
  }
  return true;
}

Fixed version (ground truth):
protected boolean checkForSize(SearchRequest searchRequest,Multiset<String> reasonsForRejection,SearchResultItem item){
  if (searchRequest.getMinsize().isPresent() && item.getSize() / (1024 * 1024) < searchRequest.getMinsize().get()) {
    logger.debug(MARKER,"String_Node_Str",item.getTitle(),searchRequest.getMinsize().get());
    reasonsForRejection.add("String_Node_Str");
    return false;
  }
  if (searchRequest.getMaxsize().isPresent() && item.getSize() / (1024 * 1024) > searchRequest.getMaxsize().get()) {
    logger.debug(MARKER,"String_Node_Str",item.getTitle(),searchRequest.getMaxsize().get());
    reasonsForRejection.add("String_Node_Str");
    return false;
  }
  return true;
}
Program: 35312
Project: 35312
Buggy source:
protected boolean checkForForbiddenPoster(Multiset<String> reasonsForRejection,SearchResultItem item){
  if (item.getPoster().isPresent()) {
    if (configProvider.getBaseConfig().getSearching().getForbiddenPosters().stream().anyMatch(x -> item.getPoster().isPresent() && item.getPoster().get().contains(x))) {
      logger.debug("String_Node_Str",item.getPoster().get());
      reasonsForRejection.add("String_Node_Str");
      return false;
    }
  }
  return true;
}

Fixed version (ground truth):
protected boolean checkForForbiddenPoster(Multiset<String> reasonsForRejection,SearchResultItem item){
  if (item.getPoster().isPresent()) {
    if (configProvider.getBaseConfig().getSearching().getForbiddenPosters().stream().anyMatch(x -> item.getPoster().isPresent() && item.getPoster().get().contains(x))) {
      logger.debug(MARKER,"String_Node_Str",item.getPoster().get());
      reasonsForRejection.add("String_Node_Str");
      return false;
    }
  }
  return true;
}
Program: 35313
Project: 35313
Buggy source:
protected boolean checkForForbiddenWords(IndexerConfig indexerConfig,Multiset<String> reasonsForRejection,List<String> excludedWords,SearchResultItem item){
  for (  String forbiddenWord : excludedWords) {
    if (forbiddenWord.contains("String_Node_Str") || forbiddenWord.contains("String_Node_Str") || indexerConfig.getHost().contains("String_Node_Str")) {
      if (item.getTitle().toLowerCase().contains(forbiddenWord.toLowerCase())) {
        reasonsForRejection.add("String_Node_Str");
        logger.debug("String_Node_Str",forbiddenWord,item.getTitle());
        return false;
      }
    }
 else {
      List<String> titleWords=getTitleWords(item);
      Optional<String> found=titleWords.stream().filter(x -> x.equals(forbiddenWord)).findFirst();
      if (found.isPresent()) {
        logger.debug("String_Node_Str",found.get());
        reasonsForRejection.add("String_Node_Str");
        return false;
      }
    }
  }
  return true;
}

Fixed version (ground truth):
protected boolean checkForForbiddenWords(IndexerConfig indexerConfig,Multiset<String> reasonsForRejection,List<String> forbiddenWords,SearchResultItem item){
  for (  String forbiddenWord : forbiddenWords) {
    if (forbiddenWord.contains("String_Node_Str") || forbiddenWord.contains("String_Node_Str") || indexerConfig.getHost().contains("String_Node_Str")) {
      if (item.getTitle().toLowerCase().contains(forbiddenWord.toLowerCase())) {
        reasonsForRejection.add("String_Node_Str");
        logger.debug(MARKER,"String_Node_Str",forbiddenWord,item.getTitle());
        return false;
      }
    }
 else {
      List<String> titleWords=getTitleWords(item);
      Optional<String> found=titleWords.stream().filter(x -> x.equals(forbiddenWord)).findFirst();
      if (found.isPresent()) {
        logger.debug(MARKER,"String_Node_Str",found.get());
        reasonsForRejection.add("String_Node_Str");
        return false;
      }
    }
  }
  return true;
}
Program: 35315
Project: 35315
Buggy source:
public void load() throws IOException {
  File file=buildConfigFileFile();
  replace(objectMapper.readValue(file,BaseConfig.class));
}

Fixed version (ground truth):
public void load() throws IOException {
  File file=buildConfigFileFile();
  replace(getFromYamlFile(file));
}
Program: 35316
Project: 35316
Buggy source:
public SafeConfig(BaseConfig baseConfig){
  this.authType=baseConfig.getAuth().getAuthType();
  this.dereferer=baseConfig.getMain().getDereferer();
  this.searching=new SafeSearchingConfig(baseConfig.getSearching());
  this.downloaders=baseConfig.getDownloaders().stream().map(SafeDownloaderConfig::new).collect(Collectors.toList());
  this.logging=new SafeLoggingConfig(baseConfig.getMain().getLogging());
  this.indexers=baseConfig.getIndexers().stream().map(SafeIndexerConfig::new).collect(Collectors.toList());
  this.categoriesConfig=new SafeCategoriesConfig(baseConfig.getCategoriesConfig());
}

Fixed version (ground truth):
public SafeConfig(BaseConfig baseConfig){
  this.authType=baseConfig.getAuth().getAuthType();
  this.dereferer=baseConfig.getMain().getDereferer().orElse("String_Node_Str");
  this.searching=new SafeSearchingConfig(baseConfig.getSearching());
  this.downloaders=baseConfig.getDownloaders().stream().map(SafeDownloaderConfig::new).collect(Collectors.toList());
  this.logging=new SafeLoggingConfig(baseConfig.getMain().getLogging());
  this.indexers=baseConfig.getIndexers().stream().map(SafeIndexerConfig::new).collect(Collectors.toList());
  this.categoriesConfig=new SafeCategoriesConfig(baseConfig.getCategoriesConfig());
}
Program: 35317
Project: 35317
Buggy source:
public SafeDownloaderConfig(DownloaderConfig downloaderConfig){
  this.defaultCategory=downloaderConfig.getDefaultCategory();
  this.downloadType=downloaderConfig.getDownloadType();
  this.enabled=downloaderConfig.isEnabled();
  this.iconCssClass=downloaderConfig.getIconCssClass();
  this.name=downloaderConfig.getName();
  this.downloaderType=downloaderConfig.getDownloaderType().name();
}

Fixed version (ground truth):
public SafeDownloaderConfig(DownloaderConfig downloaderConfig){
  this.defaultCategory=downloaderConfig.getDefaultCategory();
  this.downloadType=downloaderConfig.getDownloadType().name();
  this.enabled=downloaderConfig.isEnabled();
  this.iconCssClass=downloaderConfig.getIconCssClass();
  this.name=downloaderConfig.getName();
  this.downloaderType=downloaderConfig.getDownloaderType().name();
}
Program: 35318
Project: 35318
Buggy source:
private void migrateMain(OldConfig oldConfig,BaseConfig newConfig){
  MainConfig mainConfig=configProvider.getBaseConfig().getMain();
  Main oldMain=oldConfig.getMain();
  mainConfig.setApiKey(oldMain.getApikey());
  mainConfig.setDereferer(oldMain.getApikey());
  mainConfig.setExternalUrl(oldMain.getExternalUrl());
  mainConfig.setHost(oldMain.getHost());
  mainConfig.setPort(oldMain.getPort());
  mainConfig.setRepositoryBase(oldMain.getRepositoryBase());
  mainConfig.setShutdownForRestart(oldMain.isShutdownForRestart());
  mainConfig.setSocksProxy(oldMain.getSocksProxy());
  mainConfig.setHttpProxy(oldMain.getHttpProxy());
  mainConfig.setHttpsProxy(oldMain.getHttpsProxy());
  mainConfig.setSsl(oldMain.isSsl());
  mainConfig.setSslcert(oldMain.getSslcert());
  mainConfig.setSslkey(oldMain.getSslkey());
  mainConfig.setStartupBrowser(oldMain.isStartupBrowser());
  mainConfig.setTheme(oldMain.getTheme());
  mainConfig.setUrlBase(oldMain.getUrlBase());
  mainConfig.setUseLocalUrlForApiAccess(oldMain.isUseLocalUrlForApiAccess());
  newConfig.setMain(mainConfig);
}

Fixed version (ground truth):
private List<String> migrateMain(OldConfig oldConfig,BaseConfig newConfig){
  logger.info("String_Node_Str");
  List<String> messages=new ArrayList<>();
  MainConfig mainConfig=newConfig.getMain();
  Main oldMain=oldConfig.getMain();
  mainConfig.setApiKey(oldMain.getApikey());
  mainConfig.setDereferer(Strings.isNullOrEmpty((oldMain.getApikey())) ? null : (oldMain.getApikey()));
  mainConfig.setExternalUrl(Strings.isNullOrEmpty(oldMain.getExternalUrl()) ? null : oldMain.getExternalUrl());
  mainConfig.setHost(oldMain.getHost());
  mainConfig.setShutdownForRestart(oldMain.isShutdownForRestart());
  mainConfig.setSocksProxy(Strings.isNullOrEmpty(oldMain.getSocksProxy()) ? null : oldMain.getSocksProxy());
  mainConfig.setHttpProxy(Strings.isNullOrEmpty(oldMain.getHttpProxy()) ? null : oldMain.getHttpProxy());
  mainConfig.setHttpsProxy(Strings.isNullOrEmpty(oldMain.getHttpsProxy()) ? null : oldMain.getHttpsProxy());
  if (!Strings.isNullOrEmpty(oldMain.getSocksProxy()) || !Strings.isNullOrEmpty(oldMain.getHttpProxy()) || !Strings.isNullOrEmpty(oldMain.getHttpsProxy())) {
    logAsWarningAndAdd(messages,"String_Node_Str");
  }
  mainConfig.setSsl(oldMain.isSsl());
  mainConfig.setSslcert(Strings.isNullOrEmpty((oldMain.getSslcert())) ? null : (oldMain.getSslcert()));
  mainConfig.setSslkey(Strings.isNullOrEmpty((oldMain.getSslkey())) ? null : (oldMain.getSslkey()));
  mainConfig.setStartupBrowser(oldMain.isStartupBrowser());
  mainConfig.setTheme(oldMain.getTheme());
  mainConfig.setUrlBase(Strings.isNullOrEmpty((oldMain.getUrlBase())) ? null : (oldMain.getUrlBase()));
  mainConfig.setUseLocalUrlForApiAccess(oldMain.isUseLocalUrlForApiAccess());
  newConfig.setMain(mainConfig);
  return messages;
}
Program: 35321
Project: 35321
Buggy source:
private void migrateAuth(OldConfig oldConfig){
  AuthConfig newAuth=configProvider.getBaseConfig().getAuth();
  Auth oldAuth=oldConfig.getAuth();
  newAuth.setRestrictAdmin(oldAuth.isRestrictAdmin());
  newAuth.setRestrictSearch(oldAuth.isRestrictSearch());
  newAuth.setRestrictStats(oldAuth.isRestrictStats());
  newAuth.setRestrictDetailsDl(oldAuth.isRestrictDetailsDl());
  newAuth.setRestrictIndexerSelection(oldAuth.isRestrictIndexerSelection());
  try {
    newAuth.setAuthType(AuthType.valueOf((oldAuth.getAuthType().toUpperCase())));
  }
 catch (  IllegalArgumentException e) {
  }
  newAuth.setRememberUsers(oldAuth.isRestrictAdmin());
  for (  User user : oldAuth.getUsers()) {
    UserAuthConfig newUserConfig=new UserAuthConfig();
    newUserConfig.setMaySeeAdmin(user.isMaySeeAdmin());
    newUserConfig.setMaySeeStats(user.isMaySeeStats());
    newUserConfig.setMaySeeDetailsDl(user.isMaySeeDetailsDl());
    newUserConfig.setShowIndexerSelection(user.isShowIndexerSelection());
    newUserConfig.setUsername(user.getUsername());
    newUserConfig.setPassword(user.getPassword());
  }
}

Fixed version (ground truth):
private List<String> migrateAuth(OldConfig oldConfig,BaseConfig newConfig){
  logger.info("String_Node_Str");
  List<String> messages=new ArrayList<>();
  AuthConfig newAuth=newConfig.getAuth();
  Auth oldAuth=oldConfig.getAuth();
  newAuth.setRestrictAdmin(oldAuth.isRestrictAdmin());
  newAuth.setRestrictSearch(oldAuth.isRestrictSearch());
  newAuth.setRestrictStats(oldAuth.isRestrictStats());
  newAuth.setRestrictDetailsDl(oldAuth.isRestrictDetailsDl());
  newAuth.setRestrictIndexerSelection(oldAuth.isRestrictIndexerSelection());
  try {
    newAuth.setAuthType(AuthType.valueOf((oldAuth.getAuthType().toUpperCase())));
  }
 catch (  IllegalArgumentException e) {
    logAsWarningAndAdd(messages,"String_Node_Str");
    newAuth.setAuthType(AuthType.NONE);
  }
  newAuth.setRememberUsers(oldAuth.isRestrictAdmin());
  for (  User user : oldAuth.getUsers()) {
    UserAuthConfig newUserConfig=new UserAuthConfig();
    newUserConfig.setMaySeeAdmin(user.isMaySeeAdmin());
    newUserConfig.setMaySeeStats(user.isMaySeeStats());
    newUserConfig.setMaySeeDetailsDl(user.isMaySeeDetailsDl());
    newUserConfig.setShowIndexerSelection(user.isShowIndexerSelection());
    newUserConfig.setUsername(user.getUsername());
    newUserConfig.setPassword(user.getPassword());
    newAuth.getUsers().add(newUserConfig);
  }
  return messages;
}
Program: 35324
Project: 35324
Buggy source:
private void migrateLogging(OldConfig oldConfig){
  LoggingConfig newLogging=configProvider.getBaseConfig().getMain().getLogging();
  Logging oldLogging=oldConfig.getMain().getLogging();
  newLogging.setConsolelevel(oldLogging.getConsolelevel());
  newLogging.setLogfilelevel(oldLogging.getLogfilelevel());
  newLogging.setLogfilename(oldLogging.getLogfilename());
  newLogging.setLogMaxDays(oldLogging.getLogMaxSize());
  newLogging.setLogMaxSize(oldLogging.getKeepLogFiles());
}

Fixed version (ground truth):
private List<String> migrateLogging(OldConfig oldConfig,BaseConfig newConfig){
  LoggingConfig newLogging=newConfig.getMain().getLogging();
  Logging oldLogging=oldConfig.getMain().getLogging();
  newLogging.setConsolelevel(oldLogging.getConsolelevel());
  newLogging.setLogfilelevel(oldLogging.getLogfilelevel());
  newLogging.setLogfilename(oldLogging.getLogfilename());
  newLogging.setLogMaxDays(oldLogging.getLogMaxSize());
  newLogging.setLogMaxSize(oldLogging.getKeepLogFiles());
  return Collections.emptyList();
}
Program: 35325
Project: 35325
Buggy source:
public BaseConfig migrate(String oldConfigJson) throws IOException {
  ObjectMapper mapper=new ObjectMapper();
  OldConfig oldConfig=mapper.readValue(oldConfigJson,OldConfig.class);
  BaseConfig newConfig=configProvider.getBaseConfig();
  migrateMain(oldConfig,newConfig);
  migrateIndexers(oldConfig,newConfig);
  migrateSearching(oldConfig);
  migrateAuth(oldConfig);
  migrateLogging(oldConfig);
  migrateCategories(oldConfig);
  migrateDownloaders(oldConfig);
  return newConfig;
}

Fixed version (ground truth):
public MigrationResult migrate(String oldConfigJson) throws IOException {
  ObjectMapper mapper=new ObjectMapper();
  mapper.configure(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY,true);
  mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES,false);
  mapper.configure(DeserializationFeature.ACCEPT_EMPTY_STRING_AS_NULL_OBJECT,true);
  OldConfig oldConfig=mapper.readValue(oldConfigJson,OldConfig.class);
  BaseConfig newConfig=configProvider.getBaseConfig();
  mapper=new ObjectMapper(new YAMLFactory());
  mapper.registerModule(new Jdk8Module());
  newConfig=mapper.readValue(mapper.writeValueAsString(newConfig),BaseConfig.class);
  List<String> messages=new ArrayList<>();
  if (oldConfig.getMain().getConfigVersion() != NZBHYDRA1_CONFIG_VERSION) {
    logger.warn("String_Node_Str",oldConfig.getMain().getConfigVersion());
    throw new IllegalStateException("String_Node_Str" + oldConfig.getMain().getConfigVersion());
  }
  try {
    messages.addAll(migrateMain(oldConfig,newConfig));
  }
 catch (  Exception e) {
    logger.error("String_Node_Str",e);
    messages.add("String_Node_Str");
  }
  try {
    messages.addAll(migrateIndexers(oldConfig,newConfig));
  }
 catch (  Exception e) {
    logger.error("String_Node_Str",e);
    messages.add("String_Node_Str");
  }
  try {
    messages.addAll(migrateSearching(oldConfig,newConfig));
  }
 catch (  Exception e) {
    logger.error("String_Node_Str",e);
    messages.add("String_Node_Str");
  }
  try {
    messages.addAll(migrateAuth(oldConfig,newConfig));
  }
 catch (  Exception e) {
    logger.error("String_Node_Str",e);
    messages.add("String_Node_Str");
  }
  try {
    messages.addAll(migrateLogging(oldConfig,newConfig));
  }
 catch (  Exception e) {
    logger.error("String_Node_Str",e);
    messages.add("String_Node_Str");
  }
  try {
    messages.addAll(migrateCategories(oldConfig,newConfig));
  }
 catch (  Exception e) {
    logger.error("String_Node_Str",e);
    messages.add("String_Node_Str");
  }
  try {
    messages.addAll(migrateDownloaders(oldConfig,newConfig));
  }
 catch (  Exception e) {
    logger.error("String_Node_Str",e);
    messages.add("String_Node_Str");
  }
  return new MigrationResult(newConfig,messages);
}
Program: 35328
Project: 35328
Buggy source:
protected List<SearchResultItem> pickSearchResultItemsFromDuplicateGroups(SearchResult searchResult){
  List<TreeSet<SearchResultItem>> duplicateGroups=searchResult.getDuplicateDetectionResult().getDuplicateGroups();
  return duplicateGroups.stream().map(x -> {
    return x.stream().sorted(Comparator.comparingInt(SearchResultItem::getIndexerScore).reversed().thenComparing(Comparator.comparingLong((    SearchResultItem y) -> y.getPubDate().getEpochSecond()).reversed())).iterator().next();
  }
).collect(Collectors.toList());
}

Fixed version (ground truth):
protected List<SearchResultItem> pickSearchResultItemsFromDuplicateGroups(SearchResult searchResult){
  List<TreeSet<SearchResultItem>> duplicateGroups=searchResult.getDuplicateDetectionResult().getDuplicateGroups();
  return duplicateGroups.stream().map(x -> {
    return x.stream().sorted(Comparator.comparingInt(SearchResultItem::getIndexerScore).reversed().thenComparing(Comparator.comparingLong((    SearchResultItem y) -> y.getPubDate().getEpochSecond()).reversed())).iterator().next();
  }
).sorted(Comparator.comparingLong((  SearchResultItem x) -> x.getPubDate().getEpochSecond()).reversed()).collect(Collectors.toList());
}
Program: 35330
Project: 35330
Buggy source:
@Override public Serializable generate(SessionImplementor session,Object object) throws HibernateException {
  SearchResultEntity result=(SearchResultEntity)object;
  return (result.getIndexer().getName() + result.getIndexerGuid()).hashCode();
}

Fixed version (ground truth):
@Override public Serializable generate(SessionImplementor session,Object object) throws HibernateException {
  SearchResultEntity result=(SearchResultEntity)object;
  return SearchResultIdCalculator.calculateSearchResultId(result);
}