code: public void parametersAreDefined(Report report) throws ParameterNotFoundException {
          String[] paramNames;
          String sql = report.getSql();
          if (sql == null) {
              sql = report.getQuery().toString();
          }
          Query query = new Query(sql);
          paramNames = query.getParameterNames();
  
          List<QueryParameter> parameters = report.getParameters();
  
          for (String paramName : paramNames) {
              QueryParameter param = null;
              for (QueryParameter p : parameters) {
                  if (paramName.equals(p.getName())) {
                      param = p;
                  }
              }
              if (param == null) {
                  throw new ParameterNotFoundException(paramName);
              }
          }
      }
docs: Test if all parameters used in the report are defined
  
  @param report report object
  @throws ParameterNotFoundException if a parameter used in the report is not defined