code: protected AbstractQueryImpl createQueryInstance() throws RepositoryException
     {
        try
        {
           String queryImplClassName = handler.getQueryClass();
           Object obj = ClassLoading.forName(queryImplClassName, this).newInstance();
           if (obj instanceof AbstractQueryImpl)
           {
              return (AbstractQueryImpl)obj;
           }
           else
           {
              throw new IllegalArgumentException(queryImplClassName + " is not of type "
                 + AbstractQueryImpl.class.getName());
           }
        }
        catch (Throwable t) //NOSONAR
        {
           throw new RepositoryException("Unable to create query: " + t.toString(), t);
        }
     }
docs: Creates a new instance of an {@link AbstractQueryImpl} which is not
  initialized.
  
  @return an new query instance.
  @throws RepositoryException
  if an error occurs while creating a new query instance.