docs: @SuppressWarnings( "deprecation" )
      @Override
      public org.modeshape.jcr.api.query.QueryResult execute() throws RepositoryException {
          context.checkValid();
          final long start = System.nanoTime();
          // Create an executable query and set it on this object ...
          CancellableQuery newExecutable = context.createExecutableQuery(query, hints, variables);
          CancellableQuery executable = executingQuery.getAndSet(newExecutable);
          if (executable == null) {
              // We are the first to call 'execute()', so use our newly-created one ...
              executable = newExecutable;
          }
          // otherwise, some other thread called execute, so we can use it and just wait for the results ...
          final QueryResults result = executable.execute(); // may be cancelled
  
          // And reset the reference to null (if not already set to something else) ...
          executingQuery.compareAndSet(executable, null);
  
          checkForProblems(result.getProblems());
          context.recordDuration(Math.abs(System.nanoTime() - start), TimeUnit.NANOSECONDS, statement, language);
          if (Query.XPATH.equals(language)) {
              return new XPathQueryResult(context, statement, result, hints.restartable, hints.rowsKeptInMemory);
          } else if (Query.SQL.equals(language)) {
              return new JcrSqlQueryResult(context, statement, result, hints.restartable, hints.rowsKeptInMemory);
          }
          return new JcrQueryResult(context, statement, result, hints.restartable, hints.rowsKeptInMemory);
      }