code: private void initializeMolecule() throws CDKException {
  
          // initialise required invariants - the query has ISINRING set if
          // the query contains ring queries [R?] [r?] [x?] etc.
          SmartsMatchers.prepare(atomContainer, true);
  
          // providing skip aromaticity has not be set apply the desired
          // aromaticity model
          try {
              if (!skipAromaticity) {
                  aromaticity.apply(atomContainer);
              }
          } catch (CDKException e) {
              logger.debug(e.toString());
              throw new CDKException(e.toString(), e);
          }
      }
docs: Prepare the target molecule for analysis.  We perform ring perception and aromaticity detection and set up
  the appropriate properties. Right now, this function is called each time we need to do a query and this is
  inefficient.
  
  @throws CDKException if there is a problem in ring perception or aromaticity detection, which is usually related
  to a timeout in the ring finding code.