RunnerAndConfigurationSettings (final Project project, final @Nullable ConfigurationContext context) { if (context != null) { final RunConfiguration original = context.getOriginalConfiguration(myConfigurationFactory.getType()); if (original != null) { final RunConfiguration c = original instanceof DelegatingRuntimeConfiguration ? ((DelegatingRuntimeConfiguration<?>)original).getPeer() : original; return RunManager.getInstance(project).createConfiguration(c.clone(), myConfigurationFactory); } } return RunManager.getInstance(project).createConfiguration("", myConfigurationFactory); }