private static @Nullable IdeScriptEngine createIdeScriptEngine(@Nullable ScriptEngineFactory scriptEngineFactory,
                                                                 @Nullable ClassLoader loader) {
    if (scriptEngineFactory == null) {
      return null;
    }
    IdeScriptEngine engine = new EngineImpl(scriptEngineFactory, loader == null ? AllPluginsLoader.INSTANCE : loader);
    redirectOutputToLog(engine);

    IdeUiService.getInstance().logIdeScriptUsageEvent(scriptEngineFactory.getClass());

    return engine;
  }
private static @Nullable IdeScriptEngine createIdeScriptEngine(@Nullable ScriptEngineFactory scriptEngineFactory,
                                                                 @Nullable ClassLoader loader)