diff --git a/java/execution/impl/src/com/intellij/execution/junit/JavaRunConfigurationProducerBase.java b/java/execution/impl/src/com/intellij/execution/junit/JavaRunConfigurationProducerBase.java index 1803a99441d0..0163b2f070eb 100644 --- a/java/execution/impl/src/com/intellij/execution/junit/JavaRunConfigurationProducerBase.java +++ b/java/execution/impl/src/com/intellij/execution/junit/JavaRunConfigurationProducerBase.java @@ -1,4 +1,4 @@ -// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. +// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.intellij.execution.junit; import com.intellij.execution.JavaRunConfigurationExtensionManager; @@ -77,7 +77,7 @@ public abstract class JavaRunConfigurationProducerBase { * not applicable to this run configuration producer. */ @Nullable - public ConfigurationFromContext createConfigurationFromContext(ConfigurationContext context) { + public ConfigurationFromContext createConfigurationFromContext(@NotNull ConfigurationContext context) { final RunnerAndConfigurationSettings settings = cloneTemplateConfiguration(context); Ref ref = new Ref<>(context.getPsiLocation()); try { diff --git a/python/src/com/jetbrains/python/testing/AbstractPythonTestConfigurationProducer.kt b/python/src/com/jetbrains/python/testing/AbstractPythonTestConfigurationProducer.kt index 8da09be86049..e537084d9272 100644 --- a/python/src/com/jetbrains/python/testing/AbstractPythonTestConfigurationProducer.kt +++ b/python/src/com/jetbrains/python/testing/AbstractPythonTestConfigurationProducer.kt @@ -1,4 +1,4 @@ -// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. +// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.jetbrains.python.testing import com.intellij.execution.RunManager @@ -30,8 +30,8 @@ abstract class AbstractPythonTestConfigurationProducer = super.getConfigurationSettingsList(runManager).filter { configurationClass.isAssignableFrom(it.configuration.javaClass) } - override fun createConfigurationFromContext(context: ConfigurationContext?): ConfigurationFromContext? { - if (context == null || !configurationClass.isAssignableFrom(cloneTemplateConfiguration(context).configuration.javaClass)) { + override fun createConfigurationFromContext(context: ConfigurationContext): ConfigurationFromContext? { + if (!configurationClass.isAssignableFrom(cloneTemplateConfiguration(context).configuration.javaClass)) { return null } return super.createConfigurationFromContext(context) diff --git a/python/src/com/jetbrains/python/testing/PyTestsShared.kt b/python/src/com/jetbrains/python/testing/PyTestsShared.kt index 2e502c785da7..1e3060fcfb59 100644 --- a/python/src/com/jetbrains/python/testing/PyTestsShared.kt +++ b/python/src/com/jetbrains/python/testing/PyTestsShared.kt @@ -738,9 +738,9 @@ internal class PyTestsConfigurationProducer : AbstractPythonTestConfigurationPro return cloneTemplateConfigurationStatic(context, findConfigurationFactoryFromSettings(context.module)) } - override fun createConfigurationFromContext(context: ConfigurationContext?): ConfigurationFromContext? { + override fun createConfigurationFromContext(context: ConfigurationContext): ConfigurationFromContext? { // Since we need module, no need to even try to create config with out of it - context?.module ?: return null + context.module ?: return null return super.createConfigurationFromContext(context) }