diff --git a/platform/lang-impl/src/com/intellij/codeInsight/hints/settings/ParameterNameHintsConfigurable.java b/platform/lang-impl/src/com/intellij/codeInsight/hints/settings/ParameterNameHintsConfigurable.java index 6791e43f51e2..3db73d315bae 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/hints/settings/ParameterNameHintsConfigurable.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/hints/settings/ParameterNameHintsConfigurable.java @@ -107,18 +107,17 @@ public class ParameterNameHintsConfigurable extends DialogWrapper { private void updateOkEnabled() { String text = myEditorTextField.getText(); - List rules = StringUtil.split(text, "\n"); - + List rules = StringUtil.split(text, "\n", true, false); Stream intStream = IntStream.iterate(0, i -> i + 1).boxed(); List invalidLines = StreamEx.of(rules) - .map((rule) -> MatcherConstructor.INSTANCE.createMatcher(rule)) .zipWith(intStream) - .filter((entry) -> entry.getKey() == null) - .map((entry -> entry.getValue())) + .filterKeys((rule) -> !rule.isEmpty()) + .mapKeys((rule) -> MatcherConstructor.INSTANCE.createMatcher(rule)) + .filterKeys((matcher) -> matcher == null) + .values() .toList(); - getOKAction().setEnabled(invalidLines.isEmpty()); highlightErrorLines(invalidLines); }