mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
don't warn on empty regexp element
This commit is contained in:
+3
@@ -56,6 +56,9 @@ public class DuplicateAlternationBranchInspection extends LocalInspectionTool {
|
||||
final RegExpBranch[] branches = pattern.getBranches();
|
||||
for (int i = 0; i < branches.length - 1; i++) {
|
||||
final RegExpBranch branch1 = branches[i];
|
||||
if (branch1.getAtoms().length == 0) {
|
||||
continue;
|
||||
}
|
||||
for (int j = i + 1; j < branches.length; j++) {
|
||||
final RegExpBranch branch2 = branches[j];
|
||||
if (RegExpEquivalenceChecker.areElementsEquivalent(branch1, branch2)) {
|
||||
|
||||
+4
@@ -35,6 +35,10 @@ public class DuplicateAlternationBranchInspectionTest extends RegExpInspectionTe
|
||||
highlightTest("<warning descr=\"Duplicate branch in alternation\">[abc]</warning>|<warning descr=\"Duplicate branch in alternation\">[cba]</warning>");
|
||||
}
|
||||
|
||||
public void testEmptyBranches() {
|
||||
highlightTest("|||");
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
protected LocalInspectionTool getInspection() {
|
||||
|
||||
Reference in New Issue
Block a user