From 941cce349d488f2fb6907ee44edea933d2a6b65b Mon Sep 17 00:00:00 2001 From: Dmitry Trofimov Date: Mon, 16 Oct 2017 22:07:34 +0200 Subject: [PATCH] User assert instead of IllegalArgumentException (IDEA-CR-25304) --- .../python/run/PythonRunConfigurationForm.java | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/python/src/com/jetbrains/python/run/PythonRunConfigurationForm.java b/python/src/com/jetbrains/python/run/PythonRunConfigurationForm.java index 5bf1a79dabd3..0017b3e66c52 100644 --- a/python/src/com/jetbrains/python/run/PythonRunConfigurationForm.java +++ b/python/src/com/jetbrains/python/run/PythonRunConfigurationForm.java @@ -137,13 +137,11 @@ public class PythonRunConfigurationForm implements PythonRunConfigurationParams, private void checkTargetComboConsistency(boolean mode) { String item = myTargetComboBox.getText(); - if (item == null) { - throw new IllegalArgumentException("item is null"); + assert item != null; + //noinspection StringToUpperCaseOrToLowerCaseWithoutLocale + if (mode && !item.toLowerCase().contains("module")) { + throw new IllegalArgumentException("This option should refer to a module"); } - else //noinspection StringToUpperCaseOrToLowerCaseWithoutLocale - if (mode && !item.toLowerCase().contains("module")) { - throw new IllegalArgumentException("This option should refer to a module"); - } } private void updateShowCommandLineEnabled() {