Program: 42890
Project: 42890
Buggy source:
public String getGat(String oxdId,List<String> scopes){
  SiteConfiguration site=siteService.getSite(oxdId);
  UmaConfiguration discovery=discoveryService.getUmaDiscoveryByOxdId(oxdId);
  if (!Strings.isNullOrEmpty(site.getGat()) && site.getGatExpiresAt() != null) {
    boolean isExpired=site.getGatExpiresAt().after(new Date());
    if (!isExpired) {
      LOG.debug("String_Node_Str" + site.getGat() + "String_Node_Str"+ site);
      return site.getGat();
    }
  }
  final CreateGatService gatService=UmaClientFactory.instance().createGatService(discovery,httpService.getClientExecutor());
  final String aat=getAat(oxdId).getToken();
  final RPTResponse response=gatService.createGAT("String_Node_Str" + aat,site.opHostWithoutProtocol(),new GatRequest(scopes));
  if (response != null && StringUtils.isNotBlank(response.getRpt())) {
    RptStatusService rptStatusService=UmaClientFactory.instance().createRptStatusService(discovery,httpService.getClientExecutor());
    RptIntrospectionResponse status=rptStatusService.requestRptStatus("String_Node_Str" + getPat(oxdId).getToken(),response.getRpt(),"String_Node_Str");
    LOG.debug("String_Node_Str" + response.getRpt() + "String_Node_Str"+ status);
    if (status.getActive()) {
      LOG.debug("String_Node_Str",response.getRpt());
      site.setGat(response.getRpt());
      site.setGatCreatedAt(status.getIssuedAt());
      site.setGatExpiresAt(status.getExpiresAt());
      siteService.updateSilently(site);
      return response.getRpt();
    }
  }
  LOG.error("String_Node_Str" + site);
  throw new ErrorResponseException(ErrorResponseCode.FAILED_TO_GET_GAT);
}

Fixed version (ground truth):
public String getGat(String oxdId,List<String> scopes){
  SiteConfiguration site=siteService.getSite(oxdId);
  UmaConfiguration discovery=discoveryService.getUmaDiscoveryByOxdId(oxdId);
  if (!Strings.isNullOrEmpty(site.getGat()) && site.getGatExpiresAt() != null) {
    boolean isExpired=site.getGatExpiresAt().before(new Date());
    if (!isExpired) {
      LOG.debug("String_Node_Str" + site.getGat() + "String_Node_Str"+ site);
      return site.getGat();
    }
  }
  final CreateGatService gatService=UmaClientFactory.instance().createGatService(discovery,httpService.getClientExecutor());
  final String aat=getAat(oxdId).getToken();
  final RPTResponse response=gatService.createGAT("String_Node_Str" + aat,site.opHostWithoutProtocol(),new GatRequest(scopes));
  if (response != null && StringUtils.isNotBlank(response.getRpt())) {
    RptStatusService rptStatusService=UmaClientFactory.instance().createRptStatusService(discovery,httpService.getClientExecutor());
    RptIntrospectionResponse status=rptStatusService.requestRptStatus("String_Node_Str" + getPat(oxdId).getToken(),response.getRpt(),"String_Node_Str");
    LOG.debug("String_Node_Str" + response.getRpt() + "String_Node_Str"+ status);
    if (status.getActive()) {
      LOG.debug("String_Node_Str",response.getRpt());
      site.setGat(response.getRpt());
      site.setGatCreatedAt(status.getIssuedAt());
      site.setGatExpiresAt(status.getExpiresAt());
      siteService.updateSilently(site);
      return response.getRpt();
    }
  }
  LOG.error("String_Node_Str" + site);
  throw new ErrorResponseException(ErrorResponseCode.FAILED_TO_GET_GAT);
}