@Override
  public void patchJavaParameters(Executor executor, RunProfile configuration, JavaParameters javaParameters) {
    ApplicationManager.getApplication().assertReadAccessAllowed();
    if (!executor.getId().equals(DefaultDebugExecutor.EXECUTOR_ID)) {
      return;
    }

    if (!GroovyDebuggerSettings.getInstance().ENABLE_GROOVY_HOTSWAP) {
      return;
    }

    if (hasSpringLoadedReloader(javaParameters)) {
      return;
    }

    if (!(configuration instanceof RunConfiguration)) {
      return;
    }

    final Project project = ((RunConfiguration)configuration).getProject();
    if (project == null) {
      return;
    }

    if (!LanguageLevelProjectExtension.getInstance(project).getLanguageLevel().isAtLeast(LanguageLevel.JDK_1_5)) {
      return;
    }

    if (configuration instanceof ModuleBasedConfiguration) {
      final Module module = ((ModuleBasedConfiguration<?, ?>)configuration).getConfigurationModule().getModule();
      if (module != null) {
        final LanguageLevel level = LanguageLevelUtil.getEffectiveLanguageLevel(module);
        if (!level.isAtLeast(LanguageLevel.JDK_1_5)) {
          return;
        }
      }
    }

    Sdk jdk = javaParameters.getJdk();
    if (jdk != null) {
      JavaSdkVersion version = JavaSdk.getInstance().getVersion(jdk);
      if (version != null && !version.isAtLeast(JavaSdkVersion.JDK_1_8) && jdk.getHomePath() != null) {
        JdkVersionDetector.JdkVersionInfo info = JdkVersionDetector.getInstance().detectJdkVersionInfo(jdk.getHomePath());
        if (info != null && info.variant == JdkVersionDetector.Variant.IBM) {
          LOG.info("Due to old IBM JDK peculiarities (IDEA-59070) we don't add Groovy agent when running applications under it");
          return;
        }
      }
    }

    if (!project.isDefault() && containsGroovyClasses(project)) {
      String agentPath = JavaExecutionUtil.handleSpacesInAgentPath(getAgentJarPath(), "groovyHotSwap", GROOVY_HOTSWAP_AGENT_PATH);
      if (agentPath != null) {
        javaParameters.getVMParametersList().add("-javaagent:" + agentPath);
      }
    }
  }
@Override
  public void patchJavaParameters(Executor executor, RunProfile configuration, JavaParameters javaParameters)