public @NotNull ToolWindowFactory getToolWindowFactory(@NotNull PluginDescriptor pluginDescriptor) {
    ToolWindowFactory factory = this.factory;
    if (factory != null) {
      return factory;
    }

    if (factoryClass == null) {
      throw new PluginException("No toolwindow factory specified for " + id, pluginDescriptor.getPluginId());
    }

    //noinspection SynchronizeOnThis
    synchronized (this) {
      factory = this.factory;
      if (factory != null) {
        return factory;
      }

      //noinspection NonPrivateFieldAccessedInSynchronizedContext
      factory = ApplicationManager.getApplication().instantiateClass(factoryClass, pluginDescriptor);
      this.factory = factory;
    }
    return factory;
  }
public @NotNull ToolWindowFactory getToolWindowFactory(@NotNull PluginDescriptor pluginDescriptor)