private boolean hasCustomReferenceFactory() {
    if (hasCustomReferenceFactory == null) {
      boolean hasEnabledFactory = false;
      for (JpsReferenceCustomFactory extension : JpsServiceManager.getInstance().getExtensions(JpsReferenceCustomFactory.class)) {
        if (extension.isEnabled()) {
          hasEnabledFactory = true;
          break;
        }
      }
      hasCustomReferenceFactory = hasEnabledFactory;
    }
    return hasCustomReferenceFactory;
  }
private boolean hasCustomReferenceFactory()