docs: public boolean checkTopicSyntax(String topic)
      throws InvalidTopicSyntaxException
    {
      checkTopicNotNull(topic);
  		    
      char[] chars = topic.toCharArray();
      boolean acceptHash = true;
      // becomes false when hash seen, stays false thereafter
      boolean acceptWild = true;
      // becomes false on non-separator, true on separator
      boolean acceptOrdinary = true;
      // becomes false on wildcard, true on separator
      boolean hasWild = false;
  
      for (int i = 0; i < chars.length; i++)
      {
        char cand = chars[i];
        if (cand == MatchSpace.SUBTOPIC_MQSI_MATCHONE_CHAR)
          if (acceptWild)
          {
            hasWild = true;
            acceptWild = acceptOrdinary = false;
          }
          else
            throw new InvalidTopicSyntaxException(
              NLS.format(
                "INVALID_MQSI_TOPIC_ERROR_CWSIH0008",
                new Object[] { topic, new Integer(i+1) }));      
        else
          if (cand == MatchSpace.SUBTOPIC_MQSI_MATCHMANY_CHAR)
            if (acceptWild && acceptHash)
            {
              hasWild = true;
              acceptWild = acceptHash = acceptOrdinary = false;
            }
            else
              throw new InvalidTopicSyntaxException(
                NLS.format(
                  "INVALID_MQSI_TOPIC_ERROR_CWSIH0009",
                  new Object[] { topic }));
          else
            if (cand == MatchSpace.SUBTOPIC_SEPARATOR_CHAR)
              if (acceptWild && i > 0) // Allow an initial separator
                // Two separators together
                throw new InvalidTopicSyntaxException(
                  NLS.format(
                    "INVALID_MQSI_TOPIC_ERROR_CWSIH0010",
                    new Object[] { topic }));
              else
              {
                acceptWild = true;
                acceptOrdinary = true;
              }
              else
                if (!acceptOrdinary)
                  throw new InvalidTopicSyntaxException(
                    NLS.format(
                      "INVALID_MQSI_TOPIC_ERROR_CWSIH0011",
                      new Object[] { topic }));
                else
                  acceptWild = false;
      }
      return hasWild;
    }