Program: 63375
Project: 63375
Buggy source:
/** 
 * @param sqlRequest
 * @return
 */
private SQLResponse doQuery(SQLRequest sqlRequest){
  String sql=sqlRequest.getSql();
  String project=sqlRequest.getProject();
  logger.info("String_Node_Str" + project);
  logger.info("String_Node_Str" + sql);
  String serverMode=KylinConfig.getInstanceFromEnv().getServerMode();
  if (!(Constant.SERVER_MODE_QUERY.equals(serverMode.toLowerCase()) || Constant.SERVER_MODE_ALL.equals(serverMode.toLowerCase()))) {
    throw new InternalErrorException("String_Node_Str" + serverMode + "String_Node_Str");
  }
  try {
    if (sql.toLowerCase().contains("String_Node_Str")) {
      SQLResponse sqlResponse=null;
      Cache exceptionCache=cacheManager.getCache(EXCEPTION_QUERY_CACHE);
      Cache queryCache=cacheManager.getCache(SUCCESS_QUERY_CACHE);
      if (KylinConfig.getInstanceFromEnv().isQueryCacheEnabled()) {
        if (null != exceptionCache.get(sqlRequest)) {
          Element element=exceptionCache.get(sqlRequest);
          SQLResponse scanExceptionRes=(SQLResponse)element.getObjectValue();
          scanExceptionRes.setHitCache(true);
          return scanExceptionRes;
        }
        if (null != queryCache.get(sqlRequest)) {
          Element element=queryCache.get(sqlRequest);
          SQLResponse cachedRes=(SQLResponse)element.getObjectValue();
          cachedRes.setHitCache(true);
          return cachedRes;
        }
      }
      sqlResponse=queryService.query(sqlRequest);
      long durationThreshold=KylinConfig.getInstanceFromEnv().getQueryDurationCacheThreshold();
      long scancountThreshold=KylinConfig.getInstanceFromEnv().getQueryScanCountCacheThreshold();
      if (!sqlResponse.getIsException() && (sqlResponse.getDuration() > durationThreshold || sqlResponse.getTotalScanCount() > scancountThreshold)) {
        queryCache.put(new Element(sqlRequest,sqlResponse));
      }
      if (!sqlResponse.getIsException() && KylinConfig.getInstanceFromEnv().isQuerySecureEnabled()) {
        CubeInstance cubeInstance=this.queryService.getCubeManager().getCube(sqlResponse.getCube());
        queryService.checkAuthorization(cubeInstance);
      }
      return sqlResponse;
    }
 else {
      logger.debug("String_Node_Str");
      return new SQLResponse(null,null,0,true,"String_Node_Str");
    }
  }
 catch (  Exception e) {
    SQLResponse exceptionRes=new SQLResponse(null,null,0,true,e.getMessage());
    Cache exceptionCache=cacheManager.getCache(EXCEPTION_QUERY_CACHE);
    exceptionCache.put(new Element(sqlRequest,exceptionRes));
    logger.error("String_Node_Str",e);
    return new SQLResponse(null,null,0,true,e.getMessage());
  }
}

Fixed version (ground truth):
private SQLResponse doQuery(SQLRequest sqlRequest){
  String sql=sqlRequest.getSql();
  String project=sqlRequest.getProject();
  logger.info("String_Node_Str" + project);
  logger.info("String_Node_Str" + sql);
  String serverMode=KylinConfig.getInstanceFromEnv().getServerMode();
  if (!(Constant.SERVER_MODE_QUERY.equals(serverMode.toLowerCase()) || Constant.SERVER_MODE_ALL.equals(serverMode.toLowerCase()))) {
    throw new InternalErrorException("String_Node_Str" + serverMode + "String_Node_Str");
  }
  if (sql.toLowerCase().contains("String_Node_Str")) {
    try {
      SQLResponse sqlResponse=searchQueryInCache(sqlRequest);
      if (null == sqlResponse) {
        sqlResponse=queryService.query(sqlRequest);
        long durationThreshold=KylinConfig.getInstanceFromEnv().getQueryDurationCacheThreshold();
        long scancountThreshold=KylinConfig.getInstanceFromEnv().getQueryScanCountCacheThreshold();
        if (!sqlResponse.getIsException() && (sqlResponse.getDuration() > durationThreshold || sqlResponse.getTotalScanCount() > scancountThreshold)) {
          cacheManager.getCache(SUCCESS_QUERY_CACHE).put(new Element(sqlRequest,sqlResponse));
        }
      }
      checkQueryAuth(sqlResponse);
      return sqlResponse;
    }
 catch (    AccessDeniedException ade) {
      logger.error("String_Node_Str",ade);
      throw new ForbiddenException(ade.getLocalizedMessage());
    }
catch (    Exception e) {
      SQLResponse exceptionRes=new SQLResponse(null,null,0,true,e.getMessage());
      Cache exceptionCache=cacheManager.getCache(EXCEPTION_QUERY_CACHE);
      exceptionCache.put(new Element(sqlRequest,exceptionRes));
      logger.error("String_Node_Str",e);
      throw new InternalErrorException(makeErrorMsgUserFriendly(e.getLocalizedMessage()));
    }
  }
 else {
    logger.debug("String_Node_Str");
    throw new InternalErrorException(makeErrorMsgUserFriendly("String_Node_Str"));
  }
}