InspectionMetaDataDialog (Project project, @Nullable RegExpInspectionConfiguration configuration) { Function<String, @Nullable @NlsContexts.DialogMessage String> nameValidator = name -> { for (RegExpInspectionConfiguration current : myConfigurations) { if ((configuration == null || !configuration.getUuid().equals(current.getUuid())) && current.getName().equals(name)) { return RegExpBundle.message("dialog.message.inspection.with.name.exists.warning", name); } } return null; }; if (configuration == null) { return new InspectionMetaDataDialog(project, nameValidator); } return new InspectionMetaDataDialog(project, nameValidator, configuration.getName(), configuration.getDescription(), configuration.getProblemDescriptor(), configuration.getSuppressId()); }