mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-03-22 06:50:54 +07:00
RegExp: do not allow adding inspection with an existing name
GitOrigin-RevId: 63bf6ccc189cac5bd81c7b4f9eb7876f932b37de
This commit is contained in:
committed by
intellij-monorepo-bot
parent
a344209553
commit
6eb6d14019
@@ -23,6 +23,7 @@ color.settings.quantifier=Quantifier
|
||||
color.settings.quote.character=Quote escape
|
||||
color.settings.redundant.escape.sequence=Redundant escape sequence
|
||||
color.settings.title.regexp=RegExp
|
||||
dialog.message.inspection.with.name.exists.warning=Inspection with name ''{0}'' already exists
|
||||
dialog.message.name.must.not.be.empty=Name must not be empty
|
||||
dialog.message.suppress.id.already.in.use.by.another.inspection=Suppress ID ''{0}'' is already in use by another inspection
|
||||
dialog.message.suppress.id.must.match.regex.za.z=Suppress ID must match regex [a-zA-Z_0-9.-]+
|
||||
|
||||
@@ -67,6 +67,19 @@ public class MetaDataDialog extends DialogWrapper {
|
||||
if (StringUtil.isEmpty(name)) {
|
||||
warnings.add(new ValidationInfo(RegExpBundle.message("dialog.message.name.must.not.be.empty"), myNameTextField));
|
||||
}
|
||||
else {
|
||||
for (RegExpInspectionConfiguration configuration : configurations) {
|
||||
if (myNewInspection) {
|
||||
if (configuration.getName().equals(name)) {
|
||||
warnings.add(new ValidationInfo(RegExpBundle.message("dialog.message.inspection.with.name.exists.warning", name), myNameTextField));
|
||||
break;
|
||||
}
|
||||
} else if (!configuration.getUuid().equals(myConfiguration.getUuid()) && configuration.getName().equals(name)) {
|
||||
warnings.add(new ValidationInfo(RegExpBundle.message("dialog.message.inspection.with.name.exists.warning", name), myNameTextField));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
final String suppressId = getSuppressId();
|
||||
if (!StringUtil.isEmpty(suppressId)) {
|
||||
if (!mySuppressIdPattern.matcher(suppressId).matches()) {
|
||||
|
||||
Reference in New Issue
Block a user