@Override
  protected ValidationInfo doValidate() {
    final String text = getEnteredName();
    if (!GroovyNamesUtil.isIdentifier(text)) {
      return new ValidationInfo(GroovyRefactoringBundle.message("name.is.wrong", text), myNameSuggestionsField);
    }

    if (myTypeComboBox.isClosureSelected()) {
      final Ref<ValidationInfo> info = new Ref<>();
      for (Object2IntMap.Entry<JCheckBox> entry : toRemoveCBs.object2IntEntrySet()) {
        if (!entry.getKey().isSelected()) {
          continue;
        }

        final GrParameter param = myInfo.getToReplaceIn().getParameters()[entry.getIntValue()];
        final ParameterInfo pinfo = findParamByOldName(param.getName());
        if (pinfo == null || !pinfo.passAsParameter) {
          continue;
        }

        final String message = GroovyRefactoringBundle
          .message("you.cannot.pass.as.parameter.0.because.you.remove.1.from.base.method", pinfo.getName(), param.getName());
        info.set(new ValidationInfo(message));
        break;
      }

      if (info.get() != null) {
        return info.get();
      }
    }

    return null;
  }
@Override
  protected ValidationInfo doValidate()